Codelucent
Architecture

Reliable agents are mostly code

Agents that work in production are 80% deterministic code. The LLM is a small, scoped component — not the whole workflow.

All notes3 min read

The failure mode of most agent projects is handing too much of the workflow to the model. 'Let the agent figure it out' sounds good in a demo and falls apart in production, where the same edge cases recur and reliability matters more than cleverness.

Decompose the task as a graph first. Most nodes are deterministic code — API calls, validators, state updates. A few nodes are genuinely LLM-shaped: classification, routing, summarization, authoring. Keep the LLM scope narrow, and give each LLM node a typed output so downstream code can trust it.

Add guardrails where risk is high. Dry-run modes for destructive actions, human-in-the-loop approval gates on writes, scoped credentials so a bug can't exceed the user's actual permissions. Idempotent tool calls so retries are safe.

Trace every run end-to-end. Input, steps, tool calls, retries, final state, cost. When an agent misbehaves, you need to replay and diff against working runs — not guess from logs. Every failure becomes a test case that can't regress.

Got an AI idea? Bring it. We’ll tell you the truth about it.

30 minutes with a founder: what to build, what to skip, and what it should cost. Kansas City, Tokyo, or remote.

Codelucent product work: AI chat, dashboards, and mobile screens