Skip to main content
The knowledge system lets agents retrieve relevant information from PDFs, documents, and URLs before answering, grounding responses in your own sources.
The user asks about their documents; the agent embeds, searches, and answers from your PDFs and URLs.

Key Features

Process PDFs, documents, spreadsheets, images, and web content

Multiple strategies for optimal text segmentation

Vector-based search with optional reranking

User, agent, and run-specific knowledge scoping

Optional relationship extraction and storage

Automatic quality assessment for stored knowledge

Quick Start

1

Level 1 — List of sources (simplest)

Pass a list of files or URLs and the agent answers from them.
2

Level 2 — Dict (inline config)

Use a dict to pick a vector store while still passing sources inline.
3

Level 3 — Config class (full control)

Use KnowledgeConfig for typed control over chunking, retrieval, and reranking.

How It Works


Configuration Options

KnowledgeConfig SDK Reference

Full parameter reference for KnowledgeConfig
The most common options at a glance:

Basic Configuration

Set vector_store.provider explicitly and a fallback (e.g. to SQLite) is logged at WARNING level with Retrieval quality may be reduced so you notice it. Rely on the default (no explicit provider) and a fallback stays at DEBUG, because that path is expected (PR #2982).

If your configured backend seems ignored

Configure a mem0 or mongodb vector store on a release before 2026-07-14 and find that searches feel like keyword matching? Your Knowledge instance may have been silently falling back to SQLite. This was a bug (fixed in PR #2982) where the adapter constructors rejected an internal verbose keyword and the resulting TypeError was swallowed. Check which adapter you actually got:
Upgrade to a release built from main after commit 69d7ecf to fix it. An explicitly-configured backend that fails to initialise now emits a WARNING log — no more silent degradation:
The configured backend is honoured on releases built after commit 69d7ecf; before that, the same code silently ran on SQLite.

Advanced Configuration with Graph Store

Choosing Sources and Chunking

Pick a source type, then a chunking strategy that matches your content.

Chunking Strategies

Document Processing

Supported File Types

  • PDF (.pdf)
  • Word (.doc, .docx)
  • Text (.txt)
  • Markdown (.md)
  • RTF (.rtf)

  • Excel (.xls, .xlsx)
  • CSV (.csv)
  • JSON (.json)
  • XML (.xml)

  • Images (OCR)
  • HTML pages
  • Web URLs
  • YouTube videos

Processing Options

Handling indexing failures

Indexing errors are surfaced, not swallowed. When the embedding call fails, the CLI exits non-zero and the Python API raises.
Knowledge.add(source) from Python raises RuntimeError on the first source whose embedding fails. Wrap batch calls in try / except to keep going.
The lower-level ChromaKnowledgeAdapter.add() returns an AddResult instead of raising:
Search degrades gracefully — a failed embedding is logged at WARNING and the call returns an empty SearchResult rather than raising, so an embedding outage cannot bring down the calling agent.

Search Features

Advanced Search Options

Memory Integration

When used with agents, knowledge automatically integrates with memory:

Graph Store Features

Graph stores add relationship extraction and connection queries on top of semantic search.

Configuration

Relationship Queries

Best Practices

Use smaller chunks (100-200 tokens) for precise fact retrieval. Use larger chunks (500-1000 tokens) when answers need more context. Semantic chunking works best for research papers and long-form documents.
Use a different collection_name per knowledge domain (e.g., product_docs, legal_contracts). This prevents cross-contamination and allows targeted filtering by domain.
Add metadata when indexing documents to enable filters= in searches. Filter by category, year, or author to narrow results without changing query text.
Set rerank=True in kb.search() when you need top-quality results. Reranking retrieves more candidates then scores them for relevance — best for Q&A and research assistants.

Example: Research Assistant

Troubleshooting

RAG

Build retrieval-augmented generation pipelines

Vector Store

Store and query embeddings with a pluggable, namespace-aware backend