Skip to main content

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

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

durbl_sdk-0.2.4.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

durbl_sdk-0.2.4-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file durbl_sdk-0.2.4.tar.gz.

File metadata

  • Download URL: durbl_sdk-0.2.4.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for durbl_sdk-0.2.4.tar.gz
Algorithm Hash digest
SHA256 4237a240c59f1fb9112b94ae0e79d6bd95b545de3d55bcf627f55abbc68f7442
MD5 0b851482c96f6435d060c43384486bd1
BLAKE2b-256 23d62564f039beb354ff10e027d268ca028f0b5402a3a2826d98ceae983b638a

See more details on using hashes here.

Provenance

The following attestation bundles were made for durbl_sdk-0.2.4.tar.gz:

Publisher: publish.yml on durbl-ai/durbl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file durbl_sdk-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: durbl_sdk-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for durbl_sdk-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 10691802978b3bc7081065127b28a60b5ac7498762f28a196497e1c49dfd0fdd
MD5 32df18abd83628a7fef960bb00399ff6
BLAKE2b-256 5b116ad5d4cc04f28bb3fe02ffbdc8d434cb3ac9502dba9b7cf4ede303a96f55

See more details on using hashes here.

Provenance

The following attestation bundles were made for durbl_sdk-0.2.4-py3-none-any.whl:

Publisher: publish.yml on durbl-ai/durbl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page