Trunk engineering lessons for building reliable AI agents for CI root cause analysis
LLM nondeterminism makes it difficult to build reliable AI agents for DevOps/CI tasks—the same inputs can produce different outputs, making testing and consistent user experience challenging.
Extensive prompt engineering to make Claude call tools in a deterministic manner failed; switching to Gemini resolved the issue at the cost of some LLM reasoning quality.
Trunk built an AI agent for CI root cause analysis that produces better output and more reliable tests, enabling incremental improvements and described as a massive speed boost for previously manual tasks.
Frequently asked questions
What did this team achieve with this AI workflow?
Trunk built an AI agent for CI root cause analysis that produces better output and more reliable tests, enabling incremental improvements and described as a massive speed boost for previously manual tasks.
What tools did this team use?
LangSmith, MSW, Vercel's AI SDK, Claude, Gemini, GitHub.
What results were reported?
Agent output quality: better output; Speed boost from partial automation: massive speed boost for manual and repetitive tasks; Test reliability: more reliable tests (source-reported, not independently verified).
What failed first in this deployment?
Extensive prompt engineering to make Claude call tools in a deterministic manner failed; switching to Gemini resolved the issue at the cost of some LLM reasoning quality.
How is this quality assurance AI workflow structured?
CI failure triggers RCA → Retrieve historical stack traces → Preprocess CI log data → Agent examines failures → Subagent structured extraction → Deterministic output validation → Post summaries to GitHub PRs → Developer feedback collection.