ClawGraph

Local-first, embedded graph memory for AI agents

PyPI Tests Python 3.10+ License

Natural Language In

Tell it facts in plain English. ClawGraph turns them into structured graph memory automatically.

Local-First Storage

Stored in an embedded Kuzu database. No servers, no Docker, just a local file.

Automatic Ontology

The LLM infers and maintains your graph schema as you add facts.

Inspectable

Query the graph directly, export JSON, and inspect how memory is actually being stored.

Python API

Drop into any agentic loop with from clawgraph import Memory.

Focused Today, Broader Later

Today: OpenAI-compatible APIs and Kuzu. Future: broader LLM providers and additional database backends.

Project Framing

ClawGraph is aimed at one specific lane: a small, Python-first memory layer for agents that want structured recall without running separate infrastructure.

Instead of trying to be a full memory platform, it focuses on being local, inspectable, and easy to drop into agent workflows.

Install

pip install clawgraph

CLI Usage

# Store facts
clawgraph add "John works at Acme Corp as a software engineer"
clawgraph add "Alice is a data scientist at Google"

# Query the graph
clawgraph query "Where does John work?"

# Batch add (one LLM call for multiple facts)
clawgraph add-batch "Bob is a designer" "Bob works at Netflix"

# JSON output for agents
clawgraph query "Who works at Acme?" --output json

# Recommended model
clawgraph config llm.model gpt-5.4-mini

Python API

from clawgraph import Memory

with Memory() as mem:
    mem.add("John works at Acme Corp")
    mem.add("Alice is a data scientist at Google")
    results = mem.query("Who works at Acme?")

Current Defaults

llm:
  model: gpt-5.4-mini
  temperature: 0.0

db:
  path: ~/.clawgraph/data

Recommended today: gpt-5.4-mini for fast agent loops. Higher-end models can be used for more ambiguous extraction workloads.