Official Python client for the Durbl memory engine
Project description
Durbl Python SDK
The official Python client for the Durbl memory engine — a single backend that gives AI agents persistent, queryable memory across runs, sessions, and users. One API for write, recall, state, context, lifecycle, and signals — replacing a stack of vector DB + cache + queue + state store + summarizer.
Install
pip install durbl-sdk
Quickstart
from durbl_sdk import Durbl
client = Durbl(api_key="drbl_...") # or set DURBL_API_KEY
# Write a memory
client.memory.write(
entity="user/ahmed",
content="Prefers TypeScript over JavaScript",
type="preference",
importance=0.8,
)
# Update entity state
client.state.update("user/ahmed", {"plan": "pro", "seats": 5})
# Recall by semantic search
hits = client.memory.recall(entity="user/ahmed", query="language preference", limit=3)
for m in hits:
print(m["content"])
# Build a context window for an LLM call
ctx = client.context.build(entity="user/ahmed", goal="suggest a stack", max_memories=10)
print(ctx.assembled_context)
Async usage
Every resource has an a* mirror that uses httpx.AsyncClient:
import asyncio
from durbl_sdk import Durbl
async def main():
async with Durbl(api_key="drbl_...") as client:
await client.memory.awrite(entity="user/me", content="Likes coffee", type="preference")
state = await client.state.aget("user/me")
asyncio.run(main())
Resources
| Resource | Operations |
|---|---|
client.memory |
write · get · update · delete · list · recall |
client.state |
get · update · history |
client.context |
build · recall |
client.events |
write · list |
client.intelligence |
(analytics endpoints) |
client.lifecycle |
(memory lifecycle) |
client.policies |
(per-project policies) |
Entity IDs
Entity IDs are free-form strings and may contain / (user/ahmed,
team/acme/billing). The SDK percent-encodes them automatically when
they appear in URL paths.
Error handling
from durbl_sdk.exceptions import DurblAPIError
try:
client.memory.write(entity="user/me", content="...")
except DurblAPIError as e:
print(e.status_code, e.message)
Examples
The examples/
directory has runnable sample apps:
- personal_coach — habit/goal tracker with semantic + preference memory
- recipe_memory — diet/preference-aware meal suggestions
- support_agent — per-customer briefs that demonstrate isolation
Links
- Homepage: https://durbl.dev
- Docs: https://docs.durbl.dev
- Issues: https://github.com/durbl-ai/durbl/issues
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 durbl_sdk-0.2.2.tar.gz.
File metadata
- Download URL: durbl_sdk-0.2.2.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b74c0d1e521d1a6af694908b0fb19ceccf23d3bfe894006fae545da0656dd47
|
|
| MD5 |
da73a9ac703f0a9995d4d071445e3c1c
|
|
| BLAKE2b-256 |
0049436d75af77f84d29067f2bf358849342d5bdee998767ef32e114a0169cb1
|
File details
Details for the file durbl_sdk-0.2.2-py3-none-any.whl.
File metadata
- Download URL: durbl_sdk-0.2.2-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1ac438085ea86214f1c1812c2db8fd6cd7c399950fbdefb62dbb92b75bef2ec
|
|
| MD5 |
50a206ba5c2ad6f02e349aa2f40b8e36
|
|
| BLAKE2b-256 |
80a2f554949b923a4ed3509f264063a0fb920ff9738f4a779ac2fb16b6b8cfd9
|