Skip to content
All projects
AI Training2026

AI agents that answer customer reviews

Led end-to-end development of review-response agents on OpenAI and Claude, with tool integrations and memory for autonomous operation — and a prompt framework that cut model cost 18%.

Role
Senior Full Stack AI Engineer · Actual SEO Media
Stack
PythonNode.jsOpenAIClaudePrompt engineeringAgent workflows
  • 18% reduction in model cost with no loss of response quality
  • Tool integrations and memory for autonomous, multi-step operation
  • Prompt framework and workflow patterns adopted across the platform

The problem

Businesses collect reviews faster than anyone can answer them. A response has to acknowledge the specific complaint, match the brand's voice, avoid admitting liability, and go out while the review still matters. Done by hand it doesn't scale; done by a naive template it reads like a template, which is worse than silence.

The first version was a single prompt per review. It worked in a demo and failed in production for the reasons single prompts usually do — no memory of what had already been said to that customer, no access to the account context that made the response specific, and a cost curve that grew linearly with a review volume we wanted to grow deliberately.

Designing the agent

The move that mattered was treating this as an agent with tools rather than a generation call with a long prompt. The model decides what it needs; the platform decides what it's allowed to have.

Memory is scoped deliberately. An agent answering a review needs the history of that reviewer and that location, not the whole account:

# Scoped retrieval: the agent asks for context, it is never handed everything.
@tool
def prior_interactions(reviewer_id: str, location_id: str, limit: int = 5):
    """Past responses to this reviewer at this location, newest first.
 
    Scoped rather than global — an agent that can see every response for the
    whole account will confidently reference one that belongs to someone else.
    """
    return store.query(
        reviewer_id=reviewer_id,
        location_id=location_id,
        limit=limit,
    )

The prompt framework

Ad-hoc prompts drift. Every engineer phrases the same constraint differently, nobody can tell which version is live, and a regression is invisible until a customer finds it.

So prompts became versioned artefacts with a fixed structure — role, hard constraints, tools available, output contract — composed rather than copy-pasted. Three consequences worth naming:

  1. Constraints stopped being restated. The legal and brand-voice rules are written once and composed into every workflow, so they cannot drift apart.
  2. Changes became reviewable. A prompt edit shows up as a diff, with the evaluation results for that version attached.
  3. Cost became attributable. Token spend broken down per prompt component showed exactly which parts were expensive, which is what made the 18% reduction a measurement rather than a guess.

Reliability

The failure mode that matters here is not a crash — it's a fluent, confident, wrong response going out under a client's name. Structured output contracts and validation before send caught the mechanical cases. For the rest, responses were scored against a rubric that graded the specific things that go wrong: inventing a fact about the business, admitting fault, ignoring the actual complaint.

Outcome

Model cost fell 18% while response reliability improved — the two moved together rather than trading off, because most of the savings came from not sending context the model didn't need. The prompt framework and the workflow patterns around it were adopted as the platform default for AI features beyond review response.