Building a Production-Ready Multi-Agent Coding Assistant

replit · Tech · 2023 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Production multi-agent coding assistant

Replit needed a coding agent that could build applications from user prompts while limiting long-trajectory agent failures, exposing many developer tools safely, validating progress, debugging production traces, and balancing accuracy, cost, and latency.

Constraints:

Architecture

Replit Agent evolved from a basic ReAct loop into a scoped multi-agent team with a manager, editors, and a verifier. Each sub-agent sees the minimum tool/instruction scope needed. Tools are invoked through generated Python DSL code parsed on Replit's backend rather than raw function-calling APIs. The verifier can inspect the app, run checks, take screenshots, and ask the user when progress stalls. LangSmith traces store full per-step state so production bugs can be pinpointed and replayed. Claude 3.5 Sonnet handles most code generation/editing, with smaller model calls for compression/watchdog work.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  user[User] --> replit-agent[Replit Agent]
  replit-agent --> manager-agent[Manager Agent]
  manager-agent --> editor-agents[Editor Agents]
  manager-agent --> verifier-agent[Verifier Agent]
  verifier-agent --> human-input-tool[Human Input Tool]
  human-input-tool --> user
  manager-agent --> tool-panel[Tool Panel]
  editor-agents --> python-dsl-tool-calls[Python DSL Tool Calls]
  python-dsl-tool-calls --> backend-parser[Backend Parser]
  backend-parser --> reflection-recovery[Reflection Recovery]
  reflection-recovery --> manager-agent
  claude-sonnet[Claude Sonnet] --> replit-agent
  auxiliary-models[Auxiliary Models] --> replit-agent
  replit-agent --> langsmith-observability[LangSmith Observability]
  langsmith-observability --> trace-replay[Trace Replay]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
User Builder who describes an app, gives feedback, and can be asked for clarification when progress stalls. Replit Agent, Human Input Tool
Replit Agent Product-level coding assistant that orchestrates planning, editing, verification, and user interaction. Manager Agent, User, LangSmith Observability
Manager Agent Coordinates the coding-agent workflow and hands work to editors and verifier. Editor Agents, Verifier Agent, Tool Panel
Editor Agents Sub-agents that perform code modifications and file/tool operations. Manager Agent, Tool Panel, Python DSL Tool Calls
Verifier Agent Sub-agent that checks app behavior, screenshots, static checks, console errors, and progress. Manager Agent, Human Input Tool, Tool Panel
Human Input Tool Tool path that asks the user for clarification or validation when automated progress stalls. Verifier Agent, User
Tool Panel Replit platform tools exposed to the agent, adapted from existing internal tooling. Manager Agent, Editor Agents, Verifier Agent
Python DSL Tool Calls Stripped-down Python code emitted by the model to represent tool invocations. Editor Agents, Backend Parser
Backend Parser Parses generated DSL, checks schema compliance, retries invalid tool invocations, and sends errors back. Python DSL Tool Calls, Reflection Recovery
Reflection Recovery Periodic progress check that asks the agent to reason whether recent steps made progress. Backend Parser, Manager Agent
Claude Sonnet Primary frontier model for code generation and code editing. Replit Agent
Auxiliary Models Long-tail model calls for compression, watchdog work, and embedding retrieval. Replit Agent
LangSmith Observability Tracing and replay layer used to inspect production behavior and reproduce bug states. Replit Agent, Trace Replay
Trace Replay Loads stored trace state into a new codebase to test whether fixes change agent behavior. LangSmith Observability

Data flow

A user prompts Replit Agent. The manager coordinates editor agents that modify code through exposed Replit tools, while the verifier checks application progress through screenshots, static checks, console errors, and app interaction. For tool calls, the model reasons in context and emits stripped-down Python DSL, the backend parses it, invalid calls are retried with error feedback, and periodic reflection asks whether the trajectory is making progress. Production traces record state at every agent step for debugging and replay.

4 supporting quotes
“occasions we also have a this multi-agent team that has a manager it has editors pretty much like in any software team in the real world and we also have a verifier that is allowed basically to go through the app and you know interact to it to a certain extent and yeah last but not list we basically”transcript, stated
“software team in the real world and we also have a verifier that is allowed basically to go through the app and you know interact to it to a certain extent and yeah last but not list we basically collect all the outputs from Tool and that like gives us a glimpse of what is”transcript, stated
“the Last Action that the model takes is actually generating a python DSL like this literally a strip down version of python”transcript, stated
“in the lmid tray at every single step of the agent you know we're basically storing the state like the entire state”transcript, stated

Why this architecture

Replit's architecture tries to keep users engaged while preventing a catchall agent from drowning in tools. The team added multi-agent scope isolation after a ReAct-only loop hit too many tool errors, used code-generated DSL because LLMs are strong at code and function-calling APIs were too limited for complex tools, and invested early in trace observability because debugging production agents without replayable state is excruciating.

4 supporting quotes
“easy the more you expose to a sub agent the more opportunities it has to make the wrong choice and did you did you start from this and you kind of okay so yeah what what was the what did you start with and how did you how did you arrive there we started with the”transcript, stated
“arrive there we started with the simplest possible architecture which is react um and the reason is I think everyone agrees that is the simplest and I would say the first step that everyone takes when building an agent and then we started to explore how to”transcript, stated
“possible we kept hitting walls until we took a complete the tour and we decided to invoke tools with code and the reason is llms are amazing at generating code I don't have to convince anyone about that so rather than going through the function calling we decided okay we give”transcript, stated
“you exactly the same War Stories if you don't have a way to observe how your system behaves you're basically just building a prototype the moment you go in production you're going to regret not having a way to poke into the into the system so the we needed exactly the same”transcript, stated

Models used: Claude 3.5 Sonnet · GPT-4 mini · fine-tuned embedding model

Scale

Alternatives considered (roads not taken)

Full autonomy with the user out of the loop

Rejected because: Replit wanted users centered because long autonomous trajectories can crash or miss the goal.

“between of the spectrum where we want the user to be at the center of the product we want you to be engaged we show you what the agent does we ask you questions we ask you for feedback and we found out that by building something more engaging we also probably address”transcript, stated
“of mistakes so if you trust them over a long trajectory eventually they're going to either crash or not accomplish the goal that they in mind and we try basically to recover that by asking the user often is this what you want shall we revert back shall we build something”transcript, stated

Single catchall agent

Rejected because: A generic prompt with all tools works only up to a point and hits a ceiling for coding-agent complexity.

“having a catchall agent with all the tools in scope and a very generic system prompt I think it's a recipe for disaster”transcript, stated
“the moment you need to build something as complicated as a coding agent uh you're going to hit the ceiling very quickly”transcript, stated

Provider function-calling APIs

Rejected because: They were elegant but limited and unreliable for Replit's complex tools.

“you guys do for that so we started from function calling like I pretty much every everyone does out there uh the function goaling apis either from open a on Tropic at this point are fairly elegant and easy to use the truth is they're also fairly limited and for”transcript, stated
“elegant and easy to use the truth is they're also fairly limited and for those of you who went through the Pains of making function cing more reliable I'm sure you have seen all these tricks where you should reorder the the way in”transcript, stated

Self-consistency over multiple LLM calls

Rejected because: It was too expensive and high-latency for their current production economics.

“you so we don't use any self-consistency although I would love to and and the reason is it's it's very expensive so if I if I was sitting on a llm provider um then I would be definitely burning more tokens um but the truth is we cannot trade off self-consistency so like the”transcript, stated
“them we traded off with higher latency and with the fact that you know in a react Loop you reason you take an action you see that come of the action and then if that com is not what expected you”transcript, stated

Patterns

multi-agent-orchestration (coding-agent)

Replit separates manager, editor, and verifier responsibilities so each sub-agent sees fewer tools and instructions.

“separate the scope make sure that agents every sub agent has the least possible amount of tools visible”transcript, stated
“we also have a this multi-agent team that has a manager it has editors”transcript, stated

human-in-the-loop-gate (product-control)

The verifier can ask the user when automated progress stalls, and the product keeps users engaged with questions and feedback.

“we show you what the agent does we ask you questions we ask you for feedback”transcript, stated
“as a last resort we go back to the user and ask you know given this eror that we're seeing”transcript, stated

tool-use-orchestration (developer-tools)

Replit exposes platform tools to agents and orchestrates them through a backend-parsed Python DSL.

“we have pretty much every tool that you use use on a daily basis as a as a developer uh we expose them to our agent”transcript, stated
“generating a python DSL like this literally a strip down version of python that we parse on our backand”transcript, stated

structured-output-contract (tool-interface)

The backend validates generated DSL against schema compliance before accepting a tool invocation.

“if it's compliant we know that that's a valid tool invocation and if it's not we keep retrying”transcript, stated
“we pass back yeah what happens so like most of the times even from that basic self debugging”transcript, stated

observability-tracing (agent-operations)

Replit records per-step state in LangSmith traces and replays traces to test bug fixes.

“I immediately uh brought up the requirement in the team that we need a way to observe the agent Behavior”transcript, stated
“we pull the trace we load it as a state and then like we canot replay it”transcript, stated

model-routing (model-portfolio)

Claude 3.5 Sonnet handles primary code generation/editing while smaller/other models handle compression, watchdog, and embedding tasks.

“right now we are mostly relying on cloud 3.5 sunet”transcript, stated
“we have a long tail of calls to for mini for compression or like for other Watch Dog Works”transcript, stated

Tradeoffs

Keep the user engaged

Chose ask questions, show work, request feedback over pure full autonomy.

Rationale: User engagement helps recover from agent mistakes over long trajectories.

“we want the user to be at the center of the product we want you to be engaged”transcript, stated
“we try basically to recover that by asking the user often is this what you want”transcript, stated

Generate tool calls as code

Chose Python DSL parsed by the backend over provider function-calling APIs.

Rationale: LLMs are strong at code generation, and schema-compliant DSL gave Replit more reliable tool calls.

“llms are amazing at generating code I don't have to convince anyone about that”transcript, stated
“if it's compliant we know that that's a valid tool invocation”transcript, stated

Prioritize accuracy over latency

Chose higher-accuracy frontier model behavior over faster but less accurate responses.

Rationale: Replit judged wrong results as more frustrating than slower ones, while expecting model costs to improve over time.

“accuracy by far um cost otherwise eventually we're going to go broke and latency last”transcript, stated
“I'm happy to trade latency in exchange of much higher accuracy”transcript, stated

Limit multi-agent complexity

Chose roughly three or four agents over larger swarms with more message passing.

Rationale: The current size remains debuggable; too many agents would make architecture behavior hard to understand.

“too much message passing between too many agents”transcript, stated
“if we had even more complexity and we make this warm even bigger we will kind of lose control”transcript, stated

Gotchas (what bit them)

Too many tools increased agent errors.

Root cause: A single broad tool scope creates too many opportunities for wrong choices.

Resolution: Replit introduced scoped sub-agents with minimal visible tools and instructions.

“the moment we had too many tools and we start to see too many errors”transcript, stated
“every sub agent has the least possible amount of tools visible”transcript, stated

Function calling was not reliable enough for complex developer tools.

Root cause: Some Replit tools have many arguments and settings, making standard function calling brittle.

Resolution: The model emits Python DSL code that the backend parses and validates.

“some other tools are fairly complicated have a lot of arguments a lot of different settings”transcript, stated
“it wasn't viable to just do function calling”transcript, stated

Production agent debugging is excruciating without trace replay.

Root cause: Long traces make it difficult to find where behavior diverged or failed.

Resolution: Replit stores full per-step state and replays trace states against patched codebases.

“rather than just literally like reading the entire trace and trying to figure out where things went wrong”transcript, stated
“we pinpoint at which Step the issue has happened and then we Replay that tras on a new code base”transcript, stated

Coding-agent evals were insufficient for the whole user experience.

Root cause: Benchmarks helped with the core ReAct loop but not the end-to-end Replit Agent product.

Resolution: Replit combined partial evals, verifier work, internal use, early-access framing, and user feedback.

“it definitely helped us to test the the core Loop of the agent”transcript, stated
“it doesn't really help to test end to end the entire experience of RIT agent”transcript, stated

Evaluation

Replit combines partial coding-agent evals, verifier-agent checks, static checks, screenshots, app interaction, reflection, internal use, early-access feedback, and production trace replay. They explicitly note that existing evals help the core ReAct loop but do not yet cover the full product experience.

Metrics: valid tool-call success rate · agent runs in production · static check results · console errors · progress after every few steps · trace replay behavior · user feedback · core-loop eval pass rate

3 supporting quotes
“taking screenshots or you know running static checks on the code executing and see if there are errors in the console”transcript, stated
“we ask the agent to reason if it actually made progress or not”transcript, stated
“we tried uh to use webench to an extent and it definitely helped us to test the the core Loop of the agent”transcript, stated

Outcomes

The talk reports hundreds of thousands of production runs, about 90% valid tool-call success for generated DSL, about 90% of needed tools already existing inside Replit, and a preferred multi-agent size of roughly three or four agents for debuggability.

3 supporting quotes
“we saw way more people than I ever expected building with it”transcript, stated
“we had hundreds of thousands of runs in production”transcript, stated
“this is the future how you build agents in production otherwise the debugging is excruciating”transcript, stated