Skip to main content
Knowledge is the retrieval primitive: a vector index with an optional keyword index and optional reranker. Dash uses it heavily for grounding text-to-SQL.

Loading content

Three ways to put content in:
Demo OS loads via scripts:
Re-run with --recreate to rebuild from scratch. Without it, content is upserted by primary key.

Chunking and embedding

By default, Knowledge chunks long content into ~500-token segments and embeds each chunk with text-embedding-3-small. Override with:
Other chunking strategies live under agno.knowledge.chunking.*: by markdown headers, by code structure, by recursive token count, by semantic boundaries. search_type="hybrid" runs both: Results from both get merged with reciprocal rank fusion. Hybrid almost always beats either alone.

Metadata filtering

Metadata attached at ingest time becomes a filter at query time:
Useful for multi-tenant agents (filter by tenant_id) or topic scoping (filter by category).

When the model gets the chunks

With add_knowledge_to_context=True:
  1. User message arrives.
  2. AgentOS runs knowledge.search(message) automatically.
  3. Top-k chunks get inserted into the system prompt.
  4. The model answers with the chunks visible.
With search_knowledge=True: The agent gets a search_knowledge_base(query) tool. The model decides when to call it. Useful for follow-up retrieval mid-run. Both flags are common to set together. Auto-search hits first, the tool catches “I need to look up something else” cases.

Reranking

For larger knowledge bases, add a reranker:
The vector DB returns the top-50, the reranker scores them, and the top-10 reach the model. This two-stage retrieval (cast wide, rerank tight) is the standard production setup.

See it in action

Source: agents/dash/, Knowledge docs

Next

Memory →