Skip to main content

Super-Rag

Super performant RAG pipeline for AI apps.


FeaturesInstallationHow to useCloud API

✅ Key features

  • Supports multiple document formats and vector databases.
  • Provides a production ready REST API.
  • Customizable splitting/chunking.
  • Includes options for encoding data using different encoding models both propriatory and open source.
  • Built in code interpreter mode for computational question & answer scenarios.
  • Allows session management through unique IDs for caching purposes.

☁️ Cloud API

Easiset way to get started is to use our Cloud API. This API is free to use (within reasonable limits).

📦 Installation

  1. Clone the repository

    git clone https://github.com/superagent-ai/super-rag 
    cd super-rag 
    
  2. Setup virtual environment

    # Using virtualenv 
    virtualenv env 
    source env/bin/activate 
    
    # Or using venv 
    python3 -m venv env 
    source env/bin/activate 
    
  3. Install requried packages

    poetry install
    
  4. Rename .env.example to .env and set your environment variables

  5. Run server

    uvicorn main:app --reload
    

🚀 How to use

Super-Rag comes with a built in REST API powered by FastApi.

Ingest documents

// POST: /api/v1/ingest

// Payload
{
    "files": [
        {
            "name": "My file", // Optional
            "url": "https://path-to-my-file.pdf"
        }
    ],
    "document_processor": { // Optional
        "encoder": {
            "dimensions": 384,
            "model_name": "embed-multilingual-light-v3.0",
            "provider": "cohere"
        },
        "unstructured": {
            "hi_res_model_name": "detectron2_onnx",
            "partition_strategy": "auto",
            "process_tables": false
        },
        "splitter": {
            "max_tokens": 400,
            "min_tokens": 30,
            "name": "semantic",
            "prefix_summary": true,
            "prefix_title": true,
            "rolling_window_size": 1
        }
    },
    "vector_database": {
        "type": "qdrant",
        "config": {
            "api_key": "YOUR API KEY",
            "host": "THE QDRANT HOST"
        }
    },
    "index_name": "my_index",
    "webhook_url": "https://my-webhook-url"
}

Query documents

// POST: /api/v1/query

// Payload
{
    "input": "What is ReAct",
    "vector_database": {
            "type": "qdrant",
            "config": {
            "api_key": "YOUR API KEY",
            "host": "THE QDRANT HOST"
        }
        },
    "index_name": "YOUR INDEX",
    "interpreter_mode": true,
    "encoder": {
        "provider": "cohere",
        "name": "embed-multilingual-light-v3.0",
        "dimensions": 384
    },
    "exclude_fields": ["metadata"], // Exclude specific fields
    "interpreter_mode": False, // Set to True if you wish to run computation Q&A with a code interpreter
    "session_id": "my_session_id" // keeps micro-vm sessions and enables caching 
}

Delete document

// POST: /api/v1/delete

// Payload
{
    "file_url": "A file url to delete",
    "vector_database": {
        "type": "qdrant",
        "config": {
            "api_key": "YOUR API KEY",
            "host": "THE QDRANT HOST"
        }
    },
    "index_name": "my_index",
}

🧠 Supportd encoders

  • OpenAi
  • Cohere
  • HuggingFace
  • FastEmbed

🗃 Supported vector databases

  • Weaviate
  • Qdrant
  • Weaviate
  • Astra
  • Supabase (coming soon)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

super_rag-0.0.10.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

super_rag-0.0.10-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file super_rag-0.0.10.tar.gz.

File metadata

  • Download URL: super_rag-0.0.10.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.2.0

File hashes

Hashes for super_rag-0.0.10.tar.gz
Algorithm Hash digest
SHA256 dd126df2fee0497202529324cb69d5c727be0ad7d526767e731734f49f05aeb3
MD5 6baa28ef6bb43d0958d1af2f47629ffa
BLAKE2b-256 ee3bb982b62437c44c8683c3e5a587b5ab9712dcdb9fb5e3b1c711fdbd9137e8

See more details on using hashes here.

File details

Details for the file super_rag-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: super_rag-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Darwin/23.2.0

File hashes

Hashes for super_rag-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 641c643129a4ce1ebd7fe4b286d11109c2bbe808140af0654a9e01992d5fc0f4
MD5 609366fb81745888c37f290733f27332
BLAKE2b-256 f10d9723d063f87288484808d9e790869c285cd634c8a0726c59a709d0d6d460

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.10 This release

2 files

0.0.9

2 files

Supported by

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