Architecture
Kaizen Manas runs as one Python process. A gateway adapter receives a message, the agent loop calls the model and tools, and the reply goes back through the adapter.
Main parts
- Launcher and supervisor: launch.py and deploy_watch.py.
- Gateways: Telegram and Discord.
- Agent loop: prompt, model call, tool rounds.
- Tool registry: 61 tools in 13 groups.
- Safety: approval gate, shell guard, content guard, file protection, vault.
- Sandbox: a limited Python subprocess.
- Memory and skills.
- Router: small, medium and power tiers.
- Scheduler.
Shape
Gateways are thin. The agent loop does not know which chat app it is in. Safety checks sit in front of tools that can change things.
See data-flow.mmd for a picture and components.json for each module.
How a message moves
Drawing the diagram…
In this section
ConcurrencyOne message at a time per chat. Later messages wait in order.State and storageWhere the bot keeps files and what survives a restart.Life of a messageThe 13 steps from a chat message arriving to the reply going out.Components20 modules and what each one does.Settings reference45 settings: where each one lives, its default and what a wrong value does.
See also:ConcurrencyState and storage
Checked against the source at commit f4fd89f on 29 Oct 2026. Everything here is merged on the main branch; no release has been tagged yet. The source is private, so these pages are the public description.