Skip to main content
Declare a retriever and reranker by name in your agent YAML and PraisonAI wires them into the knowledge base for you.

Quick Start

1

Declare the retriever and reranker

2

Run it

No Python setup. The register_default_adapters() call happens for you before the agent starts (PraisonAI 4.7.9+).

Retriever choices

Reranker choices


Choosing a retriever

Choosing a reranker


From the CLI

Same names, one-off from the praisonai knowledge query sub-command:
See Knowledge CLI for the full flag reference.

Best Practices

Use basic first — it needs no LLM calls or extra installs. Move to fusion only when ambiguous or paraphrased questions miss the right passage.
Set retrieval_k higher than the number of passages you actually want, then let the reranker trim to the best few. A common pairing is retrieval_k: 20 with an llm reranker returning the top 5.
cross_encoder runs locally with no API cost; llm is highest quality but bills per candidate; cohere is a hosted API. Pick based on whether cost, quality, or zero-dependency matters most.
The wrapper entry points auto-wire the built-in adapters, so a name like retriever: fusion resolves without any register_default_adapters() call. You only call it yourself when using retriever/reranker classes directly from your own Python code.

Retrieval from Python

Configure retrieval from Python

Adapter registry

How the adapter registry works