Fast, efficient, minimal, extendible and elegant RAG system
Project description
๐ RocketRAG
Fast, efficient, minimal, extendible and elegant RAG system
RocketRAG is a high-performance Retrieval-Augmented Generation (RAG) system designed with a focus on speed, simplicity, and extensibility. Built on top of state-of-the-art libraries, it provides both CLI and web server capabilities for seamless integration into any workflow.
https://github.com/user-attachments/assets/1bd7cc50-9eac-4402-80bd-42933ac35ca3
๐ฏ Mission
RocketRAG aims to be the fastest and most efficient RAG library while maintaining:
- Minimal footprint - Clean, lightweight codebase
- Maximum extensibility - Pluggable architecture for all components
- Peak performance - Leveraging the best-in-class libraries
- Ease of use - Simple CLI and API interfaces
โก Performance-First Architecture
RocketRAG is built on top of cutting-edge, performance-optimized libraries:
- Chonkie - Ultra-fast semantic chunking with model2vec
- Kreuzberg - Lightning-fast document loading and processing
- llama-cpp-python - Optimized LLM inference with GGUF support
- Milvus Lite - High-performance vector database
- Sentence Transformers - State-of-the-art embeddings
๐ Quick Start
Installation
Using pip
pip install rocketrag
Using uvx (recommended for CLI usage)
# Run directly without installation
uvx rocketrag --help
# Or install globally
uvx install rocketrag
Basic Usage
from rocketrag import RocketRAG
rag = RocketRAG("./data") # Path do your data (supports PDF, TXT, MD, etc.)
rag.prepare() # Construct vector database
# Ask questions
answer, sources = rag.ask("What is the main topic of the documents?")
print(answer)
CLI Usage
# Prepare documents from a directory
rocketrag prepare --data-dir ./documents
# Ask questions via CLI
rocketrag ask "What are the key findings?"
# Start web server
rocketrag server --port 8000
Using uvx (no installation required)
# Same commands work with uvx
uvx rocketrag prepare --data-dir ./documents
uvx rocketrag ask "What are the key findings?"
uvx rocketrag server --port 8000
# Run as module
uvx --from rocketrag python -m rocketrag --help
๐๏ธ Architecture
RocketRAG follows a modular, plugin-based architecture:
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Document โ โ Chunking โ โ Vectorization โ
โ Loaders โโโโโถโ (Chonkie) โโโโโถโ (SentenceTransf)โ
โ (Kreuzberg) โ โ โ โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ LLM โ โ Vector DB โโโโโโโโโโโโโโโ
โ (llama-cpp-py) โโโโโโ (Milvus Lite) โ
โ โ โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
Core Components
- BaseLoader: Pluggable document loading (PDF, TXT, MD, etc.)
- BaseChunker: Configurable chunking strategies (semantic, recursive, etc.)
- BaseVectorizer: Flexible embedding models
- BaseLLM: Swappable language models
- MilvusLiteDB: High-performance vector storage and retrieval
๐ง Configuration
Custom Components
from rocketrag import RocketRAG
from rocketrag.vectors import SentenceTransformersVectorizer
from rocketrag.chonk import ChonkieChunker
from rocketrag.llm import LLamaLLM
from rocketrag.loaders import KreuzbergLoader
# Configure high-performance components
vectorizer = SentenceTransformersVectorizer(
model_name="minishlab/potion-multilingual-128M" # Fast multilingual model
)
chunker = ChonkieChunker(
method="semantic", # Semantic chunking for better context
embedding_model="minishlab/potion-multilingual-128M",
chunk_size=512
)
llm = LLamaLLM(
repo_id="unsloth/gemma-3n-E2B-it-GGUF",
filename="*Q8_0.gguf" # Quantized for speed
)
loader = KreuzbergLoader() # Ultra-fast document processing
rag = RocketRAG(
vectorizer=vectorizer,
chunker=chunker,
llm=llm,
loader=loader
)
CLI Configuration
# Custom chunking strategy
rocketrag prepare \
--chonker chonkie \
--chonker-args '{"method": "semantic", "chunk_size": 512}' \
--vectorizer-args '{"model_name": "all-MiniLM-L6-v2"}'
# Custom LLM for inference
rocketrag ask "Your question" \
--repo-id "microsoft/DialoGPT-medium" \
--filename "*.gguf"
๐ Web Server
RocketRAG includes a FastAPI-based web server with OpenAI-compatible endpoints:
# Start server
rocketrag server --port 8000 --host 0.0.0.0
API Endpoints
GET /- Interactive web interfacePOST /ask- Question answeringPOST /ask/stream- Streaming responsesGET /chat- Chat interfaceGET /browse- Document browserGET /visualize- Vector visualizationGET /health- Health check
Example API Usage
import requests
response = requests.post(
"http://localhost:8000/ask",
json={"question": "What are the main findings?"}
)
result = response.json()
print(result["answer"])
print(result["sources"])
๐จ Features
Core Features
- โก Ultra-fast document processing with Kreuzberg
- ๐ง Semantic chunking with Chonkie and model2vec
- ๐ High-performance vector search with Milvus Lite
- ๐ค Optimized LLM inference with llama-cpp-python
- ๐ Rich CLI interface with progress bars and formatting
- ๐ Web server with interactive UI
- ๐ Pluggable architecture for easy customization
Advanced Features
- ๐ Vector visualization for debugging and analysis
- ๐ Document browsing interface
- ๐ฌ Streaming responses for real-time interaction
- ๐ Batch processing for large document sets
- ๐ Metadata preservation throughout the pipeline
- ๐ฏ Context-aware chunking for better retrieval
๐ ๏ธ Development
Installation for Development
git clone https://github.com/yourusername/rocketrag.git
cd rocketrag
pip install -e ".[dev]"
Running Tests
pytest tests/
Code Quality
ruff check .
ruff format .
๐ Performance
RocketRAG is designed for speed:
- Document Loading: 10x faster with Kreuzberg's optimized parsers
- Chunking: Semantic chunking with model2vec for superior context preservation
- Vectorization: Optimized batch processing with sentence-transformers
- Retrieval: Sub-millisecond vector search with Milvus Lite
- Generation: GGUF quantization for 4x faster inference
๐ค Contributing
We welcome contributions! RocketRAG's modular architecture makes it easy to:
- Add new document loaders
- Implement custom chunking strategies
- Integrate different embedding models
- Support additional LLM backends
- Enhance the web interface
๐ Acknowledgments
RocketRAG builds upon the excellent work of:
- Chonkie for semantic chunking
- Kreuzberg for document processing
- llama-cpp-python for LLM inference
- Milvus for vector storage
- Sentence Transformers for embeddings
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rocketrag-0.1.5.tar.gz.
File metadata
- Download URL: rocketrag-0.1.5.tar.gz
- Upload date:
- Size: 47.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8234680515192e877c23bbb7a46909811e3dd075c210f59087f92d5cc2e4fab
|
|
| MD5 |
ed1391ceb0cb600961ae0cf0407ff4a0
|
|
| BLAKE2b-256 |
647ed9a98fd700d1b53410142678e9da58da3dfce8046e3d02a628d62584364e
|
File details
Details for the file rocketrag-0.1.5-py3-none-any.whl.
File metadata
- Download URL: rocketrag-0.1.5-py3-none-any.whl
- Upload date:
- Size: 40.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d89b9798a0b8d0d1654b6e76a1d737ce97be77523935b2a6496aadd25a6df965
|
|
| MD5 |
c7f8e0917b485e5a76fc030f99c3f690
|
|
| BLAKE2b-256 |
16347190748148eecc54d6f1feb6fa98a22e338165e7368f8774ccfec958242e
|