Docs menu · Python SDK

The SDK carries the same self-describing surface as the binary, so an agent working in Python never has to shell out to learn what Strata can do. Everything here is bundled in the wheel — no network call.

The offline guide

stratadb.agents_guide() returns the complete usage guide as markdown — identical to strata agents guide, matched to the wheel’s engine version. Hand it to an agent at the start of a session:

import stratadb

print(stratadb.agents_guide())   # the full guide, offline

See the agents guide for the CLI and MCP forms of the same artifact.

The command catalog

stratadb.command_index() returns the full machine-readable command catalog — every command with its access class, batching and commit behavior, and error codes — bundled in the wheel:

idx = stratadb.command_index()   # the IDL catalog, as a dict

This is the same catalog behind the command reference and strata agents commands --json.

MCP client config

stratadb.mcp_config(path) returns the client-config snippet for pointing an MCP client at a database:

stratadb.mcp_config("./app-data")
# {"command": "strata", "args": ["./app-data", "mcp", "serve"]}

Drop it into your MCP client’s mcpServers map — see the MCP server.

The escape hatch

The typed namespaces cover the common path; for anything else in the catalog, db.execute() runs a raw command as a dict and returns the response dict — the same wire the CLI and MCP speak. The namespaces are built on it:

db.execute({"type": "kv_scan", "limit": 10})

Reach for db.execute() when a command has no curated wrapper yet; reach for the namespaces for everything else.

agents: this page as markdown → /docs/python/agents.md