Embedded SDK
The embedded runner reads YAML manifests from disk, registers them in an in-process runtime, and runs them locally with no network hop. Use @agntz/sdk in TypeScript or agntz in Python. Both load the same agent YAML and expose the same resource shape with language-native option names.
Node 20+ for TypeScript. Python 3.11+ for Python. Universal clients that cannot read from the local filesystem should use the hosted client instead.
Basic usage
agntz(options)
Returns an initialized local client. Validation errors throw at startup, so misconfigured agents do not make it past process boot.
| TypeScript option | Python option | Description |
|---|---|---|
agents | agents | Path to a directory of .yaml files |
tools | tools | Local tool definitions |
resources | resources | Resource providers keyed by kind, such as memory |
store | store | Optional persistence |
defaultModel | model_provider | Python passes a concrete provider; TypeScript can default model config |
onEvent | N/A | TypeScript event hook for full local event stream |
Runtime API
Run an agent
Run with resource grants
Pass context when the run needs access to a resource such as memory. This is a namespace grant array, not the legacy contextIds scratchpad.
Agents that declare resources: also need matching providers at construction time:
See Context and resources, Resources schema, and Memory with memrez.
Stream or inspect
TypeScript local streaming includes token deltas and tool-loop events. Python local streaming currently emits start and complete snapshots; use the hosted Python client for full worker SSE streaming.
Runs and traces
Persistence
The same store backs sessions, runs, and traces. Python's SQLite store persists messages and trace spans in the same file.
Errors
The hosted clients expose structured HTTP error classes. Local embedded execution raises Python or TypeScript runtime errors directly.
Switching to hosted
When you're ready to graduate, swap constructors and keep the same resource shape:
agents.run, runs.list, and traces.get stay the same. Local tools must be promoted to HTTP or MCP servers when the runtime moves out of your process.