Xiaohongshu Details Leto, Its Production Agent Harness Powering 100+ AI Apps
小红书技术REDtech · wechat · 2026-12-04
Xiaohongshu's engine architecture team presents Leto, its in-house Agent Harness that connects LLMs, tools, and business systems to manage orchestration, context, state, and execution for complex C-end interactions. It already powers core products like Dian Dian, AI Search, and AI Ads, plus over 100 production AI applications.
Key design points:
- Four orchestration modes: ReAct (exploration constrained by round/budget/no-progress checks), Chained (stage-wise with independent models and tool configs), Pipeline/DAG (deterministic scheduling with checkpoint resume), and DynamicWorkflow (LLM generates a structured Spec validated before execution, with fallback to ReAct on failure).
- High-concurrency control: streaming for first-token latency, parallel tools and eager execution; bounded pools, timeouts, and budgets; per-session execution ownership via leases and validity checks.
- Context vs. state separation: model inputs (token cost) managed separately from execution records (recovery and debugging); Skills disclose summaries first, loaded on demand; session state rebuilt from append-only events.
- Cancellation and recovery: explicit boundaries between cancellation acceptance, tool exit, and state commit; human-in-the-loop confirmation for critical tool calls; lease-based recovery with checkpoints after service failover.
- Production stability: Replay turns live failures into reproducible cases; regression covers edge cases like late tool results and lease invalidation; paired with the open-source RL engine Relax for multi-turn Agentic RL training loops.
Leto is built on Java/SpringBoot, embeds into existing services, and uses A2A for cross-service agent collaboration.
More from coding & agent
- The 10 enterprise AI builds Fortune 1000 companies actually have budget for — alex_verem · 2026-12-04
- YPP entry bar doubles to 8,000 watch hours from Feb 2027; free MCP tool audits your channel — mwitiderrick · 2026-12-04
- Duplicate thread on AI agents' worst silent production failures — Ok-Machine7983 · 2026-12-04
- Reddit thread collects AI agents' worst silent failures in production — Ok-Machine7983 · 2026-12-04
- Security-testing his own app with Claude left ChatGPT mysteriously pushing "Daybreak" — Maleficent_Door5378 · 2026-12-04
- Dev rebuilds Nebula music player from scratch as AI capabilities leap in one year — eschadiol · 2026-12-04