Phase 4: Agentic AI
Give the model tools and a loop. A chat model only writes text. An agent also takes actions: it calls a tool, reads the result and decides what to do next. Building one from scratch shows what agent frameworks do for you, and where agents break.
After this phase you can
- Write a tool-calling loop with a step cap
- Add short-term and long-term memory to an agent
- Split work across several agents and add guardrails
Before you start: Phase 3, especially context windows, hallucination and prompting. Python functions, dicts and JSON.
Lessons in this phase
- What is an AI Agent? Beginner · 7 min
An AI agent is an LLM running in a loop that decides which actions (tool calls) to take, sees the results, and keeps going until the goal is done.
- Tool Calling Beginner · 8 min
Tool calling is how an LLM asks your program to run a function for it, by outputting the tool's name and arguments in a structured format.
- Function Calling Beginner · 8 min
Function calling is the OpenAI-style name for tool calling: the model returns a function name plus JSON arguments, and your code maps that to a real function and runs it.
- ReAct Pattern Intermediate · 9 min
ReAct (Reason + Act) is an agent pattern where the model alternates between writing a short thought, taking an action with a tool, and reading the observation, until it can answer.
- Planning Agents Intermediate · 8 min
A planning agent first writes a list of steps for the whole task, then executes them one by one, re-planning if something goes wrong.
- Reflection Intermediate · 8 min
Reflection is when an agent reviews its own output (or gets feedback from a critic), writes down what went wrong, and tries again using that feedback.
- Memory Beginner · 8 min
Agent memory is everything your code stores and feeds back to the model so it can use past information, because the model itself forgets everything between calls.
- Short-term Memory Beginner · 6 min
Short-term memory is the recent conversation (and tool results) that you re-send to the model on every turn, usually trimmed to a window so it fits the context.
- Long-term Memory Intermediate · 7 min
Long-term memory is information an agent saves outside the model (in a database or file) so it can search and reuse it in future sessions.
- Semantic Memory Intermediate · 6 min
Semantic memory stores stable facts (about the user, the world, or the domain) that stay true across conversations, such as "Asha's timezone is IST".
- Episodic Memory Intermediate · 7 min
Episodic memory is a log of the agent's past experiences (what task it tried, what it did, and how it turned out) that it can recall to do better next time.
- Agent Loops Intermediate · 8 min
The agent loop is the code that repeatedly calls the model, runs the tools it asks for, feeds back the results, and decides when to stop.
- Multi-Agent Systems Advanced · 9 min
A multi-agent system splits a job across several LLM "agents", each with its own role, prompt, and tools, that pass work between them.
- Human in the Loop Intermediate · 7 min
Human in the loop (HITL) means the agent pauses at chosen points so a person can approve, edit, or reject what it is about to do.
- Agent Evaluation Advanced · 9 min
Agent evaluation is measuring, with a fixed set of test tasks, whether an agent reaches the right outcome, takes sensible steps, and stays within cost, time, and safety limits.
- Agent Guardrails Advanced · 9 min
Guardrails are checks in your code that limit what an agent can see and do (allowed tools, valid arguments, step and cost limits, input and output filters), no matter what the model decides.