Skip to main content
KnowledgeManagementTools enable a builder or operator agent to load content into a knowledge base, inspect what is loaded, and remove it. This is the write side of knowledge: end-user-facing agents get search — give them Knowledge Tools — while this toolkit goes to the agent that curates the base. The knowledge base must have a contents_db: every tool here reads or writes content rows, and construction raises a ValueError without one.

Prerequisites

The following example requires the agno, openai, and qdrant-client libraries, and sqlalchemy for the SQLite contents database (agno[sqlite]). It connects to Qdrant on localhost:6333.
Set your OpenAI API key:

Example

The following operator agent loads a website into the knowledge base and reports what is loaded:
cookbook/91_tools/knowledge_management_tools.py

Content Ownership

scope decides who can read what the operator loads. With scope="shared" (the default), ingested rows are readable by every agent on the knowledge base. With scope="user", rows belong to the run’s user_id — and a run without a user_id gets an error back instead of silently writing to the shared bucket, where the content would be readable and deletable by everyone.

Toolkit Params

list_content and ingest_status are always registered — they only read.
ingest_path is off by default, and registering it is an explicit choice: it reads any path the server process can read, and under scope="shared" everything it loads becomes readable by every agent on that knowledge base. Enable it only where the operator agent is trusted with the machine’s filesystem.

Toolkit Functions

Every tool returns JSON with an ok field; failures come back as {"ok": false, "error": ...} instead of raising to the model. Each tool also has an async variant registered under the same name, so the async versions are used automatically with arun and aprint_response.

Developer Resources