Du-RAG: Durable RAG — persistent memory for AI agents
Project description
Du-RAG
Durable RAG - a persistent memory layer for AI agents built on retrieval-augmented generation.
pip install durag
from durag import Memory
m = Memory()
m.add("Alice loves Python and open source", user_id="alice")
m.add("Alice built Du-RAG", user_id="alice")
history = m.get_all(filters={"user_id": "alice"})
print(history)
Why Du-RAG?
Du-RAG is the fastest memory library for AI agents. Unlike other libraries that block for 1-2 seconds calling an LLM on every write, Du-RAG stores memories instantly and lets you consolidate in the background.
# Fast path - returns in ~50ms, no LLM call
m.add("Alice switched to Enterprise plan", user_id="alice")
# Search works immediately on raw text
results = m.search("What plan is Alice on?", user_id="alice")
# Consolidate later - batch-extract facts with one LLM call
m.consolidate(user_id="alice")
API Keys
Du-RAG requires a provider API key. Set the env var for your preferred provider before first use:
| Provider | Env Var | Used For |
|---|---|---|
| OpenAI (default) | OPENAI_API_KEY |
Embeddings + LLM |
| Anthropic | ANTHROPIC_API_KEY |
LLM |
| Google Gemini | GOOGLE_API_KEY |
Embeddings + LLM |
| DeepSeek | DEEPSEEK_API_KEY |
LLM |
| Together AI | TOGETHER_API_KEY |
Embeddings + LLM |
| Groq | GROQ_API_KEY |
LLM |
| MiniMax | MINIMAX_API_KEY |
LLM |
| Sarvam AI | SARVAM_API_KEY |
LLM |
| vLLM | VLLM_API_KEY |
LLM |
export OPENAI_API_KEY="sk-..."
Features
- Fast writes - add() returns in ~50ms (no blocking LLM call)
- Async consolidation - batch-extract facts with consolidate() when idle
- Persistent memory across conversations - agents remember what they learn
- Semantic search via vector embeddings - find the right context fast
- Multiple backends - OpenAI, Anthropic, Gemini, DeepSeek, Ollama, vLLM, and more
- Vector stores - Qdrant (default), FAISS, Chroma, Pinecone, Weaviate, and others
License
Apache 2.0
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 durag-2.1.12.tar.gz.
File metadata
- Download URL: durag-2.1.12.tar.gz
- Upload date:
- Size: 197.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80ef1c17501c2d75b9f2571fcd5b740796c618a1d197bbf3d29e2b7fdce00e9d
|
|
| MD5 |
46d2f66ca09e051ed471553d7ea06db8
|
|
| BLAKE2b-256 |
12a57040ccc279531e9b2aced2578e395a31233f8b32cb6b109c68d08e961cc5
|
File details
Details for the file durag-2.1.12-py3-none-any.whl.
File metadata
- Download URL: durag-2.1.12-py3-none-any.whl
- Upload date:
- Size: 282.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
777c393c3bc96821126b0a742f5e9531e97015c9df184cd867d7aac7d6820d04
|
|
| MD5 |
474f81cf8060a759810386b92a2bb1b4
|
|
| BLAKE2b-256 |
b6f8bb53692dd0eb66104cd85a5479712db0e4213a196b1cdc601a8bc3d2185f
|