# RRAG - Enterprise Rust RAG Framework
[](https://crates.io/crates/rrag)
[](https://docs.rs/rrag)
[](https://opensource.org/licenses/MIT)
[](https://crates.io/crates/rrag)
[](https://www.rust-lang.org)
**RRAG** (Rust RAG) is a high-performance, enterprise-ready framework for building Retrieval-Augmented Generation applications in Rust. Built from the ground up with safety, performance, and developer experience in mind.
## π― Why RRAG?
- **π Native Performance**: Zero-cost abstractions with compile-time optimizations
- **π‘οΈ Memory Safety**: Rust's ownership system prevents data races and memory leaks
- **β‘ Async First**: Built on Tokio for maximum concurrency
- **π― Type Safety**: Compile-time guarantees eliminate runtime errors
- **π Modular Design**: Pluggable architecture with swappable components
- **π Production Ready**: Built-in observability, security, and monitoring
## ποΈ Architecture Overview
```text
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Documents βββββΆβ Processing βββββΆβ Vector Store β
β (Input) β β Pipeline β β (Storage) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Responses ββββββ Agent ββββββ Retriever β
β (Output) β β (rsllm) β β (Search) β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
```
## β‘ Quick Start
Add RRAG to your `Cargo.toml`:
```toml
[dependencies]
rrag = { version = "0.1", features = ["rsllm-client"] }
tokio = { version = "1.0", features = ["full"] }
```
### Basic RAG Application
```rust
use rrag::prelude::*;
#[tokio::main]
async fn main() -> RragResult<()> {
// Create a RAG system
let rag = RragSystem::builder()
.with_rsllm_client("http://localhost:8080")
.with_vector_store(InMemoryStorage::new())
.with_chunk_size(512)
.build()
.await?;
// Add documents
rag.ingest_documents(vec![
Document::new("Rust is a systems programming language..."),
Document::new("RAG combines retrieval with generation..."),
]).await?;
// Query the system
let response = rag.query("What is Rust?").await?;
println!("Response: {}", response.text);
Ok(())
}
```
## π Core Features
### π Advanced Retrieval
- **Hybrid Search**: Combines semantic and keyword search with multiple fusion strategies
- **Graph-Based Retrieval**: Knowledge graph construction with entity extraction
- **Multi-Modal Support**: Process text, images, tables, charts, and documents
- **Smart Reranking**: Cross-encoder models for precise result ranking
### π§ Intelligent Agents
- **Tool Integration**: Built-in calculator, HTTP client, and custom tool support
- **Memory Management**: Conversation buffers, token limits, and summarization
- **Streaming Responses**: Real-time token streaming with async iterators
### β‘ Performance & Scalability
- **Intelligent Caching**: Multi-level caching with semantic similarity
- **Incremental Indexing**: Efficient document updates without full rebuilds
- **Batch Processing**: High-throughput document ingestion
### π Production Features
- **Observability Dashboard**: Real-time monitoring with web UI and metrics
- **Security & Rate Limiting**: Authentication, authorization, and abuse prevention
- **Health Checks**: Component monitoring and dependency tracking
## π Documentation
Visit [docs.rs/rrag](https://docs.rs/rrag) for complete API documentation and examples.
## π§ Feature Flags
```toml
[dependencies.rrag]
version = "0.1"
features = [
"rsllm-client", # rsllm integration
"http", # HTTP tools and clients
"concurrent", # Concurrent data structures
"multimodal", # Multi-modal processing
"observability", # Monitoring and metrics
"security", # Authentication and rate limiting
]
```
## π License
This project is licensed under the MIT License.
## π€ Contributing
Contributions welcome! Please see our contributing guidelines for details.