Skip to main content
RAG agents retrieve relevant chunks from your documents before answering, grounding responses in your own knowledge.
The user asks from their documents; the agent retrieves relevant chunks and grounds the reply.

Quick Start

1

Simple Usage

Pass file paths or directories — the agent indexes on first run, then retrieves on each query:
2

With Configuration

Use KnowledgeConfig for vector store, chunking, and reranking:

How It Works

For pre-indexed stores, pass vector config via task context or call agent.retrieve("query") directly.

Configuration Options

Install knowledge extras: pip install "praisonaiagents[knowledge]"

Best Practices

Pass sources via knowledge=["file.pdf"] at agent creation — first run indexes, later runs retrieve without re-indexing.
Narrow questions retrieve better chunks than broad prompts like “tell me everything”.
Set vector_store with Chroma path, Qdrant, or Pinecone — avoid in-memory stores for production.
Pair knowledge= with web tools when you need both static documents and real-time data.

Vector Store

Pluggable embedding storage

Knowledge

Sources and retrieval strategies