Skip to main content
Build an agent that answers questions about your documents.

Create an Agent with Knowledge

knowledge_agent.py

Setup

1

Create virtual environment

2

Install dependencies

3

Export your API key

4

Run the agent

The agent searches the knowledge base, finds relevant content, and answers based on what it found.

Load Different Content Types

Agno detects file types automatically and uses the appropriate reader for PDFs, DOCX, CSV, Markdown, and more.

What’s Happening

  1. Insert: Content is chunked, embedded with Gemini, and stored in ChromaDB
  2. Query: The agent receives your question and decides to search the knowledge base using the search_knowledge_base tool
  3. Response: The agent uses the retrieved content to answer, grounding its response in your data
This is Agentic RAG. The agent decides when to search rather than blindly injecting context on every query.

Next Steps

Agents with Knowledge

Agentic RAG, traditional RAG, reranking

Teams with Knowledge

Distributed search, coordinated RAG

Vector Stores

PgVector, Pinecone, Weaviate, and 20+ more

Search & Retrieval

Vector, keyword, and hybrid search