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.1.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.1-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: clawdb-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 0bacc0460e6e2ae5671fe46478e308130c9c1c54ea5acc7e8cd3063751dcee44
MD5 9ab447d37c1645649024a449d49bd54a
BLAKE2b-256 4ca50dc1717ae021e124f8270565ebe09e9df5e679b09e92e0af87f0a68d6917

See more details on using hashes here.

File details

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

File metadata

  • Download URL: clawdb-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f0bf9384f0144b9d0225b0ba16db711d6840998fb4493a1f0b621f6964617c8
MD5 ae3f953da4deb0ee8a1dc67df6342ab6
BLAKE2b-256 6d4c044881223ba1735472e132204f4d80d417f51a7a354518b252878c8a186c

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