Skip to main content

Dakera AI

dakera-py

Python SDK for Dakera AI — the memory engine for AI agents

CI PyPI Downloads License: MIT Docs LoCoMo 88.2% Playground


Why Dakera?

Dakera Others
LoCoMo Recall@20 88.2% (1,536 Q, LLM-judged retrieval recall) not directly comparable
Deployment Single binary, Docker one-liner External vector DB + embedding service required
Embeddings Built-in — no OpenAI key needed Requires external embedding API
Search modes Vector · BM25 · Hybrid · Knowledge Graph Usually one or two
Transport HTTP + gRPC HTTP only

→ Try the playground · Full benchmark results · dakera.ai


Run Dakera

docker run -d \
  --name dakera \
  -p 3000:3000 \
  -e DAKERA_ROOT_API_KEY=dk-mykey \
  ghcr.io/dakera-ai/dakera:latest

curl http://localhost:3000/health  # → {"status":"ok"}

For persistent storage with Docker Compose:

curl -sSfL https://raw.githubusercontent.com/Dakera-AI/dakera-deploy/main/docker/docker-compose.yml \
  -o docker-compose.yml
DAKERA_API_KEY=dk-mykey docker compose up -d

Full deployment guide (Docker Compose, Kubernetes, Helm): dakera-deploy


Install

pip install dakera

For async support (AsyncDakeraClient):

pip install dakera[async]

Works with LangChain, LlamaIndex, CrewAI, AutoGen, and any Python agent framework.


Quick Start

from dakera import DakeraClient
client = DakeraClient(base_url="http://localhost:3000", api_key="dk-mykey")
client.store_memory(agent_id="my-agent", content="User prefers brevity", importance=0.9)

Full example — store, recall, upsert, and hybrid search:

from dakera import DakeraClient

client = DakeraClient(base_url="http://localhost:3000", api_key="dk-mykey")

# Store an agent memory
client.store_memory(
    agent_id="my-agent",
    content="User prefers concise responses with code examples",
    importance=0.9,
    tags=["preference"],
)

# Recall memories (semantic search)
response = client.recall(agent_id="my-agent", query="what does the user prefer?", top_k=5)
for m in response.memories:
    print(f"[{m.importance:.2f}] {m.content}")

# Upsert vectors
client.upsert("my-namespace", vectors=[
    {"id": "vec1", "values": [0.1, 0.2, 0.3], "metadata": {"category": "docs"}},
])

# Hybrid search (vector + BM25)
results = client.hybrid_search("my-namespace", query="completed task", top_k=5, vector_weight=0.7)
for r in results:
    print(r.id, r.score)

Async

import asyncio
from dakera import AsyncDakeraClient

async def main():
    client = AsyncDakeraClient(base_url="http://localhost:3000", api_key="dk-mykey")
    response = await client.recall(agent_id="my-agent", query="preferences", top_k=5)
    for m in response.memories:
        print(m.content)

asyncio.run(main())

Features

  • Agent Memory — store, recall, search, and forget memories with importance scoring
  • Sessions — group memories by conversation with auto-consolidation on session end
  • Knowledge Graph — traverse memory relationships, find paths, export graphs
  • Vector Search — ANN queries with metadata filters and batch operations
  • Full-Text Search — BM25 ranking with stemming and stop-word filtering
  • Hybrid Search — combine vector similarity with keyword matching
  • Text Auto-Embedding — server-side embedding generation (no local model needed)
  • Namespaces — isolated vector stores per project, tenant, or use case
  • Feedback Loop — upvote/downvote/flag memories to improve recall quality
  • T-I-F Reliability — TifScore and evaluate_tif() for Truth-Indeterminacy-Falsity scoring of memory reliability
  • Entity Extraction — GLiNER NER for automatic entity detection
  • Streaming — SSE event subscriptions for real-time memory updates
  • Sync + Async — full parity between DakeraClient and AsyncDakeraClient
  • Typed Models — full type annotations with strict mypy, PEP 561 py.typed marker
  • Retry & Rate Limiting — built-in exponential backoff, Retry-After honoured on 503/429, and rate-limit header tracking
  • Attachments & Records — upload audio/images, transcribe or index them into memories, store multi-representation records (server v0.12+)
  • Filter DSL — F.eq(), F.gt(), F.contains() typed filter builder

What's new for Dakera server v0.12.0

Version 0.13.0 of this SDK adds support for Dakera server v0.12.0 (operator upgrade guide: docs/v0.12/UPGRADE.md in the server release; release notes in the Dakera changelog).

Compatible with both v0.11.108 and v0.12.0 servers. Everything new is additive: calls that do not use a v0.12 feature send exactly what they sent before, and the v0.12-only calls fail with a clear error (NotFoundError / 405) on a v0.11 server.

  • Health and readiness — a v0.12 server binds its port while models load and answers 503 + Retry-After on /health. client.is_ready() / client.wait_until_ready() use /health/ready (a 503 is never "healthy"); health_ready() and health_live() map to /health/ready and /health/live.
  • Errors and retries — every error body is JSON. 503 raises ServiceUnavailableError (a ServerError) and the retry logic waits for the server's Retry-After. 413 raises PayloadTooLargeError (.is_quota for a namespace quota, .is_oversize for an over-size request), 501 raises FeatureNotAvailableError (details names the DAKERA_* switch), 409 raises ConflictError; NotFoundError.resource says what was not found.
  • GET /v1/capabilities — client.capabilities(): models (bge-m3, colbert-small), index kinds (ivfpq), search mode (rabitq), record kinds and dtypes, query languages, plus scoring, attachments, vision. Unknown strings parse as unknown enum members instead of raising.
  • Attachments (opt-in on the server, DAKERA_ATTACHMENTS) — upload_attachment, list_attachments, download_attachment, delete_attachment, store_memory(..., attachment_ref=...), transcribe_attachment / get_transcription_job / wait_for_transcription and, with DAKERA_VISION, index_attachment / wait_for_index.
  • Records (opt-in, DAKERA_RECORDS) — upsert_records / get_record: one primary vector plus named dense, token_multivector or patch_multivector representations stored as f32, f16 or i8.
  • Per-request lang on store_memory, store_memories_batch, update_memory, recall, search_memories and extract_entities.
  • Namespace config — replace_namespace_ner_config() (PUT) replaces the entity-extraction config; the v0.12 server's PATCH merges and refuses unknown fields.
  • Fix — async extract_entities() sent text instead of content.
from dakera import DakeraClient, Record, Representation, RepresentationKind, BlockDType

client = DakeraClient("http://localhost:3000", api_key="your-key")
client.wait_until_ready(timeout=120)

caps = client.capabilities()
if caps.supports_attachments:
    up = client.upload_attachment("_dakera_agent_a1", "note.wav")
    job = client.transcribe_attachment("_dakera_agent_a1", up.attachment_ref, "a1", lang="en")
    done = client.wait_for_transcription("_dakera_agent_a1", up.attachment_ref, job.job_id)

if caps.supports_records:
    client.upsert_records("docs", [Record(
        id="r1", values=[0.1, 0.2, 0.3, 0.4],
        representations=[Representation(
            "tokens", [[0.1, 0.2], [0.3, 0.4]],
            kind=RepresentationKind.TOKEN_MULTIVECTOR, store_as=BlockDType.F16)])])

Note: the v0.12 server's gRPC port requires an API key. This SDK speaks REST only.


Connect to Dakera

from dakera import DakeraClient, RetryConfig

# Self-hosted
client = DakeraClient(base_url="http://your-server:3000", api_key="your-key")

# Cloud (early access)
client = DakeraClient(base_url="http://<your-server-ip>:3000", api_key="your-key")

# With custom retry config
client = DakeraClient(
    base_url="http://localhost:3000",
    api_key="your-key",
    retry_config=RetryConfig(max_retries=5, base_delay=0.2),
)

Integrations

TealTiger Governance Middleware

TealTiger is a governance middleware for AI agents that enforces cost limits, decision policies, and delegation rules. Use Dakera as the persistent backend for all TealTiger artefacts:

pip install dakera[tealtiger] tealtiger
import asyncio
from dakera.async_client import AsyncDakeraClient
from dakera.integrations.tealtiger import (
    DakeraCostStorage,
    DakeraDecisionStore,
    DakeraDelegationHelper,
)

client = AsyncDakeraClient("http://localhost:3000", api_key="dk-mykey")

# Drop-in async CostStorage backend — passes directly to TealTiger client
cost_storage = DakeraCostStorage(client)

from tealtiger import TealOpenAI, TealOpenAIConfig
teal_client = TealOpenAI(config=TealOpenAIConfig(cost_storage=cost_storage))

# Governance decision audit trail with idempotency checks (all methods are async)
decision_store = DakeraDecisionStore(client)
# receipt_id = await decision_store.store_receipt("my-agent", decision)
# is_duplicate = await decision_store.is_terminal("my-agent", correlation_id)

# Multi-hop delegation chain traversal via memory knowledge graph
delegation = DakeraDelegationHelper(client)
await delegation.link_delegation(child_id=child_mem_id, parent_id=parent_mem_id, agent_id="my-agent")
chain = await delegation.get_delegation_chain("my-agent", root_id, max_depth=5)

All cost records, decision receipts, and delegation chains are stored in Dakera memory with importance-weighted retention (DENY receipts at 0.95 outlast ALLOW at 0.80) and full knowledge-graph traversal for audit purposes.

See examples/tealtiger_governance.py for a complete walkthrough. Join the integration discussion or visit the TealTiger repo.


Examples

See the examples/ directory:


Resources

Documentation Full API reference and guides
Python SDK docs Python-specific reference
Benchmark LoCoMo evaluation results
dakera.ai Website and early access
GitHub Org All public repos
dakera-deploy Self-hosting guide

Other SDKs

SDK Package
dakera-js @dakera-ai/dakera (npm)
dakera-rs dakera-client (crates.io)
dakera-go github.com/dakera-ai/dakera-go
dakera-cli CLI tool
dakera-mcp MCP server for Claude/Cursor

dakera.ai · Docs · Benchmark · Request Early Access

Built with Rust. Single binary. Zero external dependencies.

Metadata

Release files for dakera 0.13.2

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

Source distribution (sdist)

Source distribution for dakera 0.13.2
File Size Uploaded
dakera-0.13.2.tar.gz 188.6 kB Details

Built distribution (wheel)

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

Total release size: 307.3 kB

Release files / dakera-0.13.2.tar.gz

Download URL dakera-0.13.2.tar.gz
Size 188.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4c3ac255649655480979018fa5adc3054b6cb3a38030436be9c8a50ebe431ac0
BLAKE2b-256 checksum
How to use checksums
7fac81ac6628d0b783b11ac65aa666d1c154d95816b5716c32fdab26ccd9977e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / dakera-0.13.2-py3-none-any.whl

Download URL dakera-0.13.2-py3-none-any.whl
Size 118.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af6097c7647fa94ec9cf48596aa030de4acb599cdad65777707d366d9288f7cc
BLAKE2b-256 checksum
How to use checksums
8156158f33f2e2b26cf84b0be2b3108349716085430652f0f0f9d56e50a5ed7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.13.2 This release

2 release files

0.12.8

2 release files

0.12.7

2 release files

0.12.6

2 release files

0.12.5

2 release files

0.12.4

2 release files

0.12.3

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.4

2 release files

0.11.3

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.10.0

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.6

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

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