Skip to content

Instantly share code, notes, and snippets.

@MuhammadYossry
Last active May 3, 2026 09:21
Show Gist options
  • Select an option

  • Save MuhammadYossry/bbc7eefaf0969650888576a0932f1943 to your computer and use it in GitHub Desktop.

Select an option

Save MuhammadYossry/bbc7eefaf0969650888576a0932f1943 to your computer and use it in GitHub Desktop.
Why Problem Solving Matters for Agentic Engineering

Why Problem Solving Matters for Agentic Engineering

Problem-solving strategies are the backbone of agentic engineering because an agentic system is fundamentally a system that must repeatedly:

  1. understand goals
  2. decompose ambiguity
  3. choose actions
  4. adapt from feedback
  5. coordinate tools / subagents
  6. improve over time

For example AgentOS blueprint is essentially problem-solving strategies operationalized into infrastructure.


Core Idea

Traditional software uses fixed logic.

Agentic systems need reasoning architectures.

That means strategies like:

  • Divide and Conquer
  • Dynamic Programming
  • Greedy Heuristics
  • Backtracking
  • Constraint Satisfaction
  • Search & Planning
  • Bayesian Updating
  • Multi-Agent Consensus

become system design patterns.


How Each Strategy Helps Build Agentic Solutions


1. Divide and Conquer → Multi-Agent Architecture

Strategy:

Break one large problem into smaller specialized subproblems.

In Agent Engineering:

Instead of one giant agent handling everything:

User asks tax question
→ Research Agent
→ Deduction Agent
→ Strategy Agent
→ Review Agent

In AccountantOS:

  • TaxResearcher
  • DeductionScanner
  • StrategyAdvisor
  • NoticeResponder

That is pure Divide & Conquer.

Benefit:

  • smaller prompts
  • lower hallucination risk
  • parallel execution
  • clearer accountability

2. Dynamic Programming → Memory + Reuse

Strategy:

Store previous solved subproblems.

In Agent Systems:

If an agent solved:

How to classify CP2000 notice

store that pattern.

Next time:

reuse prior workflow

In AgentOS:

  • skills.md
  • verified_facts/
  • reward logs
  • reusable procedures

Benefit:

  • cheaper inference
  • faster responses
  • compounding intelligence

3. Greedy Strategy → Fast Routing Decisions

Strategy:

Take the best local decision now.

In Agent Systems:

Choose:

  • cheapest model
  • nearest tool
  • highest-confidence agent
  • shortest workflow

Example:

Simple tax bracket lookup?
Use cheap model.

In our example architecture:

MODEL_FAST / STANDARD / STRONG

Benefit:

Reduces cost dramatically.


4. Backtracking → Error Recovery

Strategy:

Try path, reverse if wrong.

In Agent Systems:

If generated answer fails:

Try alternate chain
Try another tool
Use stronger model
Ask clarifying question

Example:

Notice response wrong citation:

rollback draft
re-run with TaxResearcher verification

Benefit:

Essential for robustness.


5. Constraint Satisfaction → Safe Agents

Strategy:

Solve while obeying rules.

In Agent Systems:

Rules:

  • never reveal PII
  • always cite IRS source
  • no filing actions
  • human review required

In our AccountantOS example:

constraints.md

Benefit:

Transforms raw LLM into governed system.


6. Search + Planning → Multi-Step Tasks

Strategy:

Explore sequences of actions.

In Agent Systems:

For complex goal:

Reduce annual taxes legally

Need plan:

  1. inspect income
  2. estimate liabilities
  3. compare retirement options
  4. simulate outcomes
  5. recommend sequence

Benefit:

Moves agent from chatbot → planner.


7. Bayesian Updating → Runtime Learning

Strategy:

Prior beliefs updated by evidence.

Design priors become posterior through runtime experience.

Exactly Bayesian logic.

Example:

Prior:

Most freelancers benefit from home office deduction

Posterior:

Actually many fail exclusive-use test

Update confidence.

Benefit:

Real learning instead of static prompting.


8. Consensus Strategy → Multi-Agent Truth Validation

Strategy:

Multiple solvers validate a result.

In AgentOS:

NoticeResponder drafts
TaxResearcher verifies
Orchestrator approves

Benefit:

Reduces single-model hallucinations.


Why This Matters for Agentic Engineering

Agentic engineering is not “calling an API with a prompt.”

It is designing systems that repeatedly solve uncertain problems.

That means borrowing from:

  • algorithms
  • operations research
  • distributed systems
  • economics
  • control theory
  • cognitive science

Mapping Strategies to our example Architecture

Strategy AgentOS Component
Divide & Conquer Specialist agents
Dynamic Programming Skills + memory files
Greedy Model routing
Backtracking Retry / review loops
Constraints constraints.md
Search / Planning Task orchestration
Bayesian Updating Rewards + world model
Consensus Shared proposals + votes

What Weak Agent Builders Miss

Many people build:

Prompt + LLM + tool calls

But strong builders engineer:

Prompt
+ memory
+ decomposition
+ routing
+ evaluation
+ revision
+ collaboration
+ economics

That is where reliable agents emerge.


Example: Build Better AccountantOS Using These Strategies

Instead of:

One tax chatbot

Use:

Divide & Conquer:
Research + Strategy + Review

Dynamic Programming:
Save prior deductions

Greedy:
Cheap model for simple tasks

Backtracking:
If wrong citation → rerun

Constraints:
No filing actions

Consensus:
Two agents approve notice letters

The Meta Insight

Problem-solving strategies are to agents what data structures are to software.

Without them:

  • chaotic reasoning
  • expensive outputs
  • brittle workflows

With them:

  • scalable reasoning
  • efficient compute
  • reliable outcomes
  • learnable systems

Final Summary

Problem-solving strategies help build agentic systems by giving them methods to:

  1. break complexity apart
  2. remember useful work
  3. optimize cost
  4. recover from failure
  5. obey rules
  6. plan ahead
  7. learn from evidence
  8. collaborate for truth

That is how advanced agentic engineering needs be done.

slow thinking vs fast thinking, analog to agents vs models
  • Fast brain → the model layer Immediate pattern recognition, intuition-like responses, compressed priors, fluent recall, heuristic judgment.

  • Slow brain → the agentic layer Deliberate reasoning, decomposition, tool use, memory retrieval, verification, planning, self-correction, multi-step execution.

A raw model often behaves like intuition: it can answer instantly because it has absorbed statistical structure. But intuition alone is unreliable in high-stakes or novel situations.

That is where the agent layer matters.

The agent layer can pause the fast answer and ask:

  • Is this correct?
  • What evidence supports it?
  • Should I use a tool?
  • Have I solved something similar before?
  • What constraints apply?
  • Is another specialist better suited?
  • Should I revise this plan?

So instead of replacing the model, the agentic layer governs and amplifies it.

This mirrors human cognition:

  • Fast thinking is efficient, fluent, and often right.
  • Slow thinking is expensive, effortful, but crucial for edge cases, ambiguity, and error correction.

Our Example AgentOS architecture reflects this distinction well:

  • Models provide raw cognitive horsepower.
  • Filesystem memory provides continuity.
  • Routing logic decides when intuition is enough and when deliberation is required.
  • Specialist agents act like focused cognitive modules.
  • Reward logs / world models allow future intuition to improve.

That last point is important: good slow thinking eventually trains better fast thinking.

In humans, repeated deliberate practice becomes instinct. In agent systems, verified reasoning traces become reusable policies, memories, and abstractions.

So the future likely is not “one super model.”

It is a dual-process architecture:

  1. Fast generative priors for most routine cognition
  2. Slow agentic control loops for difficult, risky, or novel work

That is also why many demos feel impressive but brittle: they have fast brain, but no slow brain.

And many over-engineered systems feel clunky: they have slow brain everywhere, even when intuition would suffice.

The real craft of agent engineering is knowing when to think fast and when to think slow.

This article points directly toward that balance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment