Proactive Agents with Built-in AI Coding.
The scheduling, state management, and coordination layer for AI agent engines like Claude Code and Codex.
pip install zgent
architecture
Your Application
Zgent SDK
Channels (When)Context (State)Hooks (Control)
Claude CodeCodexFuture...
The race to the bottom.
Most frameworks compete on who can call LLMs better. Zgent takes a different approach.
Traditional
Re-implement agents
Reactive
Stateless
"Better LLM calls"
Zgent
Leverage existing engines
Proactive
State management
"Better orchestration"
Agents are the new containers.
Container World
Docker=Container Runtime
Kubernetes=Container Orchestrator
Agent World
Claude Code / Codex=Agent Runtime
Zgent=Agent Orchestrator
Built for orchestration.
Channel
When & how agents are triggered
CronChannelHttpChannelWebSocketChannel
Context
State management & conversation history
Session snapshotsToken trackingMessage history
Agent
Define agent behavior
System promptsTools, hooksModel selection
Dispatcher
Route messages to the right agent
Per-sessionShared routingCustom logic
Hook
Intercept & modify agent behavior
Pre/post tool useMessage filteringAudit logging
Tool
Extend agent capabilities
API callsDB queriesFile operations
See it in action.
hello-world.py
import asyncio from zgent import ( AgentDefinition, AgentEngine, Context, Dispatcher, DispatchResult, DispatchAction, ) from zgent.channel.memory import MemoryChannel async def main(): input_ch = MemoryChannel(name="input") output_ch = MemoryChannel(name="output") definition = AgentDefinition( system_prompt="You are helpful.", engine_type=AgentEngine.CLAUDE, ) ctx = Context( id="demo", receivers=[input_ch], senders=[output_ch], definitions=[definition], ) await ctx.serve() asyncio.run(main())
Where we're headed.
Phase 1: Foundation
CurrentPython SDK + Claude integration
Channel abstractions (Cron, HTTP, WS)
State management & Hooks
Docs & examples
Phase 2: Multi-Engine
NextCodex provider
TypeScript SDK
Plugin system
Phase 3: Production
FutureDistributed scheduling
Multi-agent coordination
Observability & tracing
Open source. Apache 2.0.
Built for developers who need real infrastructure, not another wrapper.
pip install zgent