LLM call thuần — input vào, output ra, 1 lượt. Không có bộ nhớ ngoài context, không tương tác bên ngoài.
AI Agent = LLM đóng vai trò "brain" kết hợp với tools (truy cập thế giới bên ngoài), memory (state qua nhiều turn), và loop/planner (tự quyết định hành động tiếp theo). Model tự lặp:
- Quan sát task.
- Lập kế hoạch.
- Gọi tool.
- Đọc kết quả.
- Lặp lại cho đến khi xong.
Cấu trúc điển hình:
- LLM core: model sinh decision (Claude, GPT-4, Gemini...).
- Tools: search, calculator, code executor, DB query, API call, file I/O.
- Memory: short-term (conversation), long-term (vector DB), working (scratchpad).
- Orchestrator: vòng lặp Thought→Action→Observation, quản lý state, retry, timeout.
Ví dụ agent: trợ lý code (Cursor, Cline, Claude Code), research assistant (Perplexity, GPT Researcher), customer support agent, data analyst agent.
Khi nào cần agent (không overkill): task nhiều bước không xác định trước, cần interact với nhiều hệ thống, cần adapt theo kết quả trung gian. Task đơn giản (format JSON, classify, tóm tắt) — KHÔNG cần agent.
Plain LLM call — input in, output out, single shot. No memory beyond the context, no external interaction.
AI Agent = LLM as a "brain" combined with tools (access the outside world), memory (state across turns), and a loop/planner (decides the next action). The model loops through:
- Observes the task.
- Plans.
- Calls tools.
- Reads results.
- Iterates until done.
Typical structure:
- LLM core: model making decisions (Claude, GPT-4, Gemini...).
- Tools: search, calculator, code executor, DB query, API calls, file I/O.
- Memory: short-term (conversation), long-term (vector DB), working (scratchpad).
- Orchestrator: Thought→Action→Observation loop, state, retries, timeouts.
Examples: code assistants (Cursor, Cline, Claude Code), research assistants (Perplexity, GPT Researcher), customer support agents, data analyst agents.
When an agent is justified (not overkill): multi-step tasks with unknown steps in advance, multi-system interaction, branching based on intermediate results. Simple tasks (JSON format, classification, short summary) — do NOT need an agent.