Your Java LLM agent works in the demo. Friday night in production is another story.
说明与用途
在生产环境中,LLM 退款代理因提供商错误、错误的 JSON 和未批准的大额退款而失败。引入 ARA 后,添加了确定性输出验证、提供商容错、成本上限和人工审批门,解决了这些问题。
问题
An LLM‑driven refund agent failed in production: provider 503s, malformed JSON, and unapproved large refunds.
结果
The agent now validates outputs deterministically, retries malformed responses, requires human approval for critical actions, and handles provider failures and cost caps, preventing the production incidents described.
工作流
- 1. Configure AgentContract with input sanitizers, content truncator, output schema, Markdown fence stripper, and repair attempts.
- 2. Create AraRuntime with llmClient and approvalGate.
- 3. Define AraAgent with humanApprovalRequired=true and enabledTools=["refund"].
- 4. When agent calls refund, runtime parks the call and creates an approval request.
- 5. Operator reviews request and submits Approved, Rejected, or Modified decision via gate.submit().
- 6. Agent proceeds based on decision or retries if rejected.
证据
ARA is an open source (Apache 2.0) Java 21 runtime for LLM agents, built on LangChain4j.
The model wraps its JSON in a Markdown fence, or forgets a required field.
An agent can have access to the right tool, understand the request and even write a convincing justification.
- 记录日期: 2026-10-21T09:41:35.136Z