AI Agents fundamentals · Lesson 1
What separates an agent from a chat
The key difference: an agent decides for itself what to do next and uses tools.
Definition
An agent is an LLM in a loop: the model gets a task, picks a tool, uses it, sees the result, and makes the next decision. The loop continues until the task is done (or until a stop criterion fires).
Core components
- The model. It thinks and chooses actions.
- Tools. Concrete functions the agent can call: search, fetch, write_file, call_api.
- Memory. State between steps.
- The controller. The loop that wraps all of this.
A simple example
"Find fresh news on topic X and make a digest."
- The agent calls the search tool.
- It gets 5 links.
- It decides which ones to go through.
- It calls the fetch tool on each.
- Once it has gathered everything, it generates the digest.
Where the complexity lives
- Knowing when to stop.
- Recovering after a tool error.
- The cost in tokens (the agent can fall into an infinite loop).
Practical exercise
What to do after this lesson
Build the simplest possible "digest agent": search → fetch → summary. On any framework (LangGraph / CrewAI / straight on the API).
Ready-to-use prompt
Template for this lesson
Copy and adapt to your context. Text in angle brackets should be replaced.
You are a research agent. You have these tools: - web_search(query) → 5 links - fetch(url) → page text - save_notes(text) → write a note Task: <…> Rules: - No more than 10 tool calls. - If data is ambiguous — flag it. - At the end — a digest and a list of open questions.
Common mistakes
What people get wrong
- The agent falls into an infinite loop — no stop criterion.
- Tools return junk — the agent confidently uses it.
- No token / step limit.
Pro tips
What works but no one documents
- A hard step budget.
- Every tool returns a clear status: success / error / partial.
- Log all steps, not just the final result.
When to use
Multi-step tasks where the LLM needs to make decisions "as it goes."
When not to use
One-shot tasks — a regular prompt is enough there.
Official sources
Квиз — 2 вопроса
1.What separates an agent from an ordinary chat?
2.What is mandatory for an agent?
Отвечено: 0 из 2