Documentation Index Fetch the complete documentation index at: https://agno-v2-team-approvals.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Build agents that search and retrieve information from your documents, databases, and APIs.
from agno.agent import Agent
from agno.knowledge.knowledge import Knowledge
from agno.vectordb.pgvector import PgVector
knowledge = Knowledge(
vector_db = PgVector( table_name = "documents" , db_url = "postgresql://..." ),
)
# Add documents from any source
knowledge.insert( url = "https://example.com/docs.pdf" )
knowledge.insert( path = "./local_docs/" )
# Create an agent with knowledge
agent = Agent( knowledge = knowledge, search_knowledge = True )
agent.print_response( "What does the documentation say about authentication?" )
Knowledge Categories
Vector Databases 25+ vector databases including PgVector, Pinecone, Qdrant, Weaviate.
Embedders 29 embedder options from OpenAI, Cohere, HuggingFace, and more.
Document Readers PDF, CSV, JSON, Markdown, PowerPoint, and web content readers.
Chunking Semantic, fixed-size, and custom chunking strategies.
Quick Examples
Basic Knowledge Base
cookbook/07_knowledge/vector_db/pgvector/pgvector_db.py
from agno.agent import Agent
from agno.knowledge.knowledge import Knowledge
from agno.vectordb.pgvector import PgVector
vector_db = PgVector(
table_name = "recipes" ,
db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai" ,
)
knowledge = Knowledge(
name = "Recipe Knowledge" ,
vector_db = vector_db,
)
# Add content from URL
knowledge.insert(
name = "Thai Recipes" ,
url = "https://example.com/recipes.pdf" ,
)
agent = Agent(
knowledge = knowledge,
search_knowledge = True ,
)
agent.print_response( "How do I make pad thai?" , markdown = True )
Multiple Sources
cookbook/07_knowledge/basic_operations/sync/04_from_multiple.py
from agno.knowledge.knowledge import Knowledge
from agno.vectordb.pgvector import PgVector
knowledge = Knowledge(
vector_db = PgVector( table_name = "docs" , db_url = "postgresql://..." ),
)
# Add from multiple sources
knowledge.insert( path = "./documentation/" )
knowledge.insert( url = "https://docs.example.com/api.pdf" )
knowledge.insert( topic = "Python best practices" )
Async Operations
cookbook/07_knowledge/basic_operations/async/01_from_path.py
import asyncio
from agno.knowledge.knowledge import Knowledge
from agno.vectordb.pgvector import PgVector
async def build_knowledge ():
knowledge = Knowledge(
vector_db = PgVector( table_name = "docs" , db_url = "postgresql://..." ),
)
# Async content loading
await knowledge.ainsert( path = "./large_docs/" )
return knowledge
knowledge = asyncio.run(build_knowledge())
Run Examples
git clone https://github.com/agno-agi/agno.git
cd agno/cookbook/07_knowledge
# PgVector example
python vector_db/pgvector/pgvector_db.py
# Multiple sources
python basic_operations/sync/04_from_multiple.py
# Embedders
python embedders/openai_embedder.py