To solve a complex client requirement for an insurance quote, RUNNINGHILL embarked on a 6-month project, beginning with a 2-month deep-dive to build a foundational agentic workflow. Mastering the LangGraph SDK, our team successfully built a stateful, reliable proof-of-concept that is now being expanded for production. This initial phase, using a JSON-based “collection plan” and Redis for state management, proves our expertise in building robust, production-ready AI systems.
Our client needed an agentic workflow for insurance quotes, a task that is simple on the surface but complex in reality. Standard AI applications are “straight-line”—they take a prompt and return an output. They break on the first unexpected error.
A real-world quote process requires loops (“Did the API fail? Try again.”), self-correction (“The user’s ID number failed validation, I must ask for it again.”), and statefulness (remembering the user’s data across a 20-step conversation). Furthermore, we discovered that an “LLM-heavy” approach was inefficient and slow, as unique user data made caching useless. We needed to build an agent that was not just intelligent, but reliable.
We architected a sophisticated, stateful agent using LangGraph, a library designed to be a “state machine for AI”.
Instead of a “giant messy function,” the agent’s logic is a clean graph built from three key components:
Crucially, the entire workflow is driven by a flexible JSON “collection plan,” not hard-coded logic. This tells the agent what steps to take, allowing us to change the conversation (e.g., add a “vehicle details” step) just by updating a JSON file. This system is served via a single AWS Lambda, and the front end dynamically renders structured forms, calendars, and dropdowns based on the agent’s state, providing a user-friendly experience.
This was a dedicated, client-focused R&D initiative, with one of our developers, Dustin McDonald, working on the project for two months.
The process began with foundational upskilling in LangGraph, starting with “hello world” examples and progressing to complex conditional logic and loops. The most critical phase was the pivot away from an “LLM-heavy” solution. We re-architected the workflow to use LangGraph’s deterministic logic for data collection and state management, reserving the powerful (and expensive) LLM only for the tasks where it was truly needed. This 700-line workflow represents a mature, efficient, and production-ready architecture.
This project delivered a robust, client-ready POC and equipped our team with deep expertise in a cutting-edge AI framework.
“Well, thank you Dustin. That was really nice and showing us some skills as well… Thanks for the demo. We really appreciate it.”
– Henk Bothma, Head of IT
Bulleted Key Metrics:
This project is a perfect example of how we solve real-world business problems. Any company venturing into AI will quickly discover that a simple “chatbot” is not enough. You need reliable, stateful, and efficient applications. This R&D proves:
Established in 2013, Runninghill Software Development is among South Africa’s fastest-growing BBBEE Level 2 companies within the Information Technology Sector. With over 50 full-stack developers specialising in finance, banking, fintech, and more, we help companies design, build, and ship amazing products.
We are passionate software developers who deliver world-class solutions using the best tools in the industry. We focus on technical team augmentation, consulting, and agentic solution design, and we partner with the best design agencies so we can focus on what we do best: technical excellence.
Our services include:
1. What is LangGraph and why is it important?
LangGraph is a library for building stateful AI applications. Most simple AI apps are “straight-line” and break when an error occurs. LangGraph works like a “state machine,” allowing us to build complex, reliable workflows with loops, retries, and self-correction. This is essential for building production-ready agents that can handle real-world tasks.
2. Why did this solution use less AI (LLM) over time?
The team discovered that an “LLM-heavy” approach was inefficient, slow, and expensive for this workflow, as unique user data meant responses couldn’t be cached. We re-architected the solution to use the LLM intelligently (for tasks needing true AI) and used LangGraph’s deterministic state machine for the core logic. This is a more mature, cost-effective, and higher-performance architecture.
3. What is the “collection plan” and why is it a better approach?
The “collection plan” is a JSON file that defines the entire conversational flow for the agent. Instead of hard-coding the logic (e.g., “ask for ID, then ask for car”), the agent reads this JSON. This is a far more flexible approach, as the business can change the quote process (add, remove, or re-order steps) just by editing the file, with no new code required.
4. Can RUNNINGHILL build a stateful AI agent for my business?
Yes. This case study is a direct example of that capability. We have proven expertise in designing and building complex, stateful agentic workflows using frameworks like LangGraph. We can help you architect a reliable AI system—from state management (using tools like Redis) to the API—that can handle your specific, multi-step business processes.
5. How does this relate to your “Agents as a Service (AaaS)” capability?
This project is our Agents as a Service (AaaS) capability in action. Our service is to design, build, and deploy a “digital workforce” of autonomous AI agents that are custom-built for your company. This insurance agent is a prime example of how we create a sophisticated, autonomous system that integrates with your processes, is driven by your business logic (like the “collection plan”), and creates a reliable, user-friendly experience.
WRITTEN BY
Runninghill Software Development
Looking for some more adventure?
How about this next article.