Aquiles-RAG is a high-performance Retrieval-Augmented Generation (RAG) solution built on Redis. It offers a high-level interface through FastAPI REST APIs
Project description
Aquiles‑RAG
High‑performance Retrieval‑Augmented Generation (RAG) on Redis
🚀 FastAPI • Redis Vector Search • Async • Embedding‑agnostic
📑 Table of Contents
⭐ Features
- 📈 High Performance: Redis-powered vector search using HNSW.
- 🛠️ Simple API: Endpoints for index creation, insertion, and querying.
- 🔌 Embedding‑agnostic: Works with any embedding model (OpenAI, Llama 3, etc.).
- 💻 Integrated CLI: Configure and serve with built‑in commands.
- 🧩 Extensible: Ready to integrate into ML pipelines or microservices.
🛠 Tech Stack
- Python 3.9+
- FastAPI
- Redis + [
redis-pyasync / cluster] - NumPy
- Pydantic
- Jinja2
- Click (CLI)
- Requests (Python client)
- Platformdirs (config management)
⚙️ Requirements
- Redis (standalone or cluster)
- Python 3.9+
- pip
Optional: Run Redis with Docker:
docker run -d --name redis-stack -p 6379:6379 redis/redis-stack-server:latest
🚀 Installation
Via PyPI
The easiest way is to install directly from PyPI:
pip install aquiles-rag
From Source (optional)
If you’d like to work from the latest code or contribute:
-
Clone the repository and navigate into it:
git clone https://github.com/Aquiles-ai/Aquiles-RAG.git cd Aquiles-RAG
-
Create a virtual environment and install dependencies:
python -m venv .venv source .venv/bin/activate pip install -r requirements.txt
-
(Optional) Install in editable/development mode:
pip install -e .
🔧 Configuration & Connection Options
Aquiles‑RAG stores its configuration in:
~/.local/share/aquiles/aquiles_config.json
By default, it uses:
{
"local": true,
"host": "localhost",
"port": 6379,
"username": "",
"password": "",
"cluster_mode": false,
"tls_mode": false,
"ssl_certfile": "",
"ssl_keyfile": "",
"ssl_ca_certs": "",
"allows_api_keys": [""],
"allows_users": [{"username": "root", "password": "root"}]
}
You can modify the config file manually or use the CLI:
aquiles-rag configs --host redis.example.com --port 6380 --username user --password pass
Redis Connection Modes
Aquiles‑RAG supports four modes to connect to Redis, based on your config:
-
Local Cluster (
local=true&cluster_mode=true)RedisCluster(host=host, port=port, decode_responses=True)
-
Standalone Local (
local=true)redis.Redis(host=host, port=port, decode_responses=True)
-
Remote with TLS/SSL (
local=false,tls_mode=true)redis.Redis( host=host, port=port, username=username or None, password=password or None, ssl=True, decode_responses=True, ssl_certfile=ssl_certfile, # if provided ssl_keyfile=ssl_keyfile, # if provided ssl_ca_certs=ssl_ca_certs # if provided )
-
Remote without TLS/SSL (
local=false,tls_mode=false)redis.Redis( host=host, port=port, username=username or None, password=password or None, decode_responses=True )
These options give full flexibility to connect to any Redis topology securely.
📖 Usage
CLI
-
Save configs
aquiles-rag configs --host "127.0.0.1" --port 6379
-
Serve the API
aquiles-rag serve --host "0.0.0.0" --port 5500
-
Deploy custom config
aquiles-rag deploy --host "0.0.0.0" --port 5500 --workers 4 my_config.py
REST API
-
Create Index
curl -X POST http://localhost:5500/create/index \ -H "X-API-Key: YOUR_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "indexname": "documents", "embeddings_dim": 768, "dtype": "FLOAT32", "delete_the_index_if_it_exists": false }'
-
Insert Chunk
curl -X POST http://localhost:5500/rag/create \ -H "X-API-Key: YOUR_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "index": "documents", "name_chunk": "doc1_part1", "dtype": "FLOAT32", "chunk_size": 1024, "raw_text": "Text of the chunk...", "embeddings": [0.12, 0.34, 0.56, ...] }'
-
Query Top‑K
curl -X POST http://localhost:5500/rag/query-rag \ -H "X-API-Key: YOUR_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "index": "documents", "embeddings": [0.78, 0.90, ...], "dtype": "FLOAT32", "top_k": 5, "cosine_distance_threshold": 0.6 }'
Python Client
from aquiles.client import AquilesRAG
client = AquilesRAG(host="http://127.0.0.1:5500", api_key="YOUR_API_KEY")
# Create an index
client.create_index("documents", embeddings_dim=768, dtype="FLOAT32")
# Insert chunks using your embedding function
def get_embedding(text):
# e.g. call OpenAI, Llama3, etc.
return embedding_model.encode(text)
responses = client.send_rag(
embedding_func=get_embedding,
index="documents",
name_chunk="doc1",
raw_text=full_text
)
# Query the index
results = client.query("documents", query_embedding, top_k=5)
print(results)
UI Playground
Access the web UI (with basic auth) at:
http://localhost:5500/ui
Use it to:
- Edit configurations live
- Test
/create/index,/rag/create,/rag/query-rag - Explore protected Swagger UI & ReDoc docs
🚀 Screenshots
-
Playground Home
-
Live Configurations
-
Creating an Index
-
Adding Data to RAG
-
Querying RAG Results
🏗 Architecture
The following diagram shows the high‑level architecture of Aquiles‑RAG:
- Clients (HTTP/HTTPS, Python SDK, or UI Playground) make asynchronous HTTP requests.
- FastAPI Server acts as the orchestration and business‑logic layer, validating requests and translating them to vector store commands.
- Redis / RedisCluster serves as the RAG vector store (HASH + HNSW/COSINE search).
Test Suite*: See the
test/direct*ory for automated tests:
- client tests for the Python SDK
- API tests for endpoint behavior
- test_deploy.py for deployment configuration and startup validation
📄 License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aquiles_rag-0.2.7.1.tar.gz.
File metadata
- Download URL: aquiles_rag-0.2.7.1.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f7a9d2408f6bb3e38ff0b407f78f8d68bbf8dfc9598a437c30526de7d88377c
|
|
| MD5 |
c3434df96cb90fcd75501ecc2f5e0bbb
|
|
| BLAKE2b-256 |
950a2f0abdcbd2a914f47d95b8df58244e33b88cf141c1132095890e7def5c31
|
File details
Details for the file aquiles_rag-0.2.7.1-py3-none-any.whl.
File metadata
- Download URL: aquiles_rag-0.2.7.1-py3-none-any.whl
- Upload date:
- Size: 1.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffe3bf9101d4dc5cff9818af15af320aef69b803ec93020ea22be6174befa190
|
|
| MD5 |
ec80bc83c48889dbee3d4e6f72705d8f
|
|
| BLAKE2b-256 |
69a8fee0a765648adf7177534143e21e7b78571152cf11a8ebca6d28db02f640
|