Expand description
RAG (Retrieval-Augmented Generation) module for LangChainRust.
Provides document loaders, text splitters, retrievers, BM25 search, hybrid retrieval, GraphRAG, HyDE, multi-query, reranking, and a full RAG pipeline builder.
Re-exports§
pub use adapter::RagRunnable;pub use pipeline::RAGPipeline;pub use pipeline::RAGPipelineBuilder;pub use pipeline::RAGQueryResult;pub use loaders::CSVLoader;pub use loaders::DocumentLoader;pub use loaders::DocxLoader;pub use loaders::HTMLLoader;pub use loaders::JSONLoader;pub use loaders::LoaderError;pub use loaders::MarkdownLoader;pub use loaders::PDFLoader;pub use loaders::SitemapLoader;pub use loaders::TextLoader;pub use loaders::WebScraperLoader;pub use retriever::Retriever;pub use retriever::RetrieverError;pub use retriever::RetrieverTrait;pub use retriever::SimilarityRetriever;pub use semantic_splitter::SemanticSplitter;pub use bm25::AutoMergingConfig;pub use bm25::BM25Params;pub use bm25::BM25Retriever;pub use bm25::ChunkedBM25Retriever;pub use bm25::ChunkedSearchResult;pub use bm25::Tokenizer;pub use hybrid::filter_by_score;pub use hybrid::reciprocal_rank_fusion;pub use hybrid::RetrievalSource;pub use hybrid::RetrievedDocument;pub use unified_hybrid::HybridIndexConfig;pub use unified_hybrid::HybridSearchResult;pub use unified_hybrid::UnifiedHybridIndex;pub use multi_query::MultiQueryConfig;pub use multi_query::MultiQueryError;pub use multi_query::MultiQueryRetriever;pub use multi_query::StaticQueryGenerator;pub use hyde::HyDEConfig;pub use hyde::HyDEError;pub use hyde::HyDERetriever;pub use reranking::BM25Reranker;pub use reranking::KeywordReranker;pub use reranking::Reranker;pub use reranking::RerankingConfig;pub use reranking::RerankingError;pub use reranking::RerankingExecutor;pub use graph_rag::Community as GraphCommunity;pub use graph_rag::Entity as GraphEntity;pub use graph_rag::GraphStore;pub use graph_rag::Relation as GraphRelation;pub use graph_rag::GraphRAG;pub use graph_rag::GraphRAGConfig;pub use graph_rag::GraphRAGError;pub use graph_rag::GraphRAGResult;pub use graph_rag::QueryMode;
Modules§
- adapter
- RagRunnable adapter - bridges RAGPipeline to the Runnable trait.
- bm25
- BM25 检索模块
- graph_
rag - GraphRAG (Knowledge Graph RAG) module.
- hybrid
- 混合检索模块
- hyde
- HyDE (Hypothetical Document Embedding) Retriever 实现
- loaders
- 文档加载器实现
- multi_
query - MultiQueryRetriever 实现
- pipeline
- RAGPipeline & RAGPipelineBuilder — 一行搞定 RAG 管线
- reranking
- Reranking(重排序)实现
- retriever
- 检索器实现
- semantic_
splitter - 语义分块器
- splitter
- 文本分割器实现
- unified_
hybrid - Unified Hybrid Index - 统一混合索引
Structs§
- Chunk
Document - Chunk document (split document fragment).
- Chunked
Vector Store - Chunked Vector Store
- Document
- Document structure.
- InMemory
Document Store - 内存文档存储
- InMemory
Vector Store - 内存向量存储
- Mock
Embeddings - Mock embeddings for testing purposes.
- OpenAI
Embeddings - OpenAI Embeddings client
- Recursive
Character Splitter - Recursive character splitter
- Search
Result - Search result.
Enums§
- Embedding
Error - Embedding error type
- Vector
Store Error - Vector store error types.
Traits§
- Chunked
Document Store Trait - 支持 Parent-Child 结构的文档存储 trait
- Document
Store - 文档存储 trait
- Embeddings
- Embedding model trait
- Text
Splitter - Text splitter trait
- Vector
Store - Vector store trait.
Functions§
- cosine_
similarity - Compute cosine similarity between two vectors.
Type Aliases§
- Chunked
Document Store InMemoryChunkedDocumentStore的类型别名