Skip to main content
Knowledge gives agents access to information beyond their training data. Load files, URLs, or raw text, and agents can search this knowledge to provide accurate, contextual responses.
from agno.agent import Agent
from agno.knowledge.knowledge import Knowledge
from agno.vectordb.chroma import ChromaDb

# Create a knowledge base
knowledge = Knowledge(
    vector_db=ChromaDb(collection="docs", path="tmp/chromadb"),
)

# Load content
knowledge.insert(url="https://docs.agno.com/introduction.md")

# Create an agent that searches the knowledge base
agent = Agent(knowledge=knowledge, search_knowledge=True)
agent.print_response("What is Agno?")
The agent searches its knowledge base and grounds its response in the content.

How It Works

Knowledge combines three components:
  1. Content ingestion: Read documents from files, URLs, cloud storage, or raw text. Agno includes readers for PDF, DOCX, CSV, Markdown, and more.
  2. Chunking and embedding: Documents are split into searchable chunks and converted to vector embeddings that capture semantic meaning.
  3. Search and retrieval: When an agent needs information, it searches the vector database for relevant chunks and includes them in its context.
You can use Agentic RAG (agent decides when to search) or Traditional RAG (always inject context). Agentic RAG is the default and works well for most use cases.

Why Knowledge Matters

Language models have broad general knowledge but lack context about your specific domain. Knowledge bridges this gap by providing relevant information at runtime. Start with your content. Load company documentation, database schemas, product specs, support FAQs, or research papers. The agent uses this information to answer questions accurately instead of guessing. Then let agents learn. Knowledge isn’t read-only. Agents can save insights they discover and retrieve them later, building expertise across conversations.
def save_learning(title: str, insight: str) -> str:
    """Save a reusable insight to the knowledge base."""
    knowledge.insert(name=title, text_content=insight)
    return f"Saved: {title}"

agent = Agent(
    knowledge=knowledge,
    search_knowledge=True,
    tools=[save_learning],  # Agent can write to knowledge
)
This turns agents from static systems into systems that learn over time.

Examples

Concepts

Vector Stores

Agno supports 20+ vector databases, from local options like LanceDB and ChromaDB to managed services like Pinecone and Weaviate.

All Vector Stores

See supported databases