Building and Scaling Production AI Agents with Effect-TS
AI Engineergo watch the original →
the gist
OpenGov scaled their 'OG Assist' agent platform by moving from LangGraph to a custom, effect-native agent loop, leveraging Effect-TS for structured concurrency, observability, and type-safe tool definitions.
Architecture and the Move to Effect-TS
OpenGov transitioned their agent orchestration from LangGraph to a custom, effect-native loop to gain full control over execution and observability. By utilizing the Effect-TS library, the team achieved native support for structured concurrency, logging, and tracing. This architecture allows for dependency injection, enabling the team to hot-swap language models without altering the core agent logic. The system uses a rigorous agent-to-agent (A2A) protocol to define contracts between front-end and back-end services, ensuring consistent agent behavior and metadata handling across the platform.
Safety, Context, and Observability
To manage production risks, the team implemented a deterministic human-in-the-loop mechanism that interrupts the agent loop whenever a tool call requires explicit approval. For code execution and file generation, the system spins up ephemeral, isolated sandboxes that are torn down immediately after task completion. To handle long-context conversations, the team moved away from naive message stuffing in favor of a rolling summarization strategy. This approach maintains a concise summary of the conversation history while allowing the agent to perform recall over the summarized context as needed. Observability is handled through Effect-TS, which provides automated tracing and span generation, allowing engineers to profile function calls and cross-reference failures across services.
Tooling and Developer Velocity
OpenGov treats tools and skills as the primary building blocks of their agentic system. Tools are defined as modular units and grouped into toolkits, which are then registered with the language model. This modularity allows the agent to dynamically select and execute specific capabilities based on user intent. Internally, the engineering team accelerates their own development workflows by utilizing Claude and Cursor to assist with reading, writing, and reviewing code, effectively using the same agentic principles internally that they ship to their customers.