Anatomy of an AI Agent: Goal, Model, Instructions, Memory and Tools
Prabhat
Aug 18, 20267 min read1 view
What you will learn: By the end of Day 2, you will be able to map an agent's goal, model, instructions, memory and tools - and explain why each part exists.
This lesson is part of the AI Agents in 30 Days roadmap. If you are joining today, start with Day 1: AI Agent vs Chatbot.
Advertisement
The mental model: five connected design decisions
An AI agent is not a single magical object. It is a system designed to pursue a goal. A practical beginner map has five parts:
Goal: What should the system achieve?
Model: What reasoning engine will interpret the task and choose the next response or action?
Instructions: What behavior, priorities and boundaries should guide it?
Memory: What useful context should remain available across steps or sessions?
Tools: What information should it retrieve, and what actions should it be able to perform?
This is a teaching model, not a claim that every framework uses these exact labels. OpenAI's current agent guidance describes models, instructions and tools as core design foundations, while SDK sessions provide an optional persistent-memory layer. See OpenAI's practical guide to building agents, the Agents SDK agent definition and the Agents SDK sessions guide.
1. Goal: define what success looks like
The goal gives the agent a destination. "Help me study" is vague. "Create a realistic seven-day study plan that covers two exam topics and includes breaks" is much clearer.
A useful goal describes the desired outcome without prescribing every step. The agent still needs room to reason, but it should know when its work is useful and when it is complete.
Ask:
What outcome should the user receive?
What constraints must be respected?
How will the system recognize completion?
2. Model: provide the reasoning engine
The model interprets the user's request and decides what to produce or do next. Different tasks may need different levels of reasoning, speed, context capacity or multimodal input.
Do not choose a model only because it is the largest available. First establish the quality you need, then test whether a smaller or faster model can meet it. The model is one component of the system; strong instructions and well-designed tools can matter just as much.
3. Instructions: define behavior and priorities
Instructions tell the agent how to approach its job. They can establish a role, decision rules, output structure, safety boundaries and what to do when information is missing.
For a Study Planner Agent, useful instructions might include:
Prioritize upcoming exams and deadlines.
Do not schedule more study time than the learner actually has.
Include realistic breaks.
Ask for missing availability instead of inventing it.
Explain any trade-off when every requested topic cannot fit.
Good instructions reduce ambiguity. They do not need to predict every possible situation.
4. Memory: carry the right context forward
Memory can help an agent retain useful information such as the learner's goals, completed topics or previous plan revisions. A session may preserve conversation history, while a longer-term memory design may store selected facts or lessons for later use.
Memory is not automatically beneficial. Saving everything can introduce stale information, privacy risk and irrelevant context. Decide what should be remembered, for how long, and how it can be corrected or deleted.
The current OpenAI Agents SDK documentation describes sessions as a persistent memory layer that retrieves earlier conversation items and stores new ones for later turns. That is one implementation pattern, not the only possible design. See the official sessions documentation.
5. Tools: let the agent retrieve or act
Tools connect the model to capabilities outside its built-in response generation. A tool might read a calendar, search notes, run a calculator, query a database or create a task.
Tool calling does not mean giving the model unrestricted access. Each tool should have a clear purpose, narrow inputs and appropriate permissions. Sensitive actions may also need human approval.
OpenAI's function-calling guide describes tools as functionality and data supplied by an application so a model can follow instructions beyond what it can do from its training data alone.
Complete example: a Study Planner Agent
Here is the Day 2 mental model applied to one practical agent:
Part | Study Planner design |
|---|---|
Goal | Create a realistic weekly plan that covers priority topics without exceeding available study time. |
Model | Interpret priorities, deadlines and availability; then propose a balanced plan. |
Instructions | Protect exam priorities, include breaks, avoid invented availability and explain trade-offs. |
Memory | Retain completed topics and accepted plan changes when that continuity is useful. |
Tools | Read calendar availability and, only with permission, write approved study blocks. |
Notice that the model is not the whole agent. The goal defines success, instructions shape behavior, memory supplies continuity and tools connect the plan to real information or actions.
Try this today: make an Agent Anatomy Map
Choose one task you might want an agent to handle. It could organize meeting notes, plan meals, research a purchase or revise a study schedule.
Write one sentence for each box:
Goal: What should success look like?
Model: What kind of reasoning is required?
Instructions: Which rules, priorities or boundaries matter?
Memory: What context should carry forward, if any?
Tools: What information or actions are genuinely required?
Then remove any component that does not help the goal. A smaller, clearer design is often easier to test and control.
Copyable completed exercise
Task: Help me maintain a realistic weekly study plan.
Goal: Produce a seven-day plan that covers priority topics without exceeding my available hours.
Model: Use a model capable of comparing deadlines, topic difficulty and available time.
Instructions: Prioritize the nearest exam, include breaks, never invent availability, and ask before dropping a topic.
Memory: Remember completed topics and plan changes I explicitly accept. Do not retain unrelated personal details.
Tools: Read my selected calendar availability. Ask for confirmation before writing or changing calendar events.
Common mistakes
Treating the model as the entire agent
A capable model without a clear goal, instructions or appropriate tools may still behave inconsistently.
Adding memory without a retention decision
Before storing information, decide what is useful, how long it should remain and how the user can correct or remove it.
Giving the agent too many overlapping tools
More tools increase choice and complexity. Start with the smallest set that supports the goal.
Writing instructions that conflict with the goal
If the goal asks for a realistic plan but the instructions demand that every topic fit regardless of available time, the system has no good answer. Make priorities explicit.
Designing no stopping condition
Define what a completed result looks like. Day 3 will build on this by turning the anatomy into an agent loop.
Quick knowledge check
1. Which component defines what success looks like?
The goal.
2. Does every agent require long-term memory?
No. Add memory only when useful context must persist.
3. What is the difference between instructions and tools?
Instructions guide behavior and decisions. Tools provide external information or actions.
4. Why should tools be narrow and clearly described?
So the system can choose them reliably and limit unnecessary access.
5. What should you remove from an Agent Anatomy Map?
Any component that does not help the system reach its goal.
Download the handwritten notes
Use the one-page notes as a quick revision sheet or print it beside your Agent Anatomy Map.
day-02-handwritten-notes.pdfContinue learning with Korshub
Korshub helps learners discover courses and course deals across official learning platforms. If this lesson reveals a gap in your AI, Python or software-development foundations, browse relevant options on Korshub and continue to the official course platform when you find a suitable course.
Course listings, prices and availability can change, so always confirm the current details on the official destination page before enrolling.
Series navigation
Previous: Day 1 - AI Agent vs Chatbot
Roadmap: AI Agents in 30 Days
Next: Day 3 - The Agent Loop
CMS and structured-data notes
Use
BlogPostingschema with the canonical URL from the frontmatter.Set the series roadmap as
isPartOf.Use
day-02-blog-thumbnail.pngas the social preview image.Embed
day-02-final.mp4near the top and exposeday-02-handwritten-notes.pdfin the notes section.Add the published Day 3 link only after its canonical page is live.
