fetch), and a handful of production features that most minimal agent loops skip.
What you get out of the box
Minimal example
This is the whole mental model: provider → tools → agent → run.agent.run() handles the back-and-forth until the model finishes.
How it compares
Most teams building agents today either:- Roll their own loop — fast to start, painful when you need undo, argument coercion, streaming, or multi-agent routing.
- Adopt a large framework — powerful, but heavy and opinionated.
When kenpachi is a good fit
- You’re building a chat product and need undo / edit / regenerate without duplicate API costs.
- Your agents call external APIs via tools and you want validation + rollback when things go wrong.
- You want specialist sub-agents (billing, support, research) behind a single front-door agent.
- You need streaming text in your UI without rewriting your agent loop.
Next steps
Install
Add kenpachi to your project and set up API keys.
Quickstart
Build your first tool-using agent in a few lines.
Streaming
Stream tokens to your UI as the model responds.
Handoffs
Route work to specialist agents automatically.