Skip to main content

Module rag

Module rag 

Source
Available on crate feature rag only.
Expand description

Retrieval-Augmented Generation (RAG) pipeline.

Modular RAG system with trait-based components:

  • RagPipeline - Orchestrates ingest and query workflows
  • RagTool - Agentic retrieval via Tool trait
  • InMemoryVectorStore - Zero-dependency vector store
  • Chunking strategies: fixed-size, recursive, markdown-aware
  • Feature-gated backends: Gemini, OpenAI, Qdrant, LanceDB, pgvector

Available with feature: rag

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.

Structs§

Chunk
A segment of a Document with its vector embedding.
Document
A source document containing text content and metadata.
FixedSizeChunker
Splits text into fixed-size chunks by character count with configurable overlap.
InMemoryVectorStore
An in-memory vector store using cosine similarity for search.
MarkdownChunker
Splits text by markdown headers, keeping each section as a chunk.
NoOpReranker
A no-op reranker that returns results unchanged.
RagConfig
Configuration parameters for the RAG pipeline.
RagConfigBuilder
Builder for constructing a validated RagConfig.
RagPipeline
The RAG pipeline orchestrator.
RagPipelineBuilder
Builder for constructing a RagPipeline.
RagTool
A retrieval tool that wraps a RagPipeline for agentic use.
RecursiveChunker
Splits text hierarchically: paragraphs → sentences → words.
SearchResult
A retrieved Chunk paired with a relevance score.

Enums§

RagError
Errors that can occur in RAG operations.

Traits§

Chunker
A strategy for splitting documents into chunks.
EmbeddingProvider
A provider that generates vector embeddings from text input.
Reranker
A reranker that re-scores and reorders search results.
VectorStore
A storage backend for vector embeddings with similarity search.

Type Aliases§

Result
A convenience result type for RAG operations.