Skip to main content

Crate adk_rag

Crate adk_rag 

Source
Expand description

§adk-rag

Retrieval-Augmented Generation for ADK-Rust agents.

This crate provides a modular, trait-based RAG system with pluggable embedding providers, vector stores, chunking strategies, and rerankers. A RagPipeline orchestrates the full ingest-and-query workflow, and a RagTool exposes retrieval as an adk_core::Tool for agentic use.

§Features

All external backends are feature-gated. The default feature set includes only core traits, the in-memory vector store, and chunking implementations.

FeatureWhat it enables
geminiGeminiEmbeddingProvider via adk-gemini
openaiOpenAIEmbeddingProvider via reqwest
qdrantQdrantVectorStore via qdrant-client
lancedbLanceDBVectorStore via lancedb
pgvectorPgVectorStore via sqlx
surrealdbSurrealVectorStore via surrealdb
fullAll of the above

Re-exports§

pub use chunking::Chunker;
pub use chunking::FixedSizeChunker;
pub use chunking::MarkdownChunker;
pub use chunking::RecursiveChunker;
pub use config::RagConfig;
pub use config::RagConfigBuilder;
pub use document::Chunk;
pub use document::Document;
pub use document::SearchResult;
pub use embedding::EmbeddingProvider;
pub use error::RagError;
pub use error::Result;
pub use inmemory::InMemoryVectorStore;
pub use pipeline::RagPipeline;
pub use pipeline::RagPipelineBuilder;
pub use reranker::NoOpReranker;
pub use reranker::Reranker;
pub use tool::RagTool;
pub use vectorstore::VectorStore;

Modules§

chunking
Document chunking strategies.
config
Configuration for the RAG pipeline.
document
Data types for documents, chunks, and search results.
embedding
Embedding provider trait for generating vector embeddings from text.
error
Error types for the adk-rag crate.
inmemory
In-memory vector store using cosine similarity.
pipeline
RAG pipeline orchestrator.
reranker
Reranker trait for re-scoring search results.
tool
Agentic retrieval tool for ADK agents.
vectorstore
Vector store trait for storing and searching vector embeddings.