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//! | `full`     | All of the above                          |
24
25pub mod chunking;
26pub mod config;
27pub mod document;
28pub mod embedding;
29pub mod error;
30pub mod inmemory;
31pub mod pipeline;
32pub mod reranker;
33pub mod tool;
34pub mod vectorstore;
35
36#[cfg(feature = "gemini")]
37pub mod gemini;
38#[cfg(feature = "lancedb")]
39pub mod lancedb;
40#[cfg(feature = "openai")]
41pub mod openai;
42#[cfg(feature = "pgvector")]
43pub mod pgvector;
44#[cfg(feature = "qdrant")]
45pub mod qdrant;
46
47pub use chunking::{Chunker, FixedSizeChunker, MarkdownChunker, RecursiveChunker};
48pub use config::{RagConfig, RagConfigBuilder};
49pub use document::{Chunk, Document, SearchResult};
50pub use embedding::EmbeddingProvider;
51pub use error::{RagError, Result};
52pub use inmemory::InMemoryVectorStore;
53pub use pipeline::{RagPipeline, RagPipelineBuilder};
54pub use reranker::{NoOpReranker, Reranker};
55pub use tool::RagTool;
56pub use vectorstore::VectorStore;
57
58#[cfg(feature = "gemini")]
59pub use gemini::GeminiEmbeddingProvider;
60#[cfg(feature = "lancedb")]
61pub use lancedb::LanceDBVectorStore;
62#[cfg(feature = "openai")]
63pub use openai::OpenAIEmbeddingProvider;
64#[cfg(feature = "pgvector")]
65pub use pgvector::PgVectorStore;
66#[cfg(feature = "qdrant")]
67pub use qdrant::QdrantVectorStore;