An Agent That Gets Stronger with Use: Failure Attribution, Strategy Optimization, and the Version Iteration Loop
Three months after launch, the support agent's resolution rate is stuck at 70%; digging through bad cases, dozens of "expedite request never went through" complaints arrive every week, each handled manually by operations and closed; the product manager wants to optimize but cannot say whether the problem lies in intent recognition, knowledge retrieval, or tool calls; a revised prompt finally ships, and complaints climb the next week—because nobody ran regression, fixing scenario A while breaking scenario B. An agent that peaks at launch and grows mediocre with use lacks not point fixes but a closed loop that turns operational data into the next version's capability.
This post is part of the "AI Customer Service Product and Engineering Practices" experience-sharing series, drawn from a practice review of an AI customer service product at a leading logistics company. In this post I want to share how to combine failure cases, excellent human service records, and agent execution traces into a self-evolution mechanism for a logistics AI agent, completing problem attribution, strategy optimization, evaluation validation, and version iteration. This loop decides whether the agent gets stronger with use—or peaks at launch.

Five Key Design Points in the Self-Evolution Loop
- Data loop awareness: execution traces, failure cases, excellent human conversations, and user feedback fully collected and connected.
- Attribution ability: locating problems by layer—intent, knowledge, planning, tools, or permission phrasing—rather than vaguely blaming "the model".
- Strategy optimization mix: how knowledge, retrieval, prompts, workflows, tools, and models are applied to the right problem.
- Validation capability: offline evaluation, staged rollout, A/B testing, and rollback forming a complete chain.
- Operating mechanism: prioritization, ownership, and version management institutionalized.
The Overall Design
In building this self-evolution mechanism, I would first be clear: the essence of self-evolution is turning operational data into the next version's capability, not letting the model rewrite its own rules. The overall approach in one sentence: collect traces in full, attribute across seven layers, prescribe remedies by layer, and gate every change behind evaluation and staged rollout.
Step 1: Collect the data first
- Execution traces: fully record user inputs, recognized intents, planned steps, tool calls, and results.
- Failure cases: complaints, negative ratings, and human-handoff conversations, redacted into a bad-case library.
- Excellent human conversations: dialogues handled well by human agents are the best positive samples.
- User feedback: satisfaction ratings and repeat contacts, fed back as effect signals.
Step 2: Attribute by layer, not by patch
Examine layer by layer where the problem sits: intent understanding, knowledge retrieval, task planning, tool invocation, permission judgment, phrasing, system failure. Bad cases must be labeled and clustered to find high-frequency common causes, not patched one by one—attribution on the wrong layer means spending on the wrong asset: swapping models for missing knowledge or editing prompts for tool timeouts are both wasted effort.
Step 3: Prescribe remedies by layer
Missing knowledge gets knowledge added; inaccurate retrieval gets chunking and re-ranking tuned; wrong planning gets workflow and prompt fixes; unstable tools get interface and retry improvements; stiff phrasing gets rewritten; model swaps or fine-tuning come when truly necessary. Combine the means, but touch only one layer per change, aimed only at the attribution conclusion—avoiding "five changes at once, no one knows who earned the win or caused the break".
Step 4: Every change must pass evaluation and staged rollout
Any change first runs the offline evaluation set, then a small-traffic staged rollout, then A/B on real metrics—resolution rate, satisfaction, cost—never shipping on gut feeling. Versions must be recorded and rollback-ready: when metrics degrade during staged rollout, revert to the previous version with one click instead of firefighting overnight.
Step 5: Keep the loop turning with an operating mechanism
Hold weekly iteration reviews, prioritize by impact × frequency × repair cost, assign owners, and verify completion. Fixed bad cases automatically convert into regression cases, preventing the same problem from recurring; evaluation metrics go on a trend dashboard to prevent getting worse with each change.
Practice in Bytedesk
In the open-source Bytedesk customer service system (GitHub, website https://www.weiyuai.cn ), tool invocation logs record the agent's execution process and provide the entry point for diagnosis; the ticket module records post-failure handling and owners, and linking the two assembles a complete improvement case—which conversation failed, what the call chain was, who handled it, and how. Bad-case labeling and clustering, human review of candidate changes, version binding, and staged rollback need governance processes built in the business layer per this post—operational logs are not an automatic training set, nor do they authorize the agent to modify permissions or phrasing strategies on its own.
Key Takeaways
- The essence of self-evolution is turning operational data into the next version's capability, not letting the model rewrite its own rules.
- Attribution spans seven layers: intent, knowledge, retrieval, planning, tools, permission phrasing, system failure; label and cluster bad cases for common causes, not patches.
- Prescribe by layer: add knowledge, tune retrieval, fix workflows and prompts, repair interfaces, swap models when necessary—one layer per change.
- Every change passes evaluation and staged rollout: offline evaluation → small-traffic rollout → A/B on real metrics, with rollback-ready versions.
- Weekly iteration reviews prioritize by impact × frequency × repair cost; fixed bad cases convert into regression cases.
