Skip to main content

Du-RAG

Du-RAG

Durable RAG - a persistent memory layer for AI agents built on retrieval-augmented generation.

License Stars Docs


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.

Latency Comparison

# 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

Release files for durag 2.1.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for durag 2.1.12
File Size Uploaded
durag-2.1.12.tar.gz 197.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for durag 2.1.12
File Interpreter ABI Platform
durag-2.1.12-py3-none-any.whl Python 3 none any Details

Total release size: 480.1 kB

Release files / durag-2.1.12.tar.gz

Download URL durag-2.1.12.tar.gz
Size 197.2 kB
Tags Source
SHA-256 checksum
How to use checksums
80ef1c17501c2d75b9f2571fcd5b740796c618a1d197bbf3d29e2b7fdce00e9d
BLAKE2b-256 checksum
How to use checksums
12a57040ccc279531e9b2aced2578e395a31233f8b32cb6b109c68d08e961cc5
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / durag-2.1.12-py3-none-any.whl

Download URL durag-2.1.12-py3-none-any.whl
Size 282.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
777c393c3bc96821126b0a742f5e9531e97015c9df184cd867d7aac7d6820d04
BLAKE2b-256 checksum
How to use checksums
b6f8bb53692dd0eb66104cd85a5479712db0e4213a196b1cdc601a8bc3d2185f
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

2.1.12 This release

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page