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, known fixes and a suggested next step.
  • 🎯 Exact fix matching. Save a fix with fixes=<failed span> and it's found the next time the same error appears, even from a different tool.
  • ⏳ Stale-fix detection. Fixes are stamped with your git commit and lockfile hashes, and flagged when your dependencies change.
  • 🔌 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")

bad = 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", fixes=bad)
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, fixes=span) Save a durable fix
search(query, **filters) Ranked full-text search
what_failed(run or workspace) Errors, known fixes, 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.2.0

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.2.0
File Size Uploaded Provenance Actions
rundb_ai-0.2.0.tar.gz 43.7 kB Without provenance Details for rundb_ai-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 79.9 kB

Release files / rundb_ai-0.2.0.tar.gz

Download URL rundb_ai-0.2.0.tar.gz
Size 43.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e2052ccd8e72750f94300be22871a2fb04e68e62ad18b8bba026dd22fa242c76
BLAKE2b-256 checksum
How to use checksums
6b2d3d98f3a3d3ca6d9253df4790d446a133484f96a5eb7f254e07b16fb3f333
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.2.0-py3-none-any.whl

Download URL rundb_ai-0.2.0-py3-none-any.whl
Size 36.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
225a5616f53553ed1219b08a4e444cde8327c1fa92b336e5b4af685a4d241609
BLAKE2b-256 checksum
How to use checksums
9280265c229c7888b968fdbcbe8fcf70fad585d35ecabd2c436d80a9c8c829c0
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.2.0

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