Skip to main content

adk_rag/
lib.rs

1//! # adk-rag
2//!
3//! Retrieval-Augmented Generation for ADK-Rust agents.
4//!
5//! This crate provides a modular, trait-based RAG system with pluggable
6//! embedding providers, vector stores, chunking strategies, and rerankers.
7//! A [`RagPipeline`](pipeline) orchestrates the full ingest-and-query workflow,
8//! and a [`RagTool`](tool) exposes retrieval as an `adk_core::Tool` for
9//! agentic use.
10//!
11//! ## Features
12//!
13//! All external backends are feature-gated. The default feature set includes
14//! only core traits, the in-memory vector store, and chunking implementations.
15//!
16//! | Feature      | What it enables                          |
17//! |--------------|------------------------------------------|
18//! | `gemini`     | `GeminiEmbeddingProvider` via adk-gemini  |
19//! | `openai`     | `OpenAIEmbeddingProvider` via reqwest     |
20//! | `qdrant`     | `QdrantVectorStore` via qdrant-client     |
21//! | `lancedb`    | `LanceDBVectorStore` via lancedb          |
22//! | `pgvector`   | `PgVectorStore` via sqlx                  |
23//! | `surrealdb`  | `SurrealVectorStore` via surrealdb        |
24//! | `full`       | All of the above                          |
25
26pub mod chunking;
27pub mod config;
28pub mod document;
29pub mod embedding;
30pub mod error;
31pub mod inmemory;
32pub mod pipeline;
33pub mod reranker;
34pub mod tool;
35pub mod vectorstore;
36
37#[cfg(feature = "gemini")]
38pub mod gemini;
39#[cfg(feature = "lancedb")]
40pub mod lancedb;
41#[cfg(feature = "openai")]
42pub mod openai;
43#[cfg(feature = "pgvector")]
44pub mod pgvector;
45#[cfg(feature = "qdrant")]
46pub mod qdrant;
47#[cfg(feature = "surrealdb")]
48pub mod surrealdb;
49
50pub use chunking::{Chunker, FixedSizeChunker, MarkdownChunker, RecursiveChunker};
51pub use config::{RagConfig, RagConfigBuilder};
52pub use document::{Chunk, Document, SearchResult};
53pub use embedding::EmbeddingProvider;
54pub use error::{RagError, Result};
55pub use inmemory::InMemoryVectorStore;
56pub use pipeline::{RagPipeline, RagPipelineBuilder};
57pub use reranker::{NoOpReranker, Reranker};
58pub use tool::RagTool;
59pub use vectorstore::VectorStore;
60
61#[cfg(feature = "gemini")]
62pub use gemini::GeminiEmbeddingProvider;
63#[cfg(feature = "lancedb")]
64pub use lancedb::LanceDBVectorStore;
65#[cfg(feature = "openai")]
66pub use openai::OpenAIEmbeddingProvider;
67#[cfg(feature = "pgvector")]
68pub use pgvector::PgVectorStore;
69#[cfg(feature = "qdrant")]
70pub use qdrant::QdrantVectorStore;
71#[cfg(feature = "surrealdb")]
72pub use surrealdb::SurrealVectorStore;