logo
P
Prompt Master

Prompt 大师

掌握和 AI 对话的艺术

Components

Core agent components: Planning, Tool Calling, and Memory

TL;DR

  • A working AI Agent needs at least 3 core components: Planning, Tool Utilization, and Memory.
  • Think of it this way: the LLM handles "thinking," tools handle "doing," and memory handles "remembering." All three together give you stable multi-step execution.
  • What actually separates good agents from bad ones usually isn't "using a stronger model" -- it's tool design, memory structure, and evaluation/observability.

Core Concepts

Agent Components

1) Planning: Giving the system long-chain execution ability

The goal of Planning isn't to make the LLM "think deeper." It's to make the system trackable, retryable, and recoverable:

  • Break tasks into completable subtasks (task decomposition)
  • Maintain an updatable plan (like a to-do list / task tracker)
  • On failure, retry / fallback instead of just outputting something that looks reasonable but can't be verified

Practical recommendations:

  • Have the agent output an explicit plan (structured is better), and update status after each step (todo / in_progress / done, etc.)
  • Add "finish criteria": define what conditions mean "done" to prevent infinite loops or premature endings

2) Tool Utilization: Turning "reasoning" into "verifiable action"

The core value of Tool Calling is verifiability and extensibility:

  • Need facts? Use search / database tools, don't rely on model memory
  • Need computation? Use code execution / calculator tools
  • Need to write to external systems? Use explicit write tools with allowlists and audit logs

Tool design tips (high ROI):

  • Keep tools few and focused: each tool has clear inputs/outputs and handles errors gracefully
  • Make tool schemas clear: so the LLM can easily pick the right tool and fill in the right parameters
  • Make tool return values citable: useful for downstream evaluation and debugging

3) Memory: Keeping state across turns and steps

Memory generally comes in two flavors:

  1. Short-term (Working) Memory
    • Stores context summaries for the current task, latest results, key constraints
    • Good for in-context learning and short-term iteration
  2. Long-term Memory
    • Typically implemented as a vector store / knowledge base
    • Used for cross-task reuse (user preferences, historical project knowledge, long-term notes)

Practical advice:

  • Don't dump all raw content into memory: prioritize storing "summaries needed for decisions + traceable references"
  • Design fixed templates for memory: e.g., facts / assumptions / open_questions / decisions

Self-check Rubric

  • Planning: Is the plan explicit? Any silent skips? Is there retry/fallback on failure?
  • Tool Calling: Any fabricated tool results? Can it handle tool errors correctly?
  • Memory: Can it reliably reuse key information? Is it writing noise into long-term memory?
  • Observability: Can you replay each step's input, output, tool calls, and state changes?

Practice

Exercise: Design a component checklist for a "customer support agent" (no code required).

  • Provide: tool list (read/write separated), memory structure (what goes in short-term vs. long-term), plan template (what fields it has).
  • Explain: which actions need human-in-the-loop (e.g., refunds, address changes, order cancellations).

References

Original (English)

AI agents require three fundamental capabilities to effectively tackle complex tasks: planning abilities, tool utilization, and memory management. Let's dive into how these components work together to create functional AI agents.

Agent Components

Planning: The Brain of the Agent

At the core of any effective AI agent is its planning capability, powered by large language models (LLMs). Modern LLMs enable several crucial planning functions:

  • Task decomposition through chain-of-thought reasoning
  • Self-reflection on past actions and information
  • Adaptive learning to improve future decisions
  • Critical analysis of current progress

While current LLM planning capabilities aren't perfect, they're essential for task completion. Without robust planning abilities, an agent cannot effectively automate complex tasks, which defeats its primary purpose.

Tool Utilization: Extending the Agent's Capabilities

The second critical component is an agent's ability to interface with external tools. A well-designed agent must not only have access to various tools but also understand when and how to use them appropriately. Common tools include:

  • Code interpreters and execution environments
  • Web search and scraping utilities
  • Mathematical calculators
  • Image generation systems

These tools enable the agent to execute its planned actions, turning abstract strategies into concrete results. The LLM's ability to understand tool selection and timing is crucial for handling complex tasks effectively.

Memory Systems: Retaining and Utilizing Information

The third essential component is memory management, which comes in two primary forms:

  1. Short-term (Working) Memory

    • Functions as a buffer for immediate context
    • Enables in-context learning
    • Sufficient for most task completions
    • Helps maintain continuity during task iteration
  2. Long-term Memory

    • Implemented through external vector stores
    • Enables fast retrieval of historical information
    • Valuable for future task completion
    • Less commonly implemented but potentially crucial for future developments

Memory systems allow agents to store and retrieve information gathered from external tools, enabling iterative improvement and building upon previous knowledge.

The synergy between planning capabilities, tool utilization, and memory systems forms the foundation of effective AI agents. While each component has its current limitations, understanding these core capabilities is crucial for developing and working with AI agents. As the technology evolves, we may see new memory types and capabilities emerge, but these three pillars will likely remain fundamental to AI agent architecture.