Why Good Agents Think in Conditionals, Not Whole Worlds

Nan Wang

Hatched by Nan Wang

May 06, 2026

9 min read

87%

0

The hidden trick behind both sampling and agency

What if the fastest way to understand a complex whole is not to confront it as a whole at all, but to keep asking one small, local question at a time?

That sounds almost too modest to be profound. Yet it explains something deep about both probabilistic inference and the design of useful AI agents. In one world, a sampler updates one variable while holding the rest fixed until a stable picture emerges. In the other, an agent becomes more powerful when it stops trying to be a single monolith and instead grows through tools, sessions, state, and specialized extensions. In both cases, the system becomes capable of something global by repeatedly making local moves.

That is the central tension: complexity is not mastered by grabbing everything at once, but by structuring the order in which smaller things are allowed to change.

This is not just a technical curiosity. It is a design principle for building systems that can think, adapt, and remain usable under pressure.


Why whole-world thinking breaks down

A multivariate problem invites a tempting fantasy: if only we could see the entire joint distribution, the entire state space, the entire plan, then decision-making would become clean and direct. But whole-world thinking is often too expensive, too brittle, or too vague to be practical. The more variables you add, the more the system becomes entangled, and the harder it is to reason about any one piece without losing the structure of the rest.

That is why conditional thinking matters. Instead of demanding the full answer at once, Gibbs-style updating asks a more constrained question: given everything else, what should this one variable be? Then it moves to the next variable, and the next. Over time, the process traces a Markov chain that can converge to the joint picture without ever requiring the full picture to be handled directly.

This is a powerful mental model because it reveals an uncomfortable truth: many hard problems are hard precisely because they punish global control fantasies. If you try to solve them by planning every interaction in advance, you often get stuck. If you instead create a process that makes locally valid moves, the system can self-organize into something coherent.

Now look at agent design through the same lens. A useful agent is rarely one giant prompt wrapped around one giant capability. It is more like a living system with sessions, tools, memory, and extensions. It can keep state across interactions, call tools when needed, and let different components specialize. The result is not a single perfect act of intelligence, but a sequence of manageable ones.

The real breakthrough is not building a mind that knows everything. It is building a mind that knows how to update itself without collapsing.


The agent as a Markov chain of intentions

There is a surprising analogy between Gibbs sampling and agentic workflows. In a sampler, each update depends on the current state, but only partially. In an agent, each action depends on the current session, but only partially. The point is not to represent the entire universe of possibilities in one shot. The point is to preserve enough context to make the next move sensible.

Think of a to-do list. On the surface, it is an ordinary productivity tool. Underneath, it is a powerful form of state compression. Instead of forcing the agent to hold every task in its working memory, the list externalizes priorities and pending obligations. That lets the agent revisit the state later, update one item, and leave the rest untouched. The list functions like a conditional slice through a larger problem space.

This becomes even more interesting when sessions are organized as trees. A linear chat assumes that progress must move in one direction, but real work often branches. You try one approach, then fork into alternatives, then return to the main line with a better understanding. A tree of sessions captures that reality. It lets you preserve intermediate states, exploratory branches, and abandoned paths without pretending the world is simpler than it is.

That is also exactly what Gibbs-like reasoning does for uncertainty. It does not require you to resolve all dependencies before taking a step. It allows the system to move through the state space in a way that respects the local structure of the problem. The branching session tree and the conditional update are cousins. Both admit that progress often comes from navigating a landscape one edge at a time.

A practical example makes this clear. Suppose you are building an AI assistant that helps with software projects. If the agent tries to reason about codebase architecture, bug triage, release planning, and user communication as one undifferentiated task, it will become mushy and unreliable. But if it has a tool for issue tracking, an extension for code navigation, a persistent session for project context, and specialized skills for writing or analysis, each piece can update its own local state while contributing to the overall output. The agent becomes less magical in appearance, but more intelligent in effect.

This is the quiet lesson of conditional computation: specialization is not fragmentation when the pieces can recompose into a coherent whole.


The real design problem is not intelligence, but state

Most conversations about AI agents obsess over reasoning, planning, or model size. Those matter, but they are only part of the story. The deeper question is: how does an agent preserve, modify, and reuse state over time?

State is where intelligence becomes real. Without state, every exchange is isolated. With state, the system can accumulate commitments, preferences, context, and partial progress. But state is also dangerous, because too much of it becomes clutter, and too little becomes amnesia. The art is not simply to store memory, but to structure memory so that only the relevant parts need to move at any moment.

That is the hidden common ground between probabilistic sampling and agent architecture. Gibbs sampling is effective not because it sees everything, but because it keeps the right things fixed long enough for the system to settle. A good agent is effective not because it knows all possible facts, but because it can freeze some context while updating another piece of the world.

This suggests a design pattern for building useful agents:

  1. Localize responsibility. Let tools and extensions own specific kinds of state.
  2. Persist selectively. Save what matters across sessions, but do not hoard everything.
  3. Branch when needed. Use trees or forks for exploratory work, so uncertainty does not pollute the main thread.
  4. Expose callable actions. Tools are the agent’s version of conditional updates, because they let the system act on one part of the world without re-deriving all of it.

The most interesting point is that this pattern also improves human work. We often think better when we separate planning from execution, or when we keep a note of unresolved questions instead of forcing premature closure. That is Gibbs thinking in daily life: hold most variables fixed, update one variable carefully, then let the whole system stabilize around the change.

A robust system is not one that avoids uncertainty. It is one that can absorb uncertainty without losing its shape.


From prompting to orchestration: a new mental model for agents

If you only think in prompts, you will design shallow agents. Prompting assumes intelligence is mostly a matter of asking better questions. But once you start thinking in terms of state transitions, you realize that intelligence is often a matter of orchestration.

Orchestration means deciding which component should move next, which state should remain stable, and which tool should be called when the local problem exceeds the current frame. This is not just software engineering. It is a cognitive strategy.

Imagine a chef preparing a complicated meal. They do not cook every ingredient at once. They chop one set of vegetables, let a sauce reduce, then move to the protein, then return to adjust seasoning. The final dish emerges from carefully sequenced partial updates. A good agent works the same way. It does not need to solve the whole problem in a single monolithic inference pass. It needs a workflow that allows partial correctness to compound.

This is why extensions matter so much. An extension is not just a plug-in. It is a way of enlarging the state space without overwhelming the core system. The base agent remains minimal, but it can reach outward when needed. Tools make this concrete: a to-do list, a code runner, a document editor, a search interface. Each one changes what can be updated locally, and therefore what the agent can become globally.

There is a profound elegance here. The agent becomes more capable not by centralizing everything, but by delegating structure to the edges. Each extension becomes a conditional subproblem. Each session becomes a branch in a tree. Each tool call becomes a local move in a larger inference process.

That is why the best agents may feel less like single brains and more like disciplined ecosystems.


Key Takeaways

  • Stop asking for the whole answer first. When a problem is complex, identify the smallest variable you can update while holding the rest fixed.
  • Treat state as a first-class design object. The quality of an agent depends on how well it stores, scopes, and revisits context.
  • Use tools to localize action. A tool is valuable when it lets the system change one part of the world without destabilizing everything else.
  • Prefer branching over flattening. Session trees, notes, and forks preserve exploratory work without forcing false linearity.
  • Design for convergence, not omniscience. A good system does not need to know everything at once. It needs a process that reliably improves its approximation over time.

The deeper lesson: intelligence is a controlled sequence of partial fixes

The most useful systems, whether statistical or cognitive, share a strange humility. They do not pretend to conquer complexity by seeing it all. They tame complexity by making one partial update at a time, then letting those updates accumulate into coherence.

That reframes what an AI agent really is. It is not a magical oracle, and it is not merely a chatbot with accessories. It is a stateful process that can revisit itself, call on specialized capabilities, and move through uncertainty without freezing. In that sense, building a good agent is less like writing a single brilliant answer and more like designing a sampler that knows how to keep moving.

Once you see that, the connection becomes hard to unsee. The same logic that lets a Markov chain converge to a joint distribution can also help an agent converge to a useful course of action. Both rely on disciplined locality. Both respect the fact that global order often emerges only after many careful local moves.

So perhaps the real question is not whether a system can think globally. The better question is whether it can update locally in a way that eventually makes the global picture true.

That is the architecture of both inference and agency. And it may be the most practical definition of intelligence we have.

Sources

← Back to Library

Hatch New Ideas with Glasp AI 🐣

Glasp AI allows you to hatch new ideas based on your curated content. Let's curate and create with Glasp AI :)

Start Hatching 🐣