Skip to main content

RunDB

The local-first database for AI agents. Every run, retry, fork, trace and lesson learned, in one SQLite file.

PyPI Downloads Monthly downloads Python CI License GitHub stars


Why RunDB?

Agents fail, retry and branch dozens of times per task, then the next agent starts from zero and makes the same mistake again.

RunDB gives agents a memory they can query:

  • 🗂 One file, zero setup. SQLite under the hood. Works offline. No server.
  • 🔁 Runs, retries and forks. Every attempt is kept and linked to the one it came from.
  • 🔎 Full-text search over every step, error and memory. Hits come back with run_id and span_id.
  • 🧠 Memories that outlive failed runs, so the fix is found next time.
  • 🩺 what_failed() returns recent errors plus a suggested next step.
  • 🔌 MCP server built in, so Claude Code, Cursor and other agents can use it with no glue code.
  • 📦 Zero dependencies. Pure Python standard library.

Install

pip install rundb-ai

This installs the rundb Python package and the rundb command. Python 3.10+.

Quickstart

from rundb import connect

db = connect("agent.db")  # created on first use
run = db.start_run("my-repo", goal="make tests pass")

db.log_span(run, "tool", "pytest",
            error="ModuleNotFoundError: No module named 'requests'")
print(db.what_failed(run)["suggested_next_step"])

retry = db.fork_run(run, goal="install deps first")
db.remember("my-repo", "tests.setup",
            "pip install -r requirements.txt before pytest",
            kind="constraint")
db.end_run(retry, "succeeded")

for hit in db.search("ModuleNotFoundError"):
    print(hit["source"], hit["run_id"], hit["snippet"])

Use it from your coding agent (MCP)

Claude Code

claude mcp add rundb -- rundb mcp

Cursor, Windsurf or any MCP client

{
  "mcpServers": {
    "rundb": { "command": "rundb", "args": ["mcp"] }
  }
}

Tools: start_run, log_span, end_run, fork_run, what_failed, remember, recall, search, list_runs, get_run, sql (read-only).

CLI

rundb init                  # create agent.db
rundb runs                  # recent runs
rundb tail -f               # follow the latest run live
rundb search "timeout"      # full-text search
rundb failed my-repo        # errors plus a suggested next step
rundb sql "select * from runs limit 5"

API at a glance

Call Does
connect(path) Open or create the database file
start_run(workspace, goal) Start a run
log_span(run, kind, name, ...) Record a step (tool, thought, ...)
end_run(run, status) Finish with succeeded, failed, ...
fork_run(run, goal) Retry on a linked branch
remember(workspace, key, value) Save a durable lesson
search(query, **filters) Ranked full-text search
what_failed(run or workspace) Errors plus a next step
sql(query, params) Plain SQL

Also available

  • TypeScript SDK: npm install rundb. It uses the same file format, so Python and Node agents can share one database.
  • Full docs, benchmarks and design notes: github.com/ashishjsharda/rundb

If RunDB saves your agent a retry loop, a ⭐ on GitHub helps others find it.


Apache-2.0 · Built by Ashish Sharda

Metadata

Release files for rundb-ai 0.1.1

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

Source distribution (sdist)

Source distribution for rundb-ai 0.1.1
File Size Uploaded Provenance Actions
rundb_ai-0.1.1.tar.gz 36.3 kB Without provenance Details for rundb_ai-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rundb-ai 0.1.1
File Interpreter ABI Platform Actions
rundb_ai-0.1.1-py3-none-any.whl Python 3 none any Details for rundb_ai-0.1.1-py3-none-any.whl

Total release size: 67.6 kB

Release files / rundb_ai-0.1.1.tar.gz

Download URL rundb_ai-0.1.1.tar.gz
Size 36.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e6895bfed0e0d2f5087b47f410c242cb43ab04109938df0fa247f12a2ad7c97b
BLAKE2b-256 checksum
How to use checksums
4dd8533c637ad6ce4cf5da55ee9654aea8d65941fb52add7a3bd9f2c58579ad8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.1

Release files / rundb_ai-0.1.1-py3-none-any.whl

Download URL rundb_ai-0.1.1-py3-none-any.whl
Size 31.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d99dc48eed3fee5dd806230fd34c0cf031c006505ede137850a803b28cd918f
BLAKE2b-256 checksum
How to use checksums
8685dcd9dd775a20dc93aa17bcb53b5d753510fdab0f1d3ae013e5751f5cd638
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.1

Security for rundb-ai 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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