Make your own event-sourced agent harness using stream processors
summary
An event-sourced agent harness where every streaming chunk tool call error and circuit-breaker trigger becomes an event, with a clear split of state, reducer, after-append hook so reducers run synchronously to catch up without replaying LLM requests and side effects occur in after-append. Deployment works by appending a dynamic worker configured event whose payload is JavaScript that turns any stream into an agent (runs as a Cloudflare dynamic worker), supports SSE curl demos, stream pausing, and 200ms safety-injection windows.
AI-written summary · about
chapters (18)
- 0:00Start
- 0:14Introduction and workshop overview
- 1:33Concept of event-sourced agent harnesses
- 2:24Desired characteristics: Extensibility and composability
- 3:14Agents on the edge and public routability
- 4:20The distributed nature of agents and potential pitfalls
- 5:40Introduction to the event stream architecture
- 8:38Working with the API via curl
- 10:48Handling events and error states
- 11:57Circuit breakers and stream management
- 13:49Scheduling tasks and event subscriptions
- 15:17Q&A: Architectural philosophy
- 19:17Demonstrating the SDK and TypeScript integration
- 30:06Defining stream processors and reducers
- 47:34How stream processors function in production
- 50:35Dynamic workers and deploying via event payloads
- 58:45Discussion on before-hooks versus eventual consistency
- 1:02:16Future outlook and wrapping up
related talks
31mBelieve in Streams
01h 04mState or Events? Which Shall I Keep?
38mEvery Event, Everywhere, All at Once
43mStructure and Interpretation of Stream Processing
26mEvent-Sourcing your React-Flux applications
49mAgents at the Application Layer
47mPatterns for Building Event-driven Web & Mobile App Backends
46mShifting Gears: From Events to Event-Driven
