Skip to main content
Agno’s Knowledge class can load documents from multiple sources and formats.

From local files

from agno.knowledge import Knowledge
from agno.vectordb.chroma import ChromaDb

knowledge = Knowledge(
    path="docs/",  # Directory with PDFs, text files, etc.
    vector_db=ChromaDb(collection="docs")
)

# Load the documents
knowledge.load()

From URLs

knowledge = Knowledge(
    urls=["https://docs.agno.com"],
    vector_db=ChromaDb(collection="docs")
)

knowledge.load()

Supported formats

The Knowledge class automatically detects and loads:
  • PDF documents - .pdf files
  • Text files - .txt, .md files
  • Word documents - .docx files
  • Web pages - Any HTTP/HTTPS URL
  • CSV files - .csv files
  • JSON files - .json files

From remote storage

# From S3
knowledge = Knowledge(
    s3_bucket="my-bucket",
    s3_prefix="docs/",
    vector_db=vector_db
)

# From GitHub
knowledge = Knowledge(
    github_repo="agno-agi/agno",
    github_branch="main",
    github_path="docs/",
    vector_db=vector_db
)

Custom loaders

Implement the KnowledgeProtocol to create custom loaders. See API reference for details.

Build docs developers (and LLMs) love