Knowledge

Dash’s content catalog, embeddings, and PostgreSQL hybrid search.

This walkthrough follows Demo OS at the reviewed revision, which pins Agno 2.8.1. Use the application’s checked-in requirements.

Demo OS creates named Knowledge instances through db/session.py. Dash has separate dash_knowledge and dash_learnings stores. The factory supplies PgVector hybrid search, an explicit text-embedding-3-small embedder, and a content database.

from db import create_knowledge

dash_knowledge = create_knowledge("Dash Knowledge", "dash_knowledge")

This import belongs to the Demo OS checkout and uses its configured database and credentials.

Loading content

Dash’s corpus lives under agents/dash/knowledge: table descriptions and business rules are JSON; validated query examples are SQL. Load it through the application’s script:

docker exec -it demo-os-api python -m agents.dash.scripts.load_knowledge

Run the sample-data setup first. Ordinary app startup does not ingest this corpus. The loader’s --recreate option rebuilds vectors; it is not a promise to reset every independent content store.

Chunking and embedding

The application’s loader prepares the table, business, and query context for its Knowledge stores. The factory explicitly selects OpenAI embeddings. When adapting the demo, choose readers and chunking that match your files instead of pointing a Markdown reader at its JSON table directory.

The pinned PgVector implementation combines vector similarity with PostgreSQL full-text ranking (ts_rank_cd) using normalized, weighted scores. It does not use BM25 or reciprocal-rank fusion for this hybrid path.

Metadata filtering

Metadata can narrow a supported knowledge query. A model choosing a filter is different from the application enforcing a mandatory access-control filter. Keep those responsibilities explicit when adapting the example.

When the model gets the chunks

Dash’s Analyst and Engineer use search_knowledge=True; the model chooses knowledge-search tool calls under their instructions. They do not set add_knowledge_to_context=True.

For an Agent explicitly configured with add_knowledge_to_context=True, the pinned framework retrieves references during Agent message preparation and adds them to the user message. This behavior works without AgentOS.

Reranking

Dash’s factory does not configure a reranker. Adding one is an extension. The pinned PgVector search default is five results, and the query limit is applied before reranking. A separate candidate count and final count must be configured explicitly; there is no implicit fifty-to-ten pipeline.

See it in action

Load Dash’s sample knowledge, ask the Dash team about a SaaS metric, and inspect which knowledge tools and query patterns it used. Compare the answer with the loaded business definitions and source data.

Next

db/session.py · agents/dash/settings.py · agents/dash/scripts/load_knowledge.py · agents/dash/agents/analyst.py

Run Demo OS · Current AgentOS documentation