Module rag

Module rag 

Source
Expand description

RAG (Retrieval-Augmented Generation) system with vector stores and embeddings.

§RAG (Retrieval-Augmented Generation) Module

This module provides a flexible RAG system with:

  • Multiple vector store backends (in-memory, Qdrant)
  • Embedding generation (OpenAI API, local models)
  • Document chunking and preprocessing
  • Semantic search and retrieval
  • Reranking capabilities

Structs§

Document
Represents a document in the RAG system
InMemoryVectorStore
In-memory vector store using cosine similarity
OpenAIEmbeddings
OpenAI embedding provider using text-embedding-ada-002 or text-embedding-3-small
QdrantVectorStore
Qdrant vector store implementation
RAGSystem
Main RAG system that combines embedding provider and vector store
SearchResult
Represents a search result from the RAG system

Traits§

EmbeddingProvider
Trait for embedding generation
VectorStore
Trait for vector storage backends