Skip to main content

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.

๐ŸŽฏ 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:

๐Ÿš€ 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 interface
  • POST /ask - Question answering
  • POST /ask/stream - Streaming responses
  • GET /chat - Chat interface
  • GET /browse - Document browser
  • GET /visualize - Vector visualization
  • GET /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:

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

rocketrag-0.1.0.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rocketrag-0.1.0-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file rocketrag-0.1.0.tar.gz.

File metadata

  • Download URL: rocketrag-0.1.0.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.21

File hashes

Hashes for rocketrag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8c0d712ffa882c3fbd3a10f3c2c704ac008ad7729455fe4a8cc7c1266e07ad6d
MD5 f56108fbd6a091fceb3fa19f034baf9b
BLAKE2b-256 6bfd0311029278a56e06c74bedc03664e421da8b1e2bda019ef03884a8e482a7

See more details on using hashes here.

File details

Details for the file rocketrag-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rocketrag-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.21

File hashes

Hashes for rocketrag-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d592ab45ccc2491a4e6c86df79cd2f4ed651451fa119476dabadcc96fea335d6
MD5 6efc7b9beb4a501c6bf920b377d6f572
BLAKE2b-256 ebed3ddcef3935a57ea75e04638088882cb5940f80c2b2b66b5830275e1f7b1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page