Home / Use cases / One agent across Python, TS, and Go
Polyglot teamsOne agent across Python, TS, and Go
Ship the same agent behaviour to Python, TypeScript, and Go teams — one Zig core, thin idiomatic bindings, portable sessions.
The problem
Teams that span multiple languages often re-implement agent logic per language, or standardise on one runtime and force everyone through it. Behaviour drifts between implementations, and a fix in one has to be ported to the others by hand.
How tokenworm handles it
- ▸Every tokenworm SDK is a thin binding over the same Zig-compiled shared library, so the agent loop, tools, providers, and sandbox are identical across languages.
- ▸Python gets an async iterator over chunks, TypeScript a for-await stream, Go a cgo-linked native runtime — each idiomatic to its language.
- ▸A session exported from the Python SDK resumes in the Go SDK or the CLI: the .tworm format is the portable contract.
- ▸A bug fixed in the Zig core is fixed for every SDK at once — no per-language re-implementation.
# Python pip install tokenworm # TypeScript npm install tokenworm # Go go get github.com/tokenworm/tokenworm-go # All three drive the same libtokenworm core
- ·The C ABI is the single boundary all three SDKs share.
- ·Sessions are portable across SDKs and the CLI via the .tworm format.
Questions
+ Do the SDKs behave the same across languages?
Yes. The agent loop, tool dispatch, provider implementations, and sandbox all live in the native binary. Each SDK is a thin idiomatic binding, so behaviour is shared rather than re-implemented.
+ Can a session move between SDKs?
Yes. The .tworm binary session format is portable — export it from one SDK or the CLI and resume it in another. Per the README it is 5x smaller and 20x faster to parse than JSONL.