Skip to main content
Build knowledge bases with vector storage, embeddings, and content ingestion for retrieval-augmented generation (RAG).
Knowledge in Agno is composed of several resources that work together:

agno/knowledge

The central knowledge base resource that connects a vector database with an optional embedder.

Config

Outputs


agno/vectordb/qdrant

Configures access to a Qdrant collection that stores embeddings. The collection itself is created by a qdrant/collection resource.

Config

Outputs


agno/knowledge/embedder/openai

Configures an OpenAI embedding model for generating vector embeddings.

Config

Outputs


agno/knowledge/content

Represents a content source to ingest into a knowledge base. Supports inline text and URLs of plain text, Markdown or JSON files.

Config

Outputs

Example

A complete knowledge base setup:

Notes

  • You must provide exactly one of url or text_content in content resources.
  • Content reads inline text, or a URL of a plain text, Markdown or JSON file whose path ends in .txt, .text, .md, .markdown or .json. Web pages, PDF, Office, CSV and YouTube URLs are refused, and a URL that serves an HTML page fails. A JSON file must hold an object or array at its top level.
  • search_type accepts only vector: a qdrant/collection holds one unnamed dense vector, and keyword or hybrid search needs sparse vectors.
  • The Qdrant collection must exist before content is written. Apply a qdrant/collection sized for the embedder’s vector dimensions first; a content resource never creates the collection.
  • Content resources are stateful — create and update write the content’s chunks into the collection and remove any older chunks the resource wrote; delete removes every chunk the resource wrote.
  • The knowledge reference on content, the vector_db reference on a knowledge base, and the url and collection of a vector database are immutable — delete and recreate the resource to change them.