Skip to main content

Zero-config database for AI agents.

Project description

clawdb (Python SDK)

The official Python client for ClawDB.

This package is a network client, not the database engine itself. It connects to a running clawdb-server instance locally or to a hosted cloud endpoint.

pip install clawdb

Before using the SDK locally, make sure clawdb-server is running. The intended local-first path is:

npx @clawdb/cli@latest init

If you operate your own server, set CLAWDB_ENDPOINT to that address instead.

Sync usage

from clawdb import ClawDB

db = ClawDB(endpoint="http://localhost:50050", agent_id="my-agent")

# Store a memory
id = db.memory.remember("Deploy at 3 PM UTC", memory_type="task", tags=["ops"])

# Search
results = db.memory.search("deploy schedule", top_k=5)
for r in results:
    print(f"{r.score:.3f}  {r.memory.content}")

# Recall by ID
memories = db.memory.recall([id])

# Forget
db.memory.forget(id)

Async usage

import asyncio
from clawdb.aio import AsyncClawDB

async def main():
    async with AsyncClawDB(endpoint="http://localhost:50050") as db:
        id = await db.memory.remember("Async test")
        results = await db.memory.search("test")

asyncio.run(main())

Branches

branch = db.branches.fork("my-experiment")
db.memory.remember("hypothesis", tags=["experiment"])  # writes to current branch
db.branches.merge("my-experiment", into="trunk")

LangChain integration

from clawdb.langchain import ClawDBRetriever
retriever = ClawDBRetriever(db=db, top_k=10)
docs = retriever.get_relevant_documents("deploy schedule")

Configuration

Env var Description
CLAWDB_ENDPOINT gRPC endpoint (default http://localhost:50050)
CLAWDB_API_KEY API key (ck_live_... or ck_test_...)
CLAWDB_AGENT_ID Agent identifier

Runtime model

  • Python talks to clawdb-server over gRPC.
  • clawdb-server hosts the Rust runtime and storage engine.
  • For cloud usage, point CLAWDB_ENDPOINT at your hosted deployment and provide CLAWDB_API_KEY.

Development

pip install -e ".[dev]"
pytest

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

clawdb-0.1.2.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

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

clawdb-0.1.2-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file clawdb-0.1.2.tar.gz.

File metadata

  • Download URL: clawdb-0.1.2.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for clawdb-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4b3714aa013c1e6f060a366d8590b9d050295752dedac8195bdd01a56264a93a
MD5 6f545d785d0f2ab8ae68a960df9744b2
BLAKE2b-256 f963387d8beea60295c82dca8882857a3accb493387e1c76c5a54dbc7ac2607c

See more details on using hashes here.

File details

Details for the file clawdb-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: clawdb-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for clawdb-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ed28d69d68ca821eed30f4c21d59f300645935c00e9a1a65afb4b6a81f7fb1a7
MD5 b74e6232317f9ee425167e2e27c224e3
BLAKE2b-256 88d250ae2e98d9e18d2da5a68a9f61576b8e03f3d93684cef217fe039154908c

See more details on using hashes here.

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