Skip to main content
Learn how to enhance your agents with knowledge bases and retrieval-augmented generation (RAG).
The user attaches a knowledge source, asks a question, and the agent grounds its reply in retrieved passages.

Quick Start

1

Simple Usage

Point the agent at a folder of documents and it answers from them.
2

With Configuration

Tune how many passages come back and how similar they must be.

How It Works


Knowledge Base Setup

Create and configure knowledge bases

Chunking Strategies

Optimize document chunking

Retrieval Methods

Configure retrieval strategies

Best Practices

KnowledgeConfig(sources=["./docs"]) indexes a directory directly. Remove boilerplate and duplicates first so retrieval returns signal, not noise.
A higher similarity_threshold filters weak matches. Start at 0.7 and adjust based on whether answers miss context or cite irrelevant passages.
Fewer, stronger passages usually beat many weak ones. Increase top_k only when answers lack coverage.