Gabe de Mesa from OpenGov details how they developed and scaled OG Assist, an AI-powered assistant integrated across their ERP products, using a custom agent loop built on the Effect library and adopting the agent-to-agent protocol for seamless communication and control. The system emphasizes safety, continuous improvement, and observability through features like human-in-the-loop approvals, rolling summarization, and modular tools, while also leveraging AI internally to enhance developer productivity.
Gabe de Mesa, a software engineer at OpenGov, presents an in-depth overview of how OpenGov built and scaled their AI-powered assistant, OG Assist. He begins by introducing OpenGov as a company focused on providing ERP software to enhance government accountability and efficiency. OG Assist is integrated across OpenGov’s product suites, enabling users to interact with AI agents through a chat interface that can perform tool calls and take actions based on the context of the product in use, such as utility billing. This integration allows for a seamless and interactive user experience powered by AI agents.
The development of OG Assist involved a strategic shift from using LangGraph to building a custom agent loop based on the open-source TypeScript library Effect. Effect provides robust features like schema validation, error handling, logging, and tracing, which have been instrumental in structuring the agent loop and improving code quality. This custom loop offers OpenGov full control and flexibility to handle complex use cases and scale their AI agents effectively. Additionally, OpenGov adopted the agent-to-agent (A2A) protocol, an open standard created by Google, to facilitate communication between agents and ensure alignment between front-end and back-end systems.
OpenGov emphasizes continuous improvement through feedback and evaluation mechanisms. They collect user feedback via a thumbs-up/thumbs-down system and run automated evaluations in their CI pipeline to test prompt accuracy and tool usage. A notable safety feature is the human-in-the-loop system, which requires human approval for certain tool calls, especially those that could mutate data, ensuring trust and safety. Furthermore, sandboxing allows agents to execute code and create files in isolated environments, mitigating risks to production systems while enabling powerful functionalities like generating downloadable PDFs.
To address challenges with long conversational contexts and token limits, OG Assist employs rolling summarization techniques that maintain a running summary of conversations. This approach allows the agent to recall relevant information from earlier in the dialogue without overwhelming the model with excessive context. The system also supports generative UI elements, enabling the agent to dynamically create interactive forms and options during conversations, enhancing user engagement and personalization. Observability is another key focus, with Effect providing built-in tracing and profiling tools that help developers monitor performance, identify bottlenecks, and debug complex agent interactions across services.
Finally, OpenGov’s investment in tools and skills development has been crucial to their success. They build modular tools and skill sets that agents can leverage to perform specific tasks, exemplified by simple tools like a “get dad joke” function. Internally, OpenGov uses AI agents powered by models like Claude and Cursor to accelerate development workflows, including code reading, writing, and review. This dual use of AI—both customer-facing and internal—has significantly boosted developer velocity and productivity. Gabe concludes by encouraging others to build and ship AI agents to production, highlighting the practical lessons and technologies that have driven OpenGov’s achievements.