Knowledge
Learn how uploaded documents are chunked, embedded, and searched.
Knowledge is the document search in AgenticPacks Pro. OSS does not include it. A file uploaded on the knowledge screen is stored, split, embedded, and then available to chat as retrieved chunks.
This page covers the chunk size, which key the embedding call needs, and what happens when that key is missing.
Ingestion
Text is split at about 500 tokens. Each chunk is embedded with OpenAI text-embedding-3-small, which produces a 1536-dimension vector, and written to Postgres through pgvector. Search is cosine similarity, scoped to the workspace the user has selected.
The upload route is POST /api/rag/ingest. It requires OPENAI_API_KEY. Claude and Gemini keys do not substitute here, because the index is an OpenAI embedding. When the key is missing, the upload fails and nothing is indexed.
ALLOW_MOCK_EMBEDDINGS can stand in for the OpenAI call during local development. Those vectors are a hash, not a semantic embedding. Leave the flag unset on any environment you treat as real.
How chat uses it
Streaming chat can retrieve those chunks for the current workspace. If the key is missing, chat still opens. The banner on the screen explains that search is unavailable. The research agent, separately, can continue with web search when Tavily is configured. That path is covered in Research agent.
Where to go next
The background job that reads the web, rather than your files, is the Research agent.
