Day 10: Build a Study Planner Agent
Prabhat
Aug 27, 20266 min read3 views
Learning outcome: Build an agent that generates a realistic learning schedule and revises the remaining plan when progress changes.
This is Day 10 of AI Agents in 30 Days. It completes the first build phase by combining model calls, structured outputs, tools, and memory in one practical project.
Advertisement
The mental model: plan, track, revise
A basic schedule generator creates a timetable once. A Study Planner Agent continues working with the learner:
Plan: Turn the learner's goal, availability, and deadline into a schedule.
Track: Record which lessons are complete, missed, or still pending.
Revise: Change only the unfinished part of the schedule when progress changes.
The key idea is simple: the plan can change without changing the goal.
This does not mean every planner needs a complex framework or many tools. Start with the smallest system that can create a valid plan and revise it predictably.
Start with three inputs
Your first version needs only three pieces of information:
Input | Question | Example |
|---|---|---|
Goal | What should the learner finish? | Learn graph fundamentals |
Availability | When and for how long can they study? | One hour from Monday to Friday |
Deadline | When must the goal be completed? | Sunday evening |
You can add preferences later, such as session length, rest days, difficulty, or revision time. Do not collect fields that the first planner does not use.
How the parts work together
The Study Planner Agent combines the ideas from Days 6-9:
1. The model creates a draft
The model interprets the learner's request and proposes a sensible distribution of topics. Your instructions should explain the planner's goal, constraints, and revision rules.
2. Structured output makes the plan usable
Instead of receiving a paragraph, ask for predictable fields such as date, topic, minutes, and status. A schema-constrained output makes it easier for application code to display, validate, save, and revise the schedule. OpenAI's Structured Outputs guide explains how schema adherence differs from merely receiving valid JSON.
If your model or provider does not support schema-constrained output, validate the returned data in your application before saving or using it.
3. A tool handles deterministic calculations
The model can request a small function such as calculateAvailableMinutes instead of guessing how many hours fit before the deadline. In a function-calling flow, the model requests a tool, your application executes it, and the result is returned to the model. See the official Function Calling guide for the full request-execute-return cycle.
A tool is useful here because date and duration calculations should be deterministic. It is not necessary for every part of the planner.
4. Memory preserves progress
Save the learner's current plan and completion status. On the next interaction, the planner should know what has already been completed instead of rebuilding everything from the original request.
Conversation state can help preserve interaction context, while durable application data should hold important planner records such as goals, schedules, and completion status. The Conversation State guide describes how conversation items can persist across interactions in the Responses API.
Practical example: Tuesday's graph lesson was missed
Suppose the original plan is:
Day | Topic | Status |
|---|---|---|
Monday | Arrays review | Complete |
Tuesday | Graph fundamentals | Missed |
Wednesday | Dynamic programming practice | Pending |
Thursday | Graph traversal problems | Pending |
Friday | Weekly review | Pending |
A poor revision discards the full schedule and starts again. That may repeat completed work or silently move the deadline.
A better revision rule is:
Keep Monday marked as complete.
Move the unfinished graph lesson to the next available slot.
Shift or shorten only the remaining pending sessions.
Keep the deadline visible.
Ask the learner before making a trade-off that violates a hard constraint.
The revised plan could become:
Day | Topic | Status |
|---|---|---|
Monday | Arrays review | Complete |
Tuesday | No study session | Missed |
Wednesday | Graph fundamentals | Moved here |
Thursday | Dynamic programming practice | Pending |
Friday | Graph traversal and weekly review | Pending |
The exact revision depends on the learner's available time. The important behavior is that the agent preserves progress and explains what changed.
A completed planner design you can copy
{
"goal": "Learn graph fundamentals",
"availability": {
"days": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"minutesPerDay": 60
},
"deadline": "Sunday 18:00",
"sessions": [
{
"day": "Wednesday",
"topic": "Graph fundamentals",
"minutes": 60,
"status": "moved"
}
],
"revisionRule": "Keep completed sessions and move unfinished work to the next available slot"
}
Your application should validate the fields, calculate available time, store progress, and show the learner the proposed revision before saving it.
A simple agent loop
Receive goal, availability, and deadline
-> calculate available study time
-> generate a structured schedule
-> validate the schedule
-> save the plan
-> record learner progress
-> revise only unfinished sessions when progress changes
Define a clear stop condition: the agent stops when it has produced a valid plan or a valid revision. It should ask for help when it cannot meet the deadline without breaking a constraint.
Try this today
Write these three inputs for your own Study Planner Agent:
Study goal: What do you want to finish?
Weekly availability: Which days and how many minutes are available?
Revision rule: What should happen when you miss one session?
Then test the planner with this update:
I completed Monday's session but missed Tuesday. Revise only the remaining plan and keep my deadline unchanged.
Check whether it preserves completed work, explains the changes, and avoids inventing extra study time.
Optional build exercise
Create four small components:
A plan schema with day, topic, minutes, and status.
A function that calculates available minutes before the deadline.
A store for goals, plans, and completion status.
A revision instruction that keeps completed sessions unchanged.
Test the system with a normal week, a missed session, no remaining free slot, and an impossible deadline.
Common mistakes
Generating prose instead of a plan
A motivational paragraph is difficult for code to save or revise. Return structured sessions with explicit fields.
Letting the model calculate everything
Use application code for deterministic time and date calculations. The model should interpret the goal and propose trade-offs, not invent arithmetic.
Treating chat history as the only database
Important progress data should have a durable representation that your application can validate and retrieve.
Restarting after every change
Preserve completed work. Revise only the pending part of the plan unless the learner explicitly requests a full reset.
Hiding impossible constraints
If the available time is insufficient, the agent should explain the conflict and ask the learner to change the deadline, scope, or availability.
Knowledge check
1. Why use structured output for the schedule?
So application code can validate, display, save, and revise predictable fields.
2. What belongs in a tool?
Deterministic work such as calculating available minutes or checking date ranges.
3. What should happen to completed sessions during revision?
They should remain complete unless the learner explicitly resets them.
4. When should the agent ask for help?
When it cannot satisfy the goal, availability, and deadline without breaking a hard constraint.
Download the handwritten notes
day-10-handwritten-notes.pdfDownload the Day 10 handwritten notes
Keep learning with Korshub
Korshub helps learners discover courses and compare available learning options across course platforms. Browse relevant AI and software-development courses on Korshub, then use your Study Planner Agent to turn a chosen learning goal into a realistic schedule.
Course listings, prices, and availability can change. Continue to the official course platform to confirm current details before enrolling.
Series navigation
Previous: Day 9 - Memory and Sessions
Roadmap: AI Agents in 30 Days