Abhijit MitraBook a call

Blog

Building autonomous agents: the gap between prototype and production

What it takes to ship an agent that a business can trust to run outreach — from tool-calling and memory to guardrails and evals.

A demo agent that answers a question on command is straightforward. An agent that a business lets run its outreach — research accounts, compose emails, send them, read replies, decide what to do next, and escalate only when necessary — is a different class of problem.

At TorqueX.ai we shipped one of the latter. Here is what we learned.

Tool-calling is the easy part

The first thing every agent tutorial shows is an LLM calling a function. That works. The hard part is designing the tool surface — what each tool does, how it reports success or failure, and how the agent recovers when a tool returns something it did not expect.

A tool that searches a CRM and returns “no results” is unhelpful if the agent then assumes the contact does not exist. The tool needs to distinguish “this contact is not in this system” from “the system is unreachable” from “the query was ambiguous”. Each case demands a different next action from the agent.

Memory is not a vector store

Persistence — remembering what happened across turns — gets conflated with retrieval. An agent that runs outreach over days needs to remember which accounts it already contacted, what it said, what it heard back, and what the plan was for the next step. That is application state, not a RAG pipeline.

We built a shared memory layer that stores structured events: contacted, replied, bounced, opted_out, meeting_booked. The agent reads its own history like a log and decides the next action from it. This also makes every action auditable and reversible — critical when a human needs to understand why an agent sent a particular message.

Guardrails are the product

The difference between a prototype and a production agent is not accuracy. It is the set of things the agent will not do.

  • An outreach agent does not send to a contact who opted out. That is not a nice-to-have; it is a legal requirement in most jurisdictions.
  • It does not send on weekends or after hours in the recipient’s timezone.
  • It does not rewrite an email that a human already approved — unless the rewrite is a minor correction, and the change is logged.
  • It does not escalate to a human more than once per account per day.

Every guardrail is a rule expressed in code, not a prompt. Prompts soften; rules compile. A guardrail written as a deterministic check before tool execution is verifiable in a unit test. A guardrail in a system prompt is a wish.

Evals that catch regressions

When an agent’s behaviour changes because the underlying model updated or a prompt was tweaked, you need to know before it touches a real contact. We built a suite of scenario evals:

  • A known contact history is replayed and the agent’s next action is compared against the expected one.
  • Edge cases — an ambiguous reply, a bounced address, a contact who left the company — are run through the full pipeline.
  • The eval suite runs on every deployment. If it fails, the deployment blocks.

This is the same discipline as integration testing in distributed systems: you test the boundaries, not the happy path.

The takeaway

An agent in production is a system, not a model call. The model is the variable part. The tools, the memory layer, the guardrails, and the evals are the fixed parts — and they are the ones that decide whether the agent is useful or dangerous.

Building the fixed parts well is engineering work, not prompt work. That is why we built TorqueX the way we did: agent orchestration as a platform concern, with the orchestration layer owning memory, guardrails, and evals, and the LLM as a swappable component within it.