Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/superagent-ai/super-rag
Super performant RAG pipelines for AI apps. Summarization, Retrieve/Rerank and Code Interpreters in one simple API.
https://github.com/superagent-ai/super-rag
agents ai embeddings inference rag vector-database
Last synced: about 22 hours ago
JSON representation
Super performant RAG pipelines for AI apps. Summarization, Retrieve/Rerank and Code Interpreters in one simple API.
- Host: GitHub
- URL: https://github.com/superagent-ai/super-rag
- Owner: superagent-ai
- License: mit
- Created: 2024-01-13T21:06:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-30T08:51:06.000Z (9 months ago)
- Last Synced: 2025-01-09T23:13:19.817Z (10 days ago)
- Topics: agents, ai, embeddings, inference, rag, vector-database
- Language: Python
- Homepage: https://docs.superagent.sh
- Size: 637 KB
- Stars: 349
- Watchers: 6
- Forks: 54
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - superagent-ai/super-rag - Super performant RAG pipelines for AI apps. Summarization, Retrieve/Rerank and Code Interpreters in one simple API. (Python)
- jimsghstars - superagent-ai/super-rag - Super performant RAG pipelines for AI apps. Summarization, Retrieve/Rerank and Code Interpreters in one simple API. (Python)
README
Super-Rag
Super-performant RAG pipeline for AI apps.
Features •
Installation •
How to use •
Cloud 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
Easiest way to get started is to use our [Cloud API](https://d3jvqvcd9u4534.cloudfront.net). This API is free to use (within reasonable limits).
## 📦 Installation
1. Clone the repository
```bash
git clone https://github.com/superagent-ai/super-rag
cd super-rag
```2. Setup virtual environment
```bash
# Using virtualenv
virtualenv env
source env/bin/activate
# Or using venv
python3 -m venv env
source env/bin/activate
```3. Install requried packages
```bash
poetry install
```4. Rename `.env.example` to `.env` and set your environment variables
5. Run server
```bash
uvicorn main:app --reload
```
## 🤖 Interpreter mode
Super-Rag has built in support for running computational Q&A using code interpreters powered by [E2B.dev](https://e2b.dev) custom runtimes. You can signup to receive an API key to leverage they sandboxes in a cloud environment or setup your own by following [these instructions](https://github.com/e2b-dev/infra).## 🚀 How to use
Super-Rag comes with a built in REST API powered by FastApi.### Ingest documents
```json
// POST: /api/v1/ingest// Payload
{
"files": [
{
"name": "My file", // Optional
"url": "https://path-to-my-file.pdf",
"metadata": { // Optional
"key": "value"
}
}
],
"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
```json
// 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
},
"filter": { // Optional
// Each provider has its own filter schema,
// for Qdrant it looks like the following:
"must": [
{
"key": "key",
"match": {
"value": "value"
}
}
]
},
"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
```json
// 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
- Mistral (coming soon)
- Anthropic (coming soon)## 🗃 Supported vector databases
- Pinecone
- Qdrant
- Weaviate
- Astra
- PGVector
- Chroma (coming soon)