Part 1: The Problem

The following scenario is exaggerated, but typical.

A mid-sized software company introduces an AI assistant in its helpdesk. The setup is quick to build: a ticket comes in, a prompt is assembled with context from the knowledge base, the LLM writes a draft reply, and the agent reviews and sends it. The first weeks are a success. New hires work faster and the queue shrinks. This matches the research: in a large field study with more than 5,000 support agents, workers with AI assistance resolved 14% more issues per hour on average, and novices 34% more.

A few months later the mood shifts. The assistant keeps making the same mistakes:

  • Bank chargebacks end up in the regular refund queue.
  • The tone with angry customers is off, and every reply gets rewritten.
  • After a pricing change, it quotes the old terms for weeks.

Agents correct the same things every day, but the system never notices. Every correction is lost.

flowchart LR T["Ticket"] --> P["Prompt + context"] --> L["LLM: reply text"] --> A["Agent corrects"] --> K["Customer"] A -.->|"correction is lost"| X["🗑️"]

This is the core problem of many agentic systems. They automate an existing workflow, and that is where the design ends. The LLM is a text generator at the end of a pipeline, a thin wrapper. It never finds out whether its text was any good. Yet the most valuable knowledge in a helpdesk lives exactly in the corrections made by experienced agents.

Part 2: Finding the Solution

First question: Where would the system learn from?

Retraining the model is not an option for most teams: too expensive, too slow, too risky. A different route comes from an approach called Reflexion (Shinn et al., 2023). The model stays unchanged. After each attempt, a reflection step looks at the outcome and puts into words what went wrong. The next time, this “lesson” is added to the model’s context. Learning happens in the prompt, not in the weights.

Applied to the helpdesk: the evaluation signal is the agents’ corrections and the customers’ reactions. The reflection step derives a rule from them, for example “When the customer mentions a chargeback through their bank, treat it as a chargeback.” The rule is stored and supplied with matching tickets.

Second question: What exactly was wrong?

The first attempt fails on something mundane. The system compares the draft with what the agent actually sent and sees only that the text was changed. Was the category wrong? The cited policy? Just the tone? A block of text cannot answer that. The reflection step guesses, and a guessed lesson does more harm than good.

This leads to the design decision that carries everything else: the LLM’s output becomes structured. Instead of a reply text, it returns an object with separate parts, and the agent can confirm or correct each part individually.

erDiagram OUTPUT ||--o{ FEEDBACK : "is rated by" FEEDBACK }o--o{ LESSON : "justifies" OUTPUT }o--o{ LESSON : "applies" OUTPUT { string category float confidence string evidence string reply_draft string applied_lessons } FEEDBACK { string field string verdict string corrected_to bool reopened } LESSON { string rule string scope string status string evidence_tickets }

Now it is clear: the category was wrong, and the draft was only adjusted stylistically. And applied_lessons makes it possible to measure later whether a lesson actually helps.

Structure has a cost. Strict format constraints can lower answer quality when the model has to weigh complex tradeoffs. So the model reasons first and fills in the fields afterwards. The lessons themselves stay short, readable sentences. Structure belongs at the interfaces, not in every detail.

Third question: Who decides what is right?

The obvious idea is to let a second LLM do the grading. The research here is sobering: LLM self-correction works reliably when there is dependable external feedback, and there is little solid evidence that it works without it. Reflexion’s own successes relied on clear signals such as unit tests.

For the helpdesk this means: at first, humans grade, as a by-product of their normal work and without extra effort. Hard outcome signals come on top: Was the ticket reopened? Did the customer ask a follow-up question? AI grading comes later, and only where criteria are checkable, for example whether a reply contradicts the current policy.

Fourth question: What if the system learns the wrong thing?

A memory that accepts lessons unchecked is dangerous. Wrong entries get repeated and reinforce themselves. There is also a security problem: in a helpdesk, the customer writes the input. Studies show that agent memories can be manipulated through cleverly worded queries alone.

The answer is a lifecycle with checkpoints, as with any other production artifact:

stateDiagram-v2 [*] --> Proposed: reflection derives rule Proposed --> Verified: several evidence tickets, regression test Proposed --> Rejected Verified --> Trial: team lead approves Trial --> Active: measurably better Trial --> Rejected: no effect Active --> Archived: outdated

Part 3: The Solution

The architecture

Put the answers together and the wrapper becomes a closed loop:

flowchart LR T["Ticket"] --> A["LLM: structured proposal"] A --> H["Agent confirms or corrects per field"] H --> K["Customer"] H --> F["Feedback"] K -->|"reopen, follow-up"| F F --> R["Reflection: propose rule"] R --> G{"Check + approval"} G --> M[("Lessons")] M -->|"matching rules in context"| A

At runtime, two paths run separately: the fast path that answers the ticket, and the slow path that learns after the ticket is closed. Lessons are only ever written after the fact, never during a live conversation.

sequenceDiagram participant T as Ticket system participant O as Orchestrator participant M as Lesson store participant L as LLM participant A as Agent T->>O: new ticket O->>M: retrieve lessons (category, embedding) M-->>O: top-k active lessons O->>L: prompt + KB context + lessons L-->>O: structured proposal (JSON) O->>O: schema validation, policy check O->>A: proposal in UI A-->>O: field verdicts + sent reply Note over O,M: after ticket closure (async) O->>L: reflection on diff between proposal and outcome L-->>O: lesson candidate O->>M: store as "proposed"

The data structures

1. The proposal the LLM returns. The reasoning field comes first, so the model thinks before it commits to a category.

{
  "schema_version": "1.2",
  "ticket_id": "T-48213",
  "reasoning": "Customer mentions the bank reversed the payment; this is not a refund request.",
  "triage": {
    "category": "billing.chargeback",
    "confidence": 0.81,
    "escalate": false
  },
  "evidence": [
    { "source": "kb-1187", "claim": "Chargebacks are handled by the payments team" }
  ],
  "reply_draft": "Thanks for letting us know. We have forwarded the chargeback to ...",
  "applied_lessons": ["L-0231"],
  "meta": { "model": "model-x-2026-09", "prompt_version": "p-14" }
}

2. The feedback the agent gives. Captured per field in the UI, with one click per field instead of free-text comments.

{
  "ticket_id": "T-48213",
  "output_schema_version": "1.2",
  "field_feedback": [
    { "field": "triage.category", "verdict": "accepted" },
    { "field": "reply_draft", "verdict": "edited", "reason": "tone" }
  ],
  "outcome": { "reopened_within_7d": false, "follow_up_question": false }
}

3. The lesson the reflection step proposes. A single rule in WHEN–THEN form, with scope and evidence, so it can be reviewed, tested and withdrawn.

{
  "id": "L-0502",
  "status": "proposed",
  "scope": { "category": "billing.*" },
  "rule": "WHEN the customer says their bank reversed a payment THEN classify as billing.chargeback, not billing.refund_request.",
  "evidence_tickets": ["T-47110", "T-47833", "T-48021"],
  "created_from": "field_feedback:triage.category",
  "approved_by": null,
  "expires_after_days": 180
}

The reflection step itself is just another LLM call with a narrow job:

You are reviewing a closed support ticket.
Input: the structured proposal, the agent's field verdicts, the final reply, the outcome.
Task: If a field was corrected, write ONE rule in the form
"WHEN <observable situation> THEN <correct action>".
- Only use facts visible in this ticket.
- Do not include customer names or personal data.
- If the correction was only stylistic or you cannot tell why, return no rule.
Output: JSON matching the Lesson schema, status "proposed".

A few implementation details make the difference in practice:

  • Validate everything that comes back. Proposals are checked against the schema. Lesson candidates are rejected if they contain personal data or contradict an active rule.
  • Promote by evidence, not by single cases. A candidate only moves forward when several independent tickets support it.
  • Version everything. Model, prompt, schema and lesson versions are logged with each proposal, otherwise no improvement can be attributed to a cause.
  • Measure each lesson. Because applied_lessons is logged, you can compare tickets with and without a lesson during the trial phase.

Back to the example

The chargeback tickets get corrected three times, the reflection step proposes a rule, the team lead approves it, and from then on these cases land in the right queue. After the pricing change, the data shows a sudden spike in corrections in one category. That is no longer a gut feeling in a team meeting but a number on a dashboard.

That is the real payoff of structure. It does not just enable learning, it makes the system measurable:

  • Where is the assistant wrong? Error rate per category instead of anecdotes.
  • Where is knowledge missing? If a proposal cites no source, an article is missing from the knowledge base.
  • Where may it answer on its own? Automate only where the acceptance rate proves it.
  • What breaks with the next update? Every corrected ticket becomes a test case.

This works at scale. ByteDance does it for code reviews: their system automatically measures whether flagged code is actually changed afterwards, and uses that to weed out weak rules. The feedback signal emerges as a by-product of the normal workflow, which is exactly what per-field corrections do in the helpdesk.

The path there does not have to be a big project:

flowchart LR S1["1. Structure output, measure baseline"] --> S2["2. Capture per-field corrections"] --> S3["3. Analyze error patterns"] --> S4["4. Lessons with approval"] --> S5["5. Verify impact in trial"] --> S6["6. Automate selectively"]

Steps 1 and 2 pay off even if you never reach step 6. The costly thing about a wrapper is not what it gets wrong, but that nobody can see what it gets wrong.

What has to be said honestly

Not every workflow needs a learning loop. It costs development time, extra model calls and maintenance. Helpdesk feedback is also fuzzy: not every edit by an agent means an error. And most of the evidence for Reflexion comes from test environments with clean signals, not from real helpdesks. So the approach is not a sure thing. But a system built from the start to take in feedback has a future. One that only passes text through is as good on its last day as on its first.

Further reading