8000 GitHub - taahan0810/R2R: A framework for rapid development and deployment of production-ready RAG pipelines. · GitHub
[go: up one dir, main page]

Skip to content
taahan0810Public
forked from SciPhi-AI/R2R

About

A framework for rapid development and deployment of production-ready RAG pipelines.

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

R2R: Production-ready RAG systems.

Docs Discord Github Stars Commits-per-week License: MIT

Sciphi Framework

R2R was conceived to bridge the gap between experimental RAG models and robust, production-ready systems. Our semi-opinionated framework cuts through the complexity, offering a straightforward path to deploy, adapt, and maintain RAG pipelines in production. We prioritize simplicity and practicality, aiming to set a new industry benchmark for ease of use and effectiveness.

Demo(s)

Using cloud application to deploy the pre-built basic pipeline: https://www.loom.com/share/e3b934b554484787b005702ced650ac9

Note - the example above uses SciPhi Cloud to pair with the R2R framework for observability and optimization. We intend on launching a self-hosted version of the cloud framework as our codebase matures.

Quick Install:

Install R2R directly using pip:

# use the `'r2r[all]'` to download all required deps
pip install 'r2r[parsing,eval]'

# setup env 
export OPENAI_API_KEY=sk-...
export LOCAL_DB_PATH=local.sqlite

# OR do `vim .env.example && cp .env.example .env`
# INCLUDE secrets and modify config.json
# if using cloud providers (e.g. pgvector, supabase, ...)

Full Install:

For a full installation, which is recommended for development, please refer to the relevant documentation.

Links

Join the Discord server

Read the R2R Docs

Key Features

  • 🚀 Deploy: production-ready RAG pipelines with streaming in seconds
  • 🧩 Customize: your pipeline using intuitive configuration files
  • 🔌 Extend: your pipeline logic with code
  • ⚖️ Autoscale: your pipeline in the cloud with SciPhi
  • 🤖 OSS: framework built for and by the OSS community to make RAG easier.

Examples

The project includes several examples that demonstrate application deployment and interaction:

Servers

  1. basic_pipeline.py: This example runs the backend server with the basic RAG pipeline, which includes the ingestion, embedding, and RAG pipelines served via FastAPI.

    python -m r2r.examples.servers.basic_pipeline
  2. synthetic_query_pipeline.py: This example demonstrates a more advanced pipeline that generates synthetic queries to improve the RAG pipeline's performance.

    python -m r2r.examples.servers.synthetic_query_pipeline
  3. reducto_pipeline.py: This example showcases the integration of the Reducto adapter for PDF ingestion.

    python -m r2r.examples.servers.reducto_pipeline
  4. web_search_pipeline.py: This example demonstrates the usage of the WebSearchRAGPipeline for web search capabilities.

    python -m r2r.examples.servers.web_search_pipeline

Clients

  1. run_basic_client.py: This example should be run after starting the basic pipeline server. It demonstrates uploading text entries and a PDF to the local server using the Python client. It also showcases document and user-level vector management with built-in features.

    python -m r2r.examples.clients.run_basic_client
  2. run_basic_client_ext.py: This example extends the basic client functionality and provides a more interactive experience for uploading and querying documents.

    python -m r2r.examples.clients.run_basic_client_ext
  3. run_synthetic_query_client.py: This example is optimized for interaction with the synthetic query pipeline server, showcasing the enhanced RAG pipeline's capabilities.

    python -m r2r.examples.clients.run_synthetic_query_client

Core Abstractions

The framework primarily revolves around three core abstractions:

  • The Ingestion Pipeline: Facilitates the preparation of embeddable 'Documents' from various data formats (json, txt, pdf, html, etc.). The abstraction can be found in ingestion.py and relevant documentation is available here.

  • The Embedding Pipeline: Manages the transformation of text into stored vector embeddings, interacting with embedding and vector database providers through a series of steps (e.g., extract_text, transform_text, chunk_text, embed_chunks, etc.). The abstraction can be found in embedding.py and relevant documentation is available here.

  • The RAG Pipeline: Works similarly to the embedding pipeline but incorporates an LLM provider to produce text completions. The abstraction can be found in rag.py and relevant documentation is available here.

  • The Eval Pipeline: Samples some subset of rag_completion calls for evaluation. Currently DeepEval is supported. The abstraction can be found in eval.py and relevant documentation is available here.

Each pipeline incorporates a logging database for operation tracking and observability.

About

A framework for rapid development and deployment of production-ready RAG pipelines.

Resources

Code of conduct

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0