Standard research · Standard sources
How to best build a knowledge base that can work for humans and AI agents
Completed August 24, 2026
Glossary
| Term | Meaning |
|---|---|
| BM25 | a classic lexical (keyword) ranking algorithm used to find exact term matches |
| ACL | access control list — the rules determining which users or agents may read which content |
Building a knowledge base that works for humans and AI agents
Bottom line
There is no single product that is best for every organization, but there is a best architecture: one canonical content store with two faces. Keep a single source of truth — version-controlled Markdown files with YAML frontmatter, the pattern that Google's Open Knowledge Format (OKF) specification codified in June 2026 — and serve the same content to humans through a wiki-style editor and search interface, and to agents through an application programming interface (API) and a Model Context Protocol (MCP) server. Add hybrid retrieval (BM25 keyword search plus vector search plus reranking), enforce permissions at query time, and treat freshness as a monitored operational metric. Buy rather than build when your authors are non-technical or your knowledge is scattered across dozens of tools: curated AI knowledge bases (Notion, Confluence, Guru) and enterprise AI search layers (Glean-class) are the realistic choices. Build from plain files only when your content already lives in Git and you have engineering capacity to maintain embedding pipelines, indexes, and access control. GitBook on OKF Superkind buyer comparison
Why one source of truth is the core rule
The most common production failure is dual pipelines: a human wiki and a separate retrieval index that drift apart. When the wiki changes but the index does not, agents serve confident, stale answers. Production retrieval-augmented generation (RAG) guidance treats staleness as the top reliability risk and warns that a stale knowledge layer is worse than none because it masquerades as ground truth. CoreWeave on production RAG
Three practical rules follow:
- Retired content must be invisible to agents, not just removed from the human UI — archiving is an agent-facing operation. CoreWeave on production RAG
- Index freshness is a monitored target (for example, edits visible to agents within one hour), not a background chore. CoreWeave on production RAG
- Author once, serve twice. Markdown is the natural interchange format: readable by humans, cheap for large language models (LLMs) to consume, and reviewable as diffs in version control. Visual Studio Magazine on agentic Markdown
The three product shapes
Buyer guides converge on three product shapes. Superkind buyer comparison Fastio AI knowledge management comparison
| Shape | Examples | How it works | Best for | Watch out |
|---|---|---|---|---|
| Enterprise AI search / indexing layer | Glean, Microsoft 365 Copilot, Sinequa, Dashworks | Indexes 100+ existing apps; no re-authoring; permission-aware retrieval with citations | Knowledge scattered across many tools; no appetite for content migration | Inherits content debt; custom pricing |
| Suite-native AI | Atlassian Rovo (Confluence, Jira); Microsoft 365 Copilot (SharePoint, Teams) | Deepest integration inside one vendor's stack | Organizations standardized on one suite | Weak outside the suite |
| Curated knowledge base + AI | Notion AI Agents, Guru, Confluence Rovo, Document360 | Deliberate authoring and verification with AI search on top | Small teams producing canonical answers | Per-seat cost; needs authoring discipline |
Glean illustrates the search-layer approach: it connects to one hundred-plus sources, builds a knowledge graph of people, documents, and concepts, exposes a large library of agent actions, inherits source-system permissions, and cites sources in every answer. Glean on enterprise AI
What the best dual-use setups have in common
Across vendor documentation and practitioner comparisons, the same checklist appears:
- Single canonical store, no dual authoring. Superkind buyer comparison
- Machine-readable structure: YAML frontmatter (a human-readable metadata format) with fields such as document type, owner, and verification status. OKF's only required field is 'type', and it defines trust tiers (human-reviewed, machine-confirmed, unverified) so agents can weigh content by provenance. GitBook on OKF
- Markdown as the native serving format; agents consume the markup directly instead of scraping rendered HTML. Visual Studio Magazine on agentic Markdown
- Version control with human review (diffs and pull requests) for knowledge changes. Visual Studio Magazine on agentic Markdown OpenKnowledge on markdown knowledge
- A standard agent interface: an MCP server or a representational state transfer (REST) API exposing search and read tools.
- Query-time permission enforcement so humans and agents see the identical permissioned content. Glean on enterprise AI
- A freshness lifecycle: expiry dates, verification status, and archive invisibility. CoreWeave on production RAG
- Citations: every agent answer links back to source documents for auditability. Glean on enterprise AI
Recommended architecture: five layers
| Layer | Recommended choice | Why |
|---|---|---|
| 1. Content | Markdown + YAML frontmatter in Git, or a wiki with clean Markdown export | One canonical, versioned format; the OKF pattern |
| 2. Interface | MCP server and REST API over the same store; optional llms.txt discovery index | Agents get native read and search; humans get the editor |
| 3. Retrieval | Hybrid: BM25 + vector embeddings + reranking | Exact codes and identifiers need lexical search; meanings need vectors |
| 4. Trust | Access control lists (ACLs) enforced at query time; verification flags; freshness monitoring; citation links | Prevents leakage and stale answers |
| 5. Experience | Human search UI and agent tools calling the same API | No drift by construction |
Content layer: plain files or wiki, but one format
OKF, published June 2026 as a v0.1 vendor-neutral specification, describes a directory of Markdown files with YAML frontmatter, one concept per file, cross-linked with standard Markdown links, all timestamps in ISO 8601 format, and no proprietary toolkit required. It was explicitly designed so humans and agents consume the same files. GitBook on OKF
Files-first workflows give every change an author and a diff, and let agents both read and write knowledge natively. Development teams increasingly store agent instructions and knowledge as Markdown in repositories, reviewed through pull requests, and the same pattern now applies to knowledge content. Visual Studio Magazine on agentic Markdown OpenKnowledge on markdown knowledge
The trade-off: non-technical authors struggle with Git. A Markdown-first editor with a Git backend bridges the gap, but if your authors will not adopt it, choose a wiki with good Markdown export and a hosted MCP server instead. OpenKnowledge on markdown knowledge
Interface layer: MCP plus REST
MCP, introduced by Anthropic in late 2024 and now governed by an open foundation, has become the de facto agent-to-tool interface, and Google's Agent2Agent protocol complements it for agent-to-agent communication. Hosted MCP servers exist for major wikis and search products; if you build your own store, expose the repository through an authenticated MCP server plus a REST API. The main operational burden is security: authentication, token rotation for long-running agents, and isolation against prompt injection. Treat MCP access as an attack surface and audit it before opening it to external agents.
Retrieval layer: hybrid is the default
Production RAG guidance favors hybrid retrieval — lexical (BM25) plus dense vector — fused with reranking: lexical search catches exact identifiers, codes, and product names that pure embedding search misses, and hybrid improves recall over vector-only retrieval with modest added latency. CoreWeave on production RAG
Chunking is still the main tuning lever: 256–512 tokens works well for factoid queries, 1024+ for analytical ones, with 10–20% overlap; benchmark evidence on semantic versus recursive chunking is mixed, so test on your own content. LangCopilot chunking guide
Index choice: hierarchical navigable small world graphs are the sensible default for approximate nearest neighbor (ANN) search. Documented trade-offs matter at scale: memory-efficient ANN configurations can drop toward roughly 0.65 recall while memory-hungry ones reach about 0.95 on large corpora, and metadata filtering is the most reliable way to preserve recall. Benchmark your own data and your own 95th percentile latency. Weaviate ANN benchmark documentation
Vector databases versus knowledge graphs: vectors win on unstructured text, broad similarity, low setup cost, and fast prototyping; graphs win on multi-hop reasoning, factual accuracy, and explainability; a hybrid graph-plus-vector approach usually beats either alone but has a high upfront modeling cost. Paragon on vector DBs vs knowledge graphs
Long context versus retrieval: treat context as a finite attention budget. Anthropic's engineering guidance is to give the model the smallest set of high-signal tokens, offload long-term state to external stores, and selectively reinsert what is needed; Anthropic's own memory tool is a file-based store outside the context window, in effect a knowledge base primitive. Use long context for small curated payloads; use retrieval for large, diverse, or noisy corpora. Anthropic context engineering guide
Trust layer: permissions and freshness
The best products inherit permissions from source systems so that an agent's answer can never reveal content its human user could not read. Glean on enterprise AI The same principle applies to a build-your-own store: enforce ACLs at query time, not at index time, and keep a single authoritative source for every topic so agents never face conflicting duplicates. CoreWeave on production RAG
Buy versus build: total cost of ownership realities
| Option | Representative cost | Effort | Pick this when |
|---|---|---|---|
| Curated AI wiki (Notion, Confluence, Guru) | Roughly 5–20 USD per user per month depending on tier; AI is gated to higher tiers or bundled | Low setup; needs authoring discipline | Non-technical authors; small teams; fast time-to-value |
| Enterprise AI search layer (Glean-class) | Custom pricing; buyer reports of roughly 50–75 USD per user per month with seat minimums (unverified) | Connector configuration plus a content-hygiene sprint | Fragmented enterprise estate; no re-authoring appetite |
| Build your own (Git/Markdown + Postgres with pgvector) | Near-zero marginal per-seat cost; infrastructure tens of USD per month at 10M vectors, low hundreds at 100M | High: embeddings, indexes, ACLs, monitoring, MCP security | Engineering-heavy teams with Git-native content |
Fastio AI knowledge management comparison Superkind buyer comparison Tiger Data pgvector vs Qdrant
Pricing specifics worth verifying before procurement: Notion gates AI behind its Business tier (roughly 15–20 USD per user per month); Confluence's Standard tier is roughly 5–6 USD per user per month with AI features bundled; Guru sells per seat with minimums. Fastio AI knowledge management comparison Glean publishes no list price; third-party guides describe custom pricing that gets expensive at scale. Superkind buyer comparison
Self-hosted Postgres-based vector search can be dramatically cheaper than managed vector databases at scale. A vendor-run benchmark reported roughly 470 queries per second (QPS) versus 41 QPS at 50M vectors on identical hardware — treat ratios as directional, not audited — and infrastructure cost comparisons put self-hosted Postgres at tens of dollars per month versus hundreds for managed services. Even so, the database bill is rarely the dominant cost: engineering time for pipelines, rerankers, ACL enforcement, and freshness monitoring is. Tiger Data pgvector vs Qdrant
Hidden costs to budget:
- A two-to-three-week content-hygiene sprint before retrieval is trustworthy.
- Governance staff and permission administration across sources.
- Re-embedding and index maintenance whenever embedding models or schemas change.
- Metered AI costs: agent credits and overages in software-as-a-service (SaaS) tiers; read-unit bills at high query rates for serverless vector databases.
- MCP security engineering: authentication, token rotation, and isolation.
Operational reliability: the differentiators
The teams that succeed treat the knowledge base as a production system, not a document dump:
- Set a freshness target and monitor edit-to-agent-visible time. A composite freshness score below a defined threshold should alert. CoreWeave on production RAG
- Run a stale-content drill: edit a policy, confirm agents stop retrieving the old version within the target window.
- Run a permission drill: grant and revoke access for a test user and confirm both human search and agent tool calls respect it. Glean on enterprise AI
- Keep one authoritative source per topic; duplicate conflicting documents produce confident contradictory answers. CoreWeave on production RAG
Decision guide
| Your situation | Recommended path |
|---|---|
| Engineering-heavy team; content already in Git and Markdown | Build files-first: OKF-style store, MCP server, hybrid retrieval, pgvector |
| Small non-technical team; needs canonical answers fast | Curated AI wiki (Notion or Confluence) with hosted MCP server |
| Large fragmented estate with many SaaS tools | Enterprise AI search layer (Glean-class) plus a content-hygiene sprint |
| Standardized on Atlassian or Microsoft | Suite-native AI first; bridge the rest with MCP and REST |
| 500+ employees, mixed teams | Both: a search layer for discovery and a curated knowledge base for verified truth (practitioner reporting; treat as directional) |
Caveats and open questions
- OKF is v0.1, roughly two months old; its format is well documented but production adoption and tooling maturity are unproven. GitBook on OKF
- MCP is the emerging standard, but industry surveys (methodology not independently verified) report that most MCP servers are not yet production-hardened and that authentication is the top operational blocker. Audit before deploying.
- Almost all performance and accuracy benchmarks in this space are vendor-run; use them for direction, not procurement-grade comparisons. Tiger Data pgvector vs Qdrant Weaviate ANN benchmark documentation
- No neutral benchmark yet measures a single knowledge base serving humans and agents under identical mixed workloads; the product decision therefore requires a pilot, not just a comparison.
- SaaS pricing and AI credit models are changing quickly (Notion tier changes, Confluence AI bundling, Glean metering); verify current published terms before committing. Fastio AI knowledge management comparison