Make your own event-sourced agent harness using stream processors — Jonas Templestein, Iterate
Summary
Jonas and Misha from Iterate introduced an event-sourced agent harness, emphasizing debuggability, extensibility, composability, edge deployment, and distributed architecture. The core concept revolves around `events.iterate.com`, a service where every action is an event stored in a hierarchical path, similar to a file system. Users interact with this service via HTTP, primarily using `curl` for basic operations like appending events and streaming responses. The system tolerates various inputs, appending error events for invalid data, and supports features like idempotency keys, stream pausing/resuming, and event scheduling. A key innovation is the "dynamic worker configured" event, which allows users to deploy JavaScript code (stream processors) directly into a stream, enabling the stream itself to become an AI agent by reacting to events and performing side effects. The workshop faced technical difficulties in live coding the TypeScript client demo.
Key takeaway
For AI Engineers building flexible and debuggable agent systems, consider adopting an event-sourced architecture. This approach, exemplified by `events.iterate.com`, allows for highly composable agents where logic can be deployed dynamically via events, simplifying experimentation and distributed plugin integration. Your team can leverage this to build agents that are inherently auditable and extensible, reducing the complexity of managing side effects and state across distributed components.
Key insights
Event sourcing provides a debuggable, extensible, and composable architecture for AI agent harnesses.
Principles
- Everything is an event.
- Agents should be publicly routable.
- Prioritize eventual consistency over before hooks.
Method
Define agent state derived from events, use a reducer to update state synchronously, and an "after append" hook for side effects like LLM requests. Deploy processors as code embedded in events.
In practice
- Use `events.iterate.com` for event streaming.
- Deploy agent logic as dynamic worker events.
- Model all system actions, including errors, as events.
Topics
- Event Sourcing
- Agent Harness Architecture
- Stream Processors
- Distributed Agents
- Dynamic Workers
Best for: AI Engineer, Machine Learning Engineer, AI Architect
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by AI Engineer.