rrag

Crates.iorrag
lib.rsrrag
version0.1.0-alpha.2
created_at2025-08-11 11:35:46.759829+00
updated_at2025-08-12 05:19:14.038602+00
descriptionHigh-performance Rust framework for Retrieval-Augmented Generation with pluggable components, async-first design, and comprehensive observability
homepagehttps://rrag.dev
repositoryhttps://github.com/leval-ai/rrag
max_upload_size
id1789981
size2,311,589
vasanth (0xvasanth)

documentation

https://docs.rs/rrag

README

RRAG - Enterprise Rust RAG Framework

Crates.io Documentation License: MIT Downloads Rust

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

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Documents     │───▢│   Processing    │───▢│   Vector Store  β”‚
β”‚   (Input)       β”‚    β”‚   Pipeline      β”‚    β”‚   (Storage)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Responses     │◀───│     Agent       │◀───│    Retriever    β”‚
β”‚   (Output)      β”‚    β”‚   (rsllm)       β”‚    β”‚   (Search)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

⚑ Quick Start

Add RRAG to your Cargo.toml:

[dependencies]
rrag = { version = "0.1", features = ["rsllm-client"] }
tokio = { version = "1.0", features = ["full"] }

Basic RAG Application

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 for complete API documentation and examples.

πŸ”§ Feature Flags

[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.

Commit count: 0

cargo fmt