AI | Enterprise software Managed Custom AI Agents AI Company

Human in the loop AI agents: a frontend rebuild

A dedicated AI engineer rebuilt an AI startup's frontend as a design system and hardened its human-in-the-loop AI agents to keep running past failed steps.

Geography
San Francisco, US
Year
2026
Stage
1 to 10 employees
Team
1 embedded senior engineer
Duration
January to May 2026

The situation

The client is an AI company (kept anonymous at its request) that builds custom, human-in-the-loop AI agents and workflows for enterprise clients, not a self-serve automation tool, but a full-service platform: an engineer sits with each client, maps their process, and assembles a workflow from a library of reusable steps. Its customers mostly come from non-technical industries, healthcare, sales, warehousing, where a general-purpose automation builder (the kind of tool a technical team could self-serve with) doesn't fit; the client's own bet is that most of that market wants the automation delivered as a service, not as another tool to configure. 

Two representative workflows illustrate the shape of the work: a healthcare pipeline that takes a disease, a candidate treatment, and a few references, then researches where that treatment is used, what outcomes are reported, and what the literature says, and a separate step that transcribes patient video/audio testimonials and pulls quantitative and qualitative insights out of them. A third, unrelated workflow analyzes how a target keyword is used across a given webpage. 

Based in San Francisco with a small, senior team, the company needed a dedicated AI engineer who could work inside its own codebase rather than bolt features onto the outside of it. Two problems needed solving at once. The frontend had grown ahead of the design system behind it, so every new screen took longer to build than it should have. At the same time, the company's core product, an agentic workflow engine that runs both human-in-the-loop and fully autonomous agents, needed engineering attention to hold up as more workflows ran through it. The company wanted one engineer who could move between the two without months of ramp-up. 

What we built

Leanware embedded one senior engineer directly with the company from January through May 2026, working as an extension of the existing team rather than as an outside contractor, the kind of engagement ourDedicated AI Engineering Teams are built for. On the frontend, the engineer re-architected the interface layer into a scalable design system: shared, reusable components the team now assembles new screens from instead of rebuilding one from scratch every time a UI need comes up.

The stack here is Next.js with React on the frontend and Next.js Server Actions on the backend, with Vercel and Supabase for local development and AWS in production. The same reusability principle runs through the product itself, individual workflow steps (transcription, keyword extraction, a given research pattern) are built once and specialized, then reused across client workflows instead of being rebuilt per client. That's the kind of gain a dedicated AI engineering team is meant to deliver: senior capacity that ships inside your codebase and leaves the underlying architecture better than it found it.

On the product side, the engineer contributed directly to the company's core agentic workflow engine, the system running both human in the loop and fully autonomous agents, built on foundation models, Google Gemini, OpenAI, and Anthropic, through prompt engineering rather than in-house model training. Workflows are structured in three tiers, a top-level workflow broken into steps, each of which can contain its own sub-steps and some steps require human input to choose between outcomes before the workflow can continue. 

The work centered on the durability and resilience of those workflows: keeping a multi-step agent process moving correctly when a step fails, routing to a human reviewer when one is needed, and resuming a workflow cleanly after an interruption. Part of that resilience work tracked a broader platform migration already underway, moving the underlying workflow orchestration off Mastra AI and onto Vercel Workflow to get native support for pausing, resuming, and scheduling steps, the same category of tooling as providers like Ingest, used elsewhere in similar workflow engines. The engineer came up to speed with minimal onboarding overhead, contributing code quickly and bringing a clear technical point of view that meant the client did not have to hand-hold day to day decisions. Communication ran through virtual meetings, email, and messaging apps for the length of the engagement. 

Outcome

By the end of the engagement, both the frontend and the agent workflow engine were in a materially better place. Frontend development is faster now that new UI work draws from a shared component library instead of starting over each time, and the company's human-in-the-loop AI agents run with more resilience and durability than before, a direct result of the work on the underlying agent workflow engine.

That same modularity is what lets the company onboard a new client's workflow in a few days instead of a few weeks, reusing existing steps and agents instead of building each client's workflow from zero. The engagement closed on schedule. For an AI company built around shipping fast for its own customers, the practical outcome was a dedicated AI engineer who could move between frontend architecture and core agent infrastructure without losing pace in either. 

"Leanware's teammate was experienced, had a point of view, and didn't need hand-holding."

— Confidential , CEO , AI Company · San Francisco, California

Engagement FAQ

What does a dedicated AI engineer actually work on inside an existing AI product?

In this engagement, one embedded Leanware engineer split time between rebuilding the frontend into a reusable design system and contributing to the client's core agentic workflow engine. A dedicated engineer works inside the client's own codebase and tooling, so scope can span frontend and backend AI work depending on what the team needs that sprint.

How do you make human-in-the-loop AI agent workflows more resilient?

Resilience in an agent workflow engine mostly comes down to the failure paths: retrying or resuming a step that breaks, routing to a human reviewer when the agent should not decide alone, and preserving state so a multi-step process picks up where it left off instead of restarting. That was the focus of the workflow engine work in this engagement, alongside a move to a workflow orchestration layer (Vercel Workflow) built to handle exactly those failure paths.

How long does it take an outside engineer to onboard to an existing AI codebase?

It varies with codebase complexity, but a senior engineer with AI fluency as a baseline should be contributing real code within the first few weeks, not months. In this case, the client specifically credited the engineer with contributing code quickly after onboarding and not needing hand-holding.

What is a scalable frontend design system and why does it matter for an AI product?

A scalable design system is a shared library of reusable components and patterns that new screens are assembled from, rather than built from scratch each time. For an AI product shipping new interfaces frequently, it is the difference between steadily increasing frontend velocity and every release taking longer than the last.

When do AI agent workflows need a human in the loop?

Typically at the steps where a wrong autonomous call is costly or hard to reverse, approvals, edge cases the model wasn't trained on, or anything with legal or financial weight. The rest of the workflow can run autonomously. In this engagement, that meant building the routing logic so a workflow hands off to a human reviewer at the right step, then resumes cleanly once the human has weighed in, instead of restarting the process from scratch.

What does the AI stack behind a service like this actually look like?

In this case, a Next.js/React frontend and Next.js Server Actions backend, with Vercel and Supabase for local development and AWS in production. On the AI side, the team builds on foundation models, Google Gemini, OpenAI, and Anthropic, through prompt engineering rather than training its own models, and runs the workflows themselves through a dedicated orchestration layer (migrated from Mastra AI to Vercel Workflow) that handles pausing, resuming, and scheduling steps.

Related cases

Frontend launches every 2 to 3 weeks, up from a small fraction of that pre-engagement

Groundlight

A computer vision case study in retention: three years embedded with Groundlight until its acquisition, frontend launches every two to three weeks, and a 5.0 Clutch review across every category.

Dedicated AI Engineering Teams Read case study
Multi-provider AI evaluation backend in production across OpenRouter, OpenAI, Google, and Anthropic

University of Colorado

Custom AI grading software built with the University of Colorado. A multi-model AI agent grades dental crown preps against configurable rubrics, in production and scaling to more dental schools.

Managed Custom AI Agents Read case study
READY?

Stop managing operations. Let the system run them.

Show us the workflow that's eating your week. We will map it, show you what AI can automate, and tell you what we will run for you.

Tell us what you are trying to solve. We will map your workflows and show you exactly what AI can automate, and what we will run for you.