S
Saurav Danej
90-Day AI/ML LinkedIn Content System
← All days
73
Day 73 of 90Agents

Planning agents — decompose, then execute

POST 1 of 5 MorningAgentsConcept

Plan-then-execute beats step-by-step on hard tasks

Vanilla ReAct decides one step at a time. For complex multi-step work this leads to drift, dead-ends, and rework.

Plan-then-execute:
1. Planner LLM produces a step list before any action.
2. Executor LLM (or the same one) runs each step with tools.
3. After each step, replan if needed.

Benefits:
- Plan visible upfront (auditable)
- Cheaper executor model possible
- Failures localised to a step

Use for: research tasks, coding tasks, anything with > 3 logical phases.
#Agents#LLM#AI#LangGraph#100DaysOfCode#Agents
POST 2 of 5 MiddayAgentsDeep dive

Two-LLM pattern: cheap executor, smart planner

Use a smart model (gpt-4o, claude-sonnet) as planner — produces the plan once.

Use a cheap model (gpt-4o-mini, claude-haiku) as executor — runs each step. Cheap model is good enough for 'call this tool with these args' if the plan is clear.

Results:
- 5-10x cost reduction on long agentic flows
- Same or better outcomes if planning is good
- Faster iteration loop

This is the move that separates production agent systems from demos.
#Agents#LLM#AI#LangGraph#100DaysOfCode#Agents
POST 3 of 5 AfternoonAgentsCode

Plan + execute split — minimal code

Planner returns a JSON list of steps. Executor loops over them, calling tools per step. Final synthesis combines results.

This 30-line skeleton handles 80% of multi-step agent flows. Wrap it with retries, cancelable steps, and tracing — that's a production planner.
#Agents#LLM#AI#LangGraph#100DaysOfCode#Agents
POST 4 of 5 EveningAgentsTip

Allow replanning after surprises

Plans get stale. After every step, ask:
- Did the result change my model of the world?
- Are remaining steps still relevant?

If yes, replan. If no, continue.

A cheap classifier ('replan needed: yes/no?') after each step catches drift early. Without it, the agent rigidly follows the plan even when step 1's result invalidates it. Static plans don't survive contact with reality.
#Agents#LLM#AI#LangGraph#100DaysOfCode#Agents
POST 5 of 5 NightAgentsRecap

Day 73 — plan, execute, replan

Day 73 done.

- Plan-then-execute > step-by-step
- Smart planner + cheap executor
- 30-line skeleton
- Replan after surprises

Tomorrow (Day 74): multi-agent systems — when one agent isn't enough.
#Agents#LLM#AI#LangGraph#100DaysOfCode#Agents