Skip to content

ShireenMeher/cf_ai_study_planner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Study Coach (Cloudflare Agents)

A stateful AI study planning application built on Cloudflare Agents. The system generates personalized study plans, persists the latest plan using Durable Objects, supports context-aware plan refinement across conversations, streams responses in real time, and schedules study tasks through workflow-style tool execution.

Designed to simulate how real-world AI assistants manage evolving user context and long-running workflows.


🧠 AI generates a personalized study plan

Plan screenshot


⚡ Quick-start prompts for easy interaction

Home Screenshot


⏰ Built-in task scheduling & reminders

Reminder Screenshot


Why this project

Most AI applications today are stateless — they lose context across interactions.

This project demonstrates how to build a stateful AI system at the edge, where:

  • user context persists across sessions
  • plans can be incrementally refined
  • tasks can be scheduled and executed asynchronously

Features

  • Conversational study planning using Workers AI (LLM)
  • Persistent memory using Durable Objects
  • Iterative plan refinement (context-aware updates)
  • Task scheduling and execution (workflow support)
  • Real-time streaming chat UI
  • Stateful Plan Memory (WOW factor):
    • Stores the latest study plan in agent state
    • Allows retrieval via natural language ("What’s my current plan?")
    • Enables structured plan evolution across multiple turns

Stateful Plan Memory (Key Highlight)

Unlike traditional chat-based apps, this system persists the latest generated plan explicitly in agent state.

This enables:

  • retrieving the current plan at any time
  • updating plans incrementally
  • maintaining continuity across interactions

Example: User: Make me a plan → Plan generated

User: Make Wednesday lighter → Plan updated

User: What’s my current plan? → Retrieved from persistent state


Architecture

User → Pages UI → Agent (Durable Object) → Workers AI ↳ Persistent State (latestPlan) ↳ Scheduling (tasks/workflows)


Example Flow

  1. User: “I have an exam in 5 days…”
  2. Agent generates structured study plan
  3. User: “Make Wednesday lighter”
  4. Agent revises plan using memory
  5. User: “What’s my current plan?”
  6. Agent retrieves plan from persistent state
  7. User: “Remind me tomorrow at 9 AM”
  8. Agent schedules task using workflow

Tech Stack

  • Cloudflare Agents (stateful AI agents)
  • Durable Objects (persistent memory)
  • Workers AI (LLM inference at the edge)
  • Vite + React (frontend)
  • Zod (tool validation)
  • AI SDK (streaming + tool execution)

Key Engineering Concepts

  • Stateful agent design using Durable Objects
  • Tool-based LLM interaction (getCurrentPlan, scheduleTask)
  • Context pruning for efficient inference
  • Separation of conversational memory vs persistent state
  • Event-driven workflow execution (scheduled tasks)

Why Cloudflare

This project leverages Cloudflare’s edge-native architecture:

  • Durable Objects → stateful agents
  • Workers AI → low-latency inference
  • Built-in scheduling → long-running workflows

It demonstrates how AI systems can evolve from:

stateless APIs → persistent, interactive agents at the edge


How to run locally

Clone the repository:

git clone git@github.com:ShireenMeher/cf_ai_study_planner.git

Navigate into the project directory

cd cf-ai-study-planner

Install dependencies

npm install

Start the development server

npm run dev

Open in browser

Visit: http://localhost:5173

Live Demo

Here is a link where you can access the agent live:

https://cf-ai-study-planner.shireenmeher296.workers.dev

Future Improvements

  • Plan versioning (compare old vs new)
  • Recurring schedules (daily study reminders)
  • Browser notifications for reminders
  • Multi-user plan isolation

Summary

This project demonstrates how to build production-style AI systems, not just chatbots — combining:

  • memory
  • workflows
  • tool usage
  • and edge-native execution

into a cohesive, stateful experience.

About

Stateful AI study coach on Cloudflare Agents with persistent plan memory, Workers AI inference, tool calling, streaming chat, and scheduled workflow execution.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors