# Self-hosted knowledge base with AI: where the index and the model actually run

> A self-hosted knowledge base should keep its store, search index and AI on your side. How Outline, Docmost, BookStack, Wiki.js and Baalda compare.

Source: https://baalda.com/blog/self-hosted-knowledge-base
Site: Baalda, https://baalda.com
Published: 2026-11-09

**Short answer.** A self-hosted knowledge base runs the pages, the search index and the AI on servers you control. Most self-host only the pages: AI search then needs an embedding API, a vector database or a paid edition. BookStack has no AI, Docmost can use Ollama, and Baalda builds its index on your server and lets your assistant connect over MCP.

A self-hosted knowledge base is one where the notes, the search index and the AI all run on infrastructure your team controls. Most tools sold under that label only self-host the first of the three. Add "with AI" and the other two usually go back out the door: to an embedding API, a second vector database, and a paid licence tier.

That is the line worth checking before you install anything. Running the wiki on your own server is the easy part, and every tool on the usual lists can do it. What differs is where the search index is built, which model reads it, and what you have to buy for either to exist.

## What does "self-hosted" have to cover once AI is involved?

Three layers, and a knowledge base can put each one in a different place:

- **The store.** Where the pages actually live, and in what format. Postgres rows, a JSON document model, or files.
- **The index.** What turns a question into the right pages. Keyword search, embeddings, or both. Embeddings have to be computed by something, and that something is often a hosted API.
- **The model.** What reads the pages and writes an answer. Built into the knowledge base, or an assistant your team already uses that connects from outside.

A team with a compliance reason for self-hosting usually means all three. The listicles that rank for this query mostly check the first.

Figure: Five self-hosted knowledge bases and where each keeps its store, its search index and its model

## Which self-hosted knowledge bases have AI, and where does it run?

As of 9 November 2026, from each project's own docs and licence file:

| Tool | Licence | Built-in AI | Embeddings | MCP |
|---|---|---|---|---|
| Outline | BSL 1.1 | AI answers, licensed editions only | OpenAI or Azure, into a pgvector database | Yes, read and write |
| Docmost | AGPL-3.0 core | AI search and chat, Business and Enterprise | Your configured provider, including Ollama | Yes, Business or Enterprise licence |
| BookStack | MIT | None | None | None |
| Wiki.js | AGPL-3.0 | None, by design | None | Yes, off by default |
| AnythingLLM | MIT | It is the product: chat over your documents | A built-in local model by default | Client only |
| Baalda | Apache-2.0 | None, you bring the assistant | Computed in the server process, no API | Yes, read and write |

A few things stand out. **Outline** is the closest thing to a self-hosted Notion, and its licence says plainly that BSL 1.1 is "not an Open Source license" until it converts to Apache 2.0 in 2030. Its AI answers need an OpenAI or Azure key, a separate vector database URL, and a licensed edition. **Docmost** is genuinely open at the core and documents Ollama as a provider, so it is the one wiki here that can run its own AI fully offline, but AI search requires a valid licence key. **BookStack** is the dependable choice when nobody wants AI near the wiki at all. **AnythingLLM** is the reverse: excellent at chatting with documents, and not a place a team writes and maintains pages together.

If you are choosing among these purely as wikis, [best wiki software](/blog/best-wiki-software) compares them on what a reader gets years later. This post is about the AI layer.

## How does Baalda keep the index and the model on your side?

Baalda is a team notes app rather than a wiki, and it takes a different route to "with AI": it ships no model, and it builds its own search index without calling anything.

**The store is files.** Every note is a plain `.md` file on each member's disk. The self-hosted server, one Apache-2.0 service plus Postgres, keeps the shared state that real-time editing needs, and the [deploy guide](/docs/deploy) is explicit that a self-hosted server has no paid tier and no vault or member limits.

**The index is derived from those notes, on the server, by the server.** Whenever a note changes, the server re-reads its text, parses its `[[wikilinks]]` into link edges, and computes a 256-dimension vector with a built-in embedder. That embedder is a hashed bag of words: each word is hashed into one of 256 buckets, counts are normalised, and similarity is a dot product. The code comment says why it is the default: it is "fully local and offline" so "air-gapped deploys work without any API". Search ranks notes by that similarity plus a small boost for each query word that appears, and the same pass covers the text extracted from attached files such as PDFs, spreadsheets and Word documents. The index is a cache. Delete it and it rebuilds from the notes.

**The model is whoever connects.** The server exposes an MCP endpoint at your own address plus `/api/mcp`. A person creates a token in the app, and their assistant (Claude, Codex, Cursor, a local model through LM Studio) connects with it and gets tools such as `search_notes`, `read_note` and `create_note`. The [MCP setup guide](/docs/mcp-setup) covers each client. Whatever model you trust is the model that reads the knowledge base. If that is a local one, nothing leaves the building. If it is Claude, the notes the assistant reads go to Anthropic, which is a decision your team makes per person rather than one the wiki makes for everyone.

## Does the AI search see notes the person cannot?

This is the question to ask any self-hosted knowledge base with AI search, because an index built over everything can leak through its ranking even when the final page is refused.

In Baalda the permission check happens before scoring, not after. `search_notes` first asks the permission resolver which notes this token's owner may read, then pushes that set into the search query, so a note outside it is never scored at all. The source comment names the risk directly: unreadable notes would otherwise be "a content oracle", where the order of results gives away what a hidden note says. Files follow the same rule, gated by the folder they sit in. Permissions are per file and per folder, set in the app, and the same resolver decides what the editor shows a person and what their assistant can find. [The MCP server for team notes](/blog/mcp-server-team-notes) covers how that resolver works on every tool call.

Figure: An assistant's search, filtered to what its owner may read before any note is ranked

## Where is a hashed index worse than a real embedding model?

On meaning. A hashed bag of words matches words, not ideas. Search for "holiday policy" and a note titled "annual leave" will rank poorly unless it also uses the word "holiday". Docmost with an Ollama embedding model, Outline with OpenAI embeddings, and AnythingLLM's built-in model all handle synonyms better. The code leaves room to swap in a real embedder, but a self-hosted Baalda server today uses the built-in one.

There is a second gap. The server's tokenizer reads runs of ASCII letters, digits and underscores, and treats every other character as a separator. English notes are fine. Accented words lose their accented letters, and a vault written in Arabic, Chinese or Greek gets almost nothing out of `search_notes` today. The desktop app's own search is a different index, SQLite full-text search with Unicode tokenization, so a person searching in the app is not affected. Their assistant, searching over MCP, is.

In practice the assistant covers some of the gap, because it can rephrase and search again, and then read whole notes with `read_note` rather than trusting a single ranked list. That is not free: each search costs a round trip and the assistant's context. A team that lives on fuzzy questions over thousands of pages will get more out of a proper embedding index.

## When is Baalda the wrong self-hosted knowledge base?

More often than a comparison page usually admits:

- **Everyone reads it in a browser.** Baalda is a desktop app for macOS, Windows and Linux. A wiki that a whole company opens from a link, including people who will never install anything, is Outline, BookStack, Wiki.js or Docmost.
- **You want answers built in.** Baalda has no chat box and no "ask the wiki" button. If the point is that anyone can ask a question without setting up an assistant, Docmost or Outline on a licensed edition gives you that.
- **You need SSO.** The Apache-2.0 server has none. Baalda's repository sets SSO aside for a separate enterprise directory under a commercial licence, so check its current state before you depend on it.
- **Your notes are not in English.** See the tokenizer gap above. For an assistant searching a non-English knowledge base, an embedding model that understands the language will do far better.
- **Your knowledge is mostly PDFs nobody edits.** That is a document chat problem. AnythingLLM is built for it.

Where it fits is a team of five to fifty whose knowledge base is written and rewritten by the people doing the work and by their assistants, who want the notes as files that outlive any server, and who want "self-hosted" to cover the index and the model too. [Self-hosted shared notes](/blog/self-hosted-shared-notes) covers the editing half of that in more depth.

## FAQ

### What is the best self-hosted knowledge base?

It depends on who reads it. For a wiki the whole company opens in a browser, BookStack if you want no AI and Docmost if you want AI that can run on Ollama. Outline is the most polished but is BSL-licensed and its AI needs a licensed edition. For a team that writes notes with its assistants and wants them as markdown files, Baalda.

### Can a self-hosted knowledge base use AI without sending data to OpenAI?

Yes, if both the embeddings and the model run on your side. Docmost documents Ollama for both, AnythingLLM ships a local embedding model by default, and Baalda's server computes its own search vectors with no API call. The model is the other half: with Baalda it is whichever assistant connects over MCP, so a local model keeps everything in-house.

### Is Outline open source?

Not under its current licence. Outline is published under the Business Source License 1.1, which its licence file says is not an open source licence, and it converts to Apache 2.0 on 23 October 2030. You can self-host it for your own team, and its AI answers need a licensed edition plus an OpenAI or Azure key.

### How good is Baalda's built-in search compared with a real embedding model?

Weaker on meaning. The server uses a hashed bag of words, so it matches words rather than synonyms, and its tokenizer only reads ASCII letters and digits, so non-English vaults search poorly over MCP. In exchange it needs no API, no GPU and no vector database. An assistant can partly compensate by searching again and reading whole notes.
