Prerequisites
The following example requires theagno, fastembed, openai, and qdrant-client libraries. It connects to Qdrant on localhost:6333.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
KnowledgeTools provide intelligent search and analysis capabilities over knowledge bases with reasoning integration.
agno, fastembed, openai, and qdrant-client libraries. It connects to Qdrant on localhost:6333.
uv pip install agno fastembed openai qdrant-client
docker run -d --name qdrant -p 6333:6333 qdrant/qdrant:latest
export OPENAI_API_KEY=***
from agno.agent import Agent
from agno.knowledge.embedder.openai import OpenAIEmbedder
from agno.knowledge.knowledge import Knowledge
from agno.models.openai import OpenAIChat
from agno.tools.knowledge import KnowledgeTools
from agno.vectordb.qdrant import Qdrant
from agno.vectordb.search import SearchType
knowledge = Knowledge(
vector_db=Qdrant(
collection="knowledge_tools_demo",
url="http://localhost:6333",
search_type=SearchType.hybrid,
embedder=OpenAIEmbedder(id="text-embedding-3-small"),
),
)
knowledge.insert(url="https://docs.agno.com/llms-full.txt")
agent = Agent(
model=OpenAIChat(id="gpt-4o"),
tools=[KnowledgeTools(knowledge=knowledge)],
markdown=True,
)
agent.print_response("How do I build a team of agents in Agno?", stream=True)
| Parameter | Type | Default | Description |
|---|---|---|---|
knowledge | Knowledge | - | Knowledge base instance (required). |
enable_think | bool | True | Enable reasoning capabilities. |
enable_search | bool | True | Enable knowledge search functionality. |
enable_analyze | bool | True | Enable knowledge analysis capabilities. |
instructions | Optional[str] | None | Custom instructions for knowledge operations. |
add_instructions | bool | True | Whether to add instructions to the agent. |
add_few_shot | bool | False | Whether to include few-shot examples. |
few_shot_examples | Optional[str] | None | Custom few-shot examples. |
all | bool | False | Enable all functionality. |
| Function | Description |
|---|---|
think | Scratchpad for reasoning about the question and planning searches. |
search_knowledge | Search the knowledge base for relevant information. |
analyze | Evaluate whether the retrieved documents are correct and sufficient. |
Was this page helpful?