Agentic Intelligence — Technologies & Tricks

Updated July 2026 with 2025–2026 SOTA additions — new entries marked ★. Algorithm names link to their papers (arXiv / project page).

July 2026 • Updated Edition Algorithm names link to their original papers (arXiv / project page).


Contents

  1. What Is an Agent?
  2. The Core Agent Loop
  3. Tool Use Mechanics
  4. Memory Systems
  5. Planning
  6. Reflection and Self-Critique
  7. Multi-Agent Systems
  8. Tool Ecosystems
  9. Computer Use and GUI Agents
  10. Code Agents
  11. Browser / Web Agents
  12. RAG and Retrieval for Agents
  13. Agent Frameworks
  14. Safety and Guardrails
  15. Evaluation of Agents
  16. Common Failure Modes
  17. State Management Patterns
  18. Cost and Latency Engineering
  19. Context Engineering for Agents
  20. Multimodal Agents
  21. Long-Horizon Agentic Tasks
  22. Production Patterns
  23. 2026 Production Stack

Appendix A: Twenty-Five Things to Know

Appendix B: Decision Tree — "Which Agent Pattern?"

Appendix C: Year-by-Year Agentic Milestones

1. What Is an Agent?

1.1 Working definition

An agent is an LLM-driven system that:

1.2 Agent vs assistant vs chatbot

Chatbot Assistant (RAG) Agent
Goal-driven no some yes
Multi-step no sometimes yes
Tool use no sometimes yes
State across turns shallow shallow deep
Self-correction no no yes

1.3 Levels of agency

  1. L0 — Pure chat. No tools, no state.
  2. L1 — Tool-augmented. Single tool call per turn.
  3. L2 — Multi-step tool use. ReAct-style loops.
  4. L3 — Planning + execution. Decompose, then execute.
  5. L4 — Self-improving. Reflection across runs, skill libraries.
  6. L5 — Multi-agent. Specialists collaborate.

1.4 When to use an agent (vs simpler patterns)

Watch out

The single biggest mistake in 2024–25 agent products: using an agent loop where a single structured LLM call (with one or zero tool calls) would work. Agents add latency, cost, and unpredictability; reach for them only when the value justifies it.

2. The Core Agent Loop

2.1 Sense \(\to\) Plan \(\to\) Act \(\to\) Observe \(\to\) Reflect

The fundamental cycle:

  1. Sense: read the current state (user message, tool result, environment).
  2. Plan: decide what to do next (often implicit in next-token).
  3. Act: emit a tool call (or final response).
  4. Observe: receive the tool result.
  5. Reflect: optionally critique progress; revise plan.
  6. Loop until terminal action or budget exhausted.

2.2 ReAct (Yao et al. 2022)

Interleave Thought and Action tokens:

Thought: I need the current weather.
Action: weather_api(city="San Francisco")
18°C
Thought: Got it; reply to user.
18°C

The thought channel exposes reasoning; action channel emits structured calls. Standard baseline.

2.3 Plan-and-Execute

Two LLM passes:

More predictable than pure ReAct; better for long-horizon tasks.

2.4 Plan-Act-Reflect (PAR)

Works well for structured tasks (coding, research, data analysis).

2.5 Tree of Thoughts for agents

Branch the action space; evaluate each branch with a critic; backtrack on failure. Useful when multiple plausible actions exist.

2.6 Modern variants

3. Tool Use Mechanics

3.1 Function calling / structured output

Modern LLMs (GPT-4o, Claude, Gemini, open frontier) support native function calling: the model emits a JSON object matching a tool schema.

tools = [{
  "name": "search_web",
  "description": "Search the web and return top results.",
  "input_schema": {
    "type": "object",
    "properties": {
      "query": {"type": "string"}
    },
    "required": ["query"]
  }
}]

3.2 JSON Schema patterns

3.3 Tool description engineering

The description is the model's only signal for when to use the tool. Best practices:

3.4 Tool result integration

3.5 Tool error handling

3.6 Composition

3.7 Toolformer-style self-supervision

The model learns when to call tools by inserting tool-call tokens during pretraining; loss filtered by whether the call helped. Used in some open frontier models for native tool fluency.

★ 2026 SOTA update — Agentic RL for tool use

4. Memory Systems

4.1 The four memory types (cognitive analogy)

4.2 Working memory management

4.3 Episodic memory

4.4 Semantic memory (the user model)

4.5 MemGPT and OS-level memory

Treat the LLM as the CPU; separate main memory (in-context) from external memory (vector store). The agent can call read/write tools to swap between them. Mimics OS paging.

4.6 Anthropic's memory tool, OpenAI memory

Modern frontier APIs ship structured memory features:

4.7 Conversation summarization patterns

4.8 Skill library (Voyager pattern)

4.9 Memory failure modes

★ 2026 SOTA update — Long-term agent memory (2025)

5. Planning

5.1 Implicit vs explicit planning

Implicit: model plans inside CoT before each action. Cheap, less robust. Explicit: separate planning step produces a plan object the executor follows. More predictable, better for long horizons.

5.2 Hierarchical planning

5.3 LLM as planner

Strong base for free-form tasks. Limitations: planning errors propagate; long plans drift. Mitigations: bound plan depth, validate plan structure, allow incremental commitment.

5.4 Hybrid: LLM + classical planner

5.5 Recursive task decomposition

5.6 HTN (Hierarchical Task Networks)

Tasks decomposed into method instantiations; methods themselves contain tasks. Classical AI primitive that maps cleanly onto LLM agents.

5.7 Plan validation and revision

6. Reflection and Self-Critique

6.1 Reflexion (Shinn et al. 2023)

After each episode, the model writes a reflection on what went wrong, stored in episodic memory. Future episodes prepend recent reflections.

6.2 Self-Refine

Generate \(\to\) critique \(\to\) revise loop, single-episode. Effective for writing, code, structured tasks.

6.3 Critic models

6.4 Outcome-based vs process-based feedback

Outcome: evaluate only the final result. Cleaner; can mask reasoning errors. Process: evaluate each step. Catches errors earlier; needs PRM-style data.

6.5 Multi-turn refinement

7. Multi-Agent Systems

7.1 When to use multiple agents

Counter-warning: for most tasks, a single well-designed agent beats a multi-agent ensemble. Multi-agent adds coordination overhead.

7.2 Manager-worker pattern

Standard in CrewAI, AutoGen.

7.3 Multi-Agent Debate (Du et al.)

N agents propose answers; iteratively critique each other; converge. Beats single-agent on factual / logical tasks.

7.4 LLM-as-judge panel

Multiple judge LLMs evaluate; majority vote. Higher reliability than single judge; debiases position / self-preference.

7.5 Society of Mind (MetaGPT, ChatDev)

Specialized roles: PM, architect, coder, QA. Each has a persona prompt + tool palette. Effective for software engineering.

7.6 Adversarial agents

7.7 Coordination mechanisms

7.8 Common failure modes

8. Tool Ecosystems

8.1 Code execution

8.2 File system

8.3 Web browsing

8.4 Database / SQL

8.5 Productivity APIs

8.6 MCP (Model Context Protocol, Anthropic)

Open standard for connecting LLMs to tools. Server-client architecture: each external system runs an MCP server exposing tools/resources/prompts; agent client discovers and calls them. Standardizes:

Major implementations: Claude Desktop, Claude Code, Cursor, Cline, OpenAI Apps SDK.

8.7 Plugin / extension models

9. Computer Use and GUI Agents

9.1 Why GUI agents?

The web / desktop is the universal API. Agents that can use a screen + keyboard can interact with anything humans can, no API integration needed.

9.2 Claude Computer Use (Anthropic 2024)

9.3 OpenAI Operator

Browser-only autonomous agent with separate browser-control tool layer; multi-turn task completion.

9.4 Anthropic Claude in Chrome / Browser Tool

First-class browser actions with screenshot + DOM-aware grounding.

9.5 Open computer-use models

9.6 Set-of-Mark (SoM) prompting

Annotate screenshot with numbered marks on actionable elements; agent refers to them by number. Improves click accuracy dramatically.

9.7 Action grounding

9.8 Failure modes for GUI agents

★ 2026 SOTA update — Frontier computer-use agents (2025)

10. Code Agents

10.1 Cursor / Aider / Cline / Continue

IDE-integrated coding agents with file editing, command execution, codebase awareness. Common patterns:

10.2 Devin / Cognition / Replit Agent

Autonomous SWE agents that take a ticket and produce a PR.

10.3 SWE-agent / SWE-Gym

Open framework with structured action space (file ops, search, edit). Strong on SWE-bench.

10.4 Codex CLI / Claude Code

10.5 GitHub Copilot Workspace

Agent-native IDE: spec \(\to\) plan \(\to\) implementation \(\to\) review, all assisted.

10.6 Code agent best practices

Recipe — Building a code agent.

  1. Tools: read, write, edit (diff-based), bash, grep, glob.
  2. Always read before editing (avoid clobbering).
  3. Run tests after changes; iterate on failures.
  4. Show diffs to user before applying.
  5. Sandbox by default; explicit elevation for installs / network.
  6. Persistent context per repo (CLAUDE.md / AGENTS.md).
  7. Skill / plugin system for repo-specific routines.

11. Browser / Web Agents

11.1 Categories

11.2 Open frameworks

11.3 Web evaluation benchmarks

11.4 Anti-bot considerations

12. RAG and Retrieval for Agents

12.1 Naive RAG

Embed query \(\to\) retrieve top-k chunks \(\to\) stuff into prompt \(\to\) generate. Standard baseline.

12.2 Self-RAG

Model decides when to retrieve, what to retrieve, and whether to use the result. Trained with reflection tokens ([Retrieve], [Relevant]).

12.3 Adaptive RAG

Classify query difficulty; route easy queries to direct LLM, medium to single-step RAG, hard to multi-step / agentic RAG.

12.4 Corrective RAG (CRAG)

Critic evaluates retrieved chunks; if low quality, expand search (web) or rewrite query.

12.5 GraphRAG (Microsoft)

Build a knowledge graph from corpus (entities + relations); retrieve sub-graphs by query similarity; inject as context. Better for multi-hop reasoning over structured knowledge.

12.6 Agentic RAG

RAG inside an agent loop: retrieve \(\to\) read \(\to\) if need more \(\to\) retrieve again. Multi-hop without explicit planning.

12.7 Query-rewriting and HyDE

12.8 Multi-vector / late interaction (ColBERT, ColPali)

Per-token vectors; max-similarity per query token. Better for fine-grained matching, especially document images (ColPali).

12.9 Re-ranking

Cross-encoder reranks top-k for higher precision; filters retrieval noise. Cohere Rerank, BGE-Reranker, OpenAI / Voyage reranker APIs.

12.10 Long-context vs RAG

13. Agent Frameworks

13.1 The 2026 landscape

Framework Maintainer Notes
LangChain LangChain Largest tool ecosystem; battle-tested; complex
LangGraph LangChain Stateful graph-based agents; production-ready
LlamaIndex LlamaIndex RAG-first; data ingestion strong
CrewAI CrewAI Multi-agent role-playing
AutoGen Microsoft Conversational multi-agent
OpenAI Agents SDK OpenAI Lightweight; native tool use
OpenAI Swarm OpenAI Earlier multi-agent; superseded by Agents SDK
Claude Agent SDK Anthropic Agent loop on Claude; subagents, hooks
DSPy Stanford Declarative; auto prompt-optimization
Pydantic AI Pydantic team Type-safe; structured outputs first
Smol Agents HuggingFace Minimal; code-as-actions
Mastra Mastra TypeScript native
Semantic Kernel Microsoft .NET / C# friendly
Letta (MemGPT) Letta Memory-augmented agents
TaskWeaver Microsoft Code-first agents

13.2 LangChain vs LangGraph

LangChain: tool integrations, chains, retrievers. Rich ecosystem; can be heavy. LangGraph: graph state machines on top; better for explicit control flow, persistence, human-in-loop.

13.3 CrewAI vs AutoGen

CrewAI: roles + tasks + crews; declarative, fast prototyping. AutoGen: conversational agents that talk to each other; flexible.

13.4 When to pick what

★ 2026 SOTA update — Agent frameworks and protocols (2025)

14. Safety and Guardrails

14.1 Sandboxing

14.2 Permission models

14.3 Approval gates

14.4 Output filtering

14.5 Cost / spend controls

14.6 Prompt injection defenses

14.7 Constitutional AI for agents

Apply constitutional principles to action selection; refuse actions that violate. Especially relevant for browser / OS agents.

15. Evaluation of Agents

15.1 Benchmarks

Benchmark Domain Notes
SWE-bench / SWE-bench-Verified software eng GitHub issues
WebArena, VisualWebArena web tasks 4 domains, multi-turn
WebVoyager real websites 600+ tasks
OSWorld full OS multimodal
AgentBench general agent 8 environments
GAIA general assistant 466 questions; 3 levels
ToolBench tool use 16k tools
TAU-Bench customer service multi-turn
MLE-bench ML engineering 75 Kaggle-like tasks

15.2 Trajectory evaluation

Beyond final-success, evaluate the trajectory:

15.3 LLM-as-judge for agents

Use a strong LLM to evaluate trajectories. Best practices:

15.4 Human eval

15.5 Online metrics (production)

★ 2026 SOTA update — Frontier agent benchmarks (2025)

16. Common Failure Modes

16.1 Doom loops

Agent retries the same failing action repeatedly. Fix: detect loops (last N actions identical), back off / replan.

16.2 Context explosion

Conversation history grows unboundedly. Fix: rolling summary, sliding window with sink, drop irrelevant tool results.

16.3 Hallucinated tools

Model invents a tool name that doesn't exist. Fix: strict tool schema validation; reject + nudge to existing tools.

16.4 Off-task wandering

Agent forgets the original goal in a long episode. Fix: re-state goal periodically; maintain a goal-anchor in system prompt.

16.5 Premature commitment

Agent picks a wrong path early and won't backtrack. Fix: budget exploration vs commitment; explicit "consider alternatives" prompts.

16.6 Error compounding

Each step has a small error rate; trajectory accuracy decays exponentially. Fix: per-step verification; rollback / replan.

16.7 Goal drift

Agent gradually shifts the goal toward something easier or different. Fix: periodic goal-grounding; explicit task-completion criteria.

16.8 Stuck on subgoal

Agent fixates on one sub-task it can't solve, ignoring alternatives. Fix: max-attempts per sub-task; mark and move on; reflect after.

16.9 Tool result misreading

Agent misinterprets the tool result and proceeds wrongly. Fix: structured outputs; validation; explicit re-read step.

16.10 Authentication / quota wall

Agent hits a wall and doesn't surface to user. Fix: detect auth-error patterns; auto-escalate.

17. State Management Patterns

17.1 Conversation state

17.2 Plan tracking

17.3 Working memory tools

17.4 Session checkpointing

17.5 LangGraph state pattern

Typed state object; nodes mutate via reducers; transitions via edges. Production-friendly: visualize, replay, time-travel.

18. Cost and Latency Engineering

18.1 Model routing

18.2 Cascades

18.3 Parallel tool calls

When tools are independent (LLM-Compiler / ReWOO), call in parallel. Reduces wall-time without increasing token cost.

18.4 Speculative execution

Pre-execute likely next tool calls speculatively while LLM is generating. Risk: wasted compute on rejected paths.

18.5 Prefix caching

Cache the system-prompt + tool-schema KV; reused across requests. Anthropic prompt cache: up to 90% cost savings on cached prefix.

18.6 Tool result caching

Same tool call with same args within a window \(\to\) return cached result. Fingerprint by tool name + canonicalized args.

18.7 Batching

18.8 Streaming

Stream LLM output to user; parallel tool execution while later text streams.

19. Context Engineering for Agents

19.1 System prompt design

Aim for < 2000 tokens; bloat hurts quality and cost.

19.2 Tool description engineering

Already covered in §3. Each tool's description is its own surface; iterate.

19.3 Few-shot examples

19.4 Output format specs

19.5 Context compression

19.6 Persistent context (CLAUDE.md / AGENTS.md)

Per-project context file with:

Auto-loaded by the agent in every session.

20. Multimodal Agents

20.1 Vision + tool use

VLMs that can see screenshots + use tools. Standard for computer-use, visual data analysis, document agents.

20.2 Document / PDF agents

20.3 Spreadsheet / Excel agents

20.4 Video analysis agents

20.5 Voice agents

21. Long-Horizon Agentic Tasks

21.1 Defining "long-horizon"

\(\ge 10\text{–}100+\) steps; minutes to hours of execution. Software engineering, research, content creation, data pipelines.

21.2 Subgoal tracking

21.3 Memory across episodes

Reflexion-style: each completed episode produces lessons stored in episodic memory. Future runs prepend / retrieve relevant lessons.

21.4 Skill library + curriculum

Voyager-pattern: store successful sub-routines as named skills. Auto-curriculum: agent picks next learning goal based on current capabilities.

21.5 Bounded budget pattern

Recipe — Bounded long-horizon agent.

21.6 Deep Research agent pattern (OpenAI / Anthropic)

Long-form research: query expansion \(\to\) multi-source web search \(\to\) synthesis \(\to\) citations. Often 10–60+ minute runs. ChatGPT Deep Research, Gemini Deep Research, Perplexity Pro.

★ 2026 SOTA update — Deep research agents (2025)

22. Production Patterns

22.1 Deployment topologies

22.2 Human-in-the-loop

22.3 Background agents

Long-running async agents. Deliver via:

22.4 Observability

22.5 Versioning + rollback

22.6 Multi-tenancy

23. 2026 Production Stack

Use case Default stack Notes
Code agent (IDE) Cursor / Cline / Continue + GPT / Claude Real-time pair-programming
SWE autonomous Devin / SWE-agent / Claude Code Long-horizon ticket-to-PR
Research agent ChatGPT Deep Research / Perplexity Pro / Gemini DR Multi-source synthesis
Computer use Claude Computer Use + sandboxed VM Full desktop control
Browser agent Browser-Use / Stagehand / OpenAI Operator Web tasks
Customer support Crew/Mastra agent + RAG + escalation Tier 1 automation
Background research LangGraph + cron + Slack delivery Async patterns
Multi-agent systems CrewAI / AutoGen / Claude agents SDK subagents Specialist roles
Document agents ColPali + LlamaIndex + GPT/Claude Multi-page docs
Voice agents Realtime API (OpenAI / Gemini Live) + tools Low-latency conversation
Tool-rich apps MCP servers + Claude / Cursor / VSCode Standard protocol
Stateful workflows LangGraph + checkpoint + human-in-loop Production-ready

Appendix A: Twenty-Five Things to Know

  1. ReAct loop: Thought \(\to\) Action \(\to\) Observation.
  2. Plan-and-Execute beats pure ReAct on long horizons.
  3. Reflexion: episodic reflection in memory.
  4. Tool description quality > tool implementation quality (model uses what it understands).
  5. JSON schema: prefer enums, shallow nesting, required fields.
  6. Always sandbox code execution; never assume safety.
  7. Treat tool outputs as untrusted (prompt injection defense).
  8. MCP standardizes tool discovery + invocation.
  9. Set-of-Mark prompting improves GUI click accuracy dramatically.
  10. Anthropic prompt caching: up to 90% cost savings on prefix.
  11. Continuous batching: per-token, not per-request, kernel batching.
  12. Re-rank with cross-encoder after vector retrieval.
  13. HyDE often beats raw question embedding for retrieval.
  14. GraphRAG wins for multi-hop on structured knowledge.
  15. Multi-agent only when single agent demonstrably worse.
  16. LangGraph for stateful production agents.
  17. DSPy for declarative, optimization-driven flows.
  18. Voyager skill library + auto-curriculum for open-ended learning.
  19. Always log per-step traces; replay-able trajectories.
  20. Doom loops: detect N-step repetition; back off / replan.
  21. Model routing: cheap-first cascade saves \(\sim 70\%\) cost.
  22. OSWorld / WebArena / SWE-bench for cross-domain agent eval.
  23. Human-in-loop for irreversible / high-stakes actions.
  24. CLAUDE.md / AGENTS.md for persistent project context.
  25. Don't use an agent when one well-prompted call suffices.

Appendix B: Decision Tree — "Which Agent Pattern?"

  1. Single tool call solves it? \(\to\) Function calling, no loop. Fastest, cheapest.
  2. Sequential multi-step but predictable? \(\to\) Plan-and-Execute with explicit plan.
  3. Variable structure, exploratory? \(\to\) ReAct loop.
  4. Long horizon (\(>10\) steps)? \(\to\) PAR + reflection + bounded budget.
  5. Specialized expertise needed? \(\to\) Multi-agent (manager-worker or society of mind).
  6. Web / GUI tasks? \(\to\) Computer-use VLM + Set-of-Mark + sandboxed VM.
  7. Code-heavy? \(\to\) Code agent (Aider / Cursor / Cline / Devin pattern).
  8. Research / synthesis? \(\to\) Deep Research pattern (multi-source + synthesis + citations).
  9. Persistent across sessions? \(\to\) LangGraph + memory + checkpointing.
  10. Real-time conversation? \(\to\) Realtime voice API + minimal tool palette.

Appendix C: Year-by-Year Agentic Milestones