AI agents · OpenClaw · self-hosting · automation

Quick Answer

Choosing an AI Knowledge Layer for LLM Applications (2026)

Published:

The short answer

Choose the knowledge layer by the shape of your knowledge, then check where the data must live and who may see it. As of November 12, 2026:

Your knowledge is…PickWhere it runsPrice (Nov 12, 2026)
Documents and policies many agents sharePinecone NexusManaged; Pinecone also offers bring-your-own-cloudTrial; no public Nexus price
Files or a website behind a support botCloudflare AI SearchCloudflare (serverless)Billing starts Dec 1, 2026. Included monthly: 5M ingestion tokens, 10 GB-month, 1,000 semantic + 1,000 full-text queries. Then $0.75/1M tokens, $2/GB-month, $0.75 per 1,000 semantic queries, $0.10 per 1,000 full-text
Facts about users that change over timeZepZep Cloud or your VPC (Enterprise)Flex $125/mo (50,000 credits, then $25 per 10,000); Flex Plus $375/mo (200,000 credits)
Long-term memory inside your appMem0Cloud or open sourceFree (first 30 days 10,000 adds/1,000 retrievals; with your own LLM key 50,000/10,000); Custom plans for graph memory, SSO, on-prem
Data already in Postgres, engineers availablepgvector + rerankerAnywhereInfrastructure only

Mem0’s pricing changed since October: the Starter ($19) and Pro ($249) plans no longer appear on its pricing page, which now lists Free and Custom. Graph memory moved to Custom.

Five questions that decide it

  1. Does every user see everything? If not, you need permissions enforced at query time. Managed RAG products differ most here; ask the vendor how a document’s ACL follows its chunks.
  2. How often does the truth change? Weekly policy updates need explicit retirement of old versions. Fast-changing facts about people favour a temporal store such as Zep, which records when each fact was valid.
  3. Where must the data live? Regulated data usually rules out a multi-tenant SaaS. Pinecone’s Enterprise tier lists bring-your-own-cloud; Zep Enterprise deploys to your VPC; Mem0 Custom offers on-prem.
  4. How many consumers? One chatbot can live with a library. Several agents and a search UI need one interface so they do not each retrieve differently.
  5. Who will run it? A managed layer costs more per query and less per engineer. pgvector costs nothing in licences and a lot in upkeep.

Knowledge layer architecture: best practices

1. Keep provenance on every chunk. Store source URL or path, document version, owner and ingestion time. Answers can then cite, and audits can trace a bad answer to a bad document.

2. Enforce permissions at query time. Filter on the user’s identity when retrieving, not when indexing. Indexing-time filtering breaks the moment someone’s access changes.

3. Retire superseded content. Freshness rules matter more than model size for policy questions. Mark old versions inactive instead of letting both compete in retrieval.

4. Retrieve wide, then rerank. Pull 30–50 candidates with hybrid (vector + keyword) search and let a reranker pick the top 5–10. It usually lifts answer quality more cheaply than a larger model; see best reranker models.

5. One interface for every consumer. Chatbots, agents and internal search should call the same retrieval API, so a fix lands everywhere at once.

6. Log what was retrieved for each answer. Without retrieval logs you cannot tell a model error from a retrieval error.

7. Evaluate before tuning. Collect 50–100 real questions with known answers and re-run them after every chunking, embedding or prompt change.

The step-by-step build order is in how to build an agent knowledge layer; the tool overview is our knowledge layer for large language models hub.

Cost check before you commit

Cloudflare AI Search is the easiest to estimate: a support bot answering 100,000 semantic queries a month pays for 99,000 queries beyond the allowance, about $74, plus storage and ingestion past the free amounts. Zep and Mem0 bill per operation, so estimate adds and retrievals per conversation first. Generation is billed separately by your model provider; see current API prices.

When not to build one

If the material fits in the context window, changes rarely and has no access rules, skip the layer and use long context: RAG vs knowledge layer vs long context.

Last verified: November 12, 2026.

Sources