A lightweight and easy-to-use RAG (Retrieval Augmented Generation) library for building question-answering systems with open-source models and vector stores.
pip install zragfrom zrag import DocumentLoader, RAGPipeline
# Load documents
loader = DocumentLoader()
documents = loader.load("path/to/documents")
# Create RAG pipeline
rag = RAGPipeline()
rag.index(documents)
# Query
response = rag.query("Your question here")
print(response)- Document Loading: PDF, text, and markdown support
- Chunking Strategies: Token, sentence, and paragraph-based splitting
- Embeddings: Support for transformer-based models
- Vector Stores: FAISS and ChromaDB integration
- LLM Integration: Easy integration with various language models
- Data Generation: Synthetic data generation for training/testing
| Component | Description |
|---|---|
DocumentLoader |
Load and parse documents from various formats |
ChunkSplitter |
Split documents into manageable chunks |
Embeddings |
Generate vector embeddings for text |
VectorStore |
Store and retrieve document embeddings |
LLM |
Interface for language model integration |
RAGPipeline |
End-to-end RAG implementation |
- Python 3.9+
- PyTorch
- Transformers
- FAISS or ChromaDB
- Additional dependencies in
requirements.txt
MIT License - see LICENSE for details.