From Homework Battles to Homework Bliss

Warning: This project may cause sudden outbreaks of "Dad!!, can I do MORE homework?" – proceed with caution.

My child has a mind that works like a beautiful, chaotic butterfly – flitting from one fascinating idea to another, connecting dots in ways that amaze me daily. But ask them to memorize multiplication tables? Suddenly, we're in the educational equivalent of trench warfare.

That's when I had my lightbulb moment: What if homework could actually be... fun? What if learning could adapt to how my kid's unique brain works, instead of forcing their square-peg mind into round-hole teaching methods?

So I did what any slightly obsessive parent with coding skills would do: I built an AI tutor from scratch.

Meet Your New Digital Study Buddy

Introducing the My-Tutor Personalized Learning System – a web-based personalized tutor that uses LangGraph and Ollama to generate adaptive learning paths and interactive content for students. Think of it as that one teacher who actually "gets" your kid, except it's available 24/7, never loses patience, and doesn't need coffee to function.

This isn't your typical flashcard app or boring drill-and-kill software. This is an intelligent tutoring system that learns how your child learns, adapts to their pace, and turns studying into something that feels more like having a conversation with a really smart friend.

The Magic Behind the Curtain

Here's where things get deliciously nerdy. This project features a Python FastAPI backend and a React frontend, built on some seriously impressive tech that would make even the most jaded software engineer do a little happy dance:

LangGraph Orchestration

LangGraph acts as the conductor of our AI orchestra, orchestrating complex workflows between different AI components. It manages the flow from initial assessment through personalized content generation, creating learning experiences that adapt in real-time based on how your child responds.

Ollama (Local LLM)

Here's the cool part – this AI tutor runs entirely on your own computer. No sending your child's learning data to some faceless corporation. No internet required (except for initial setup). No privacy concerns. Ollama running locally hosts powerful language models right on your machine, ensuring lightning-fast responses and complete data sovereignty.

FastAPI Backend

The backend handles requests faster than your kid can say "I'm bored." It manages knowledge base processing, generates personalized learning content, and serves up adaptive lessons with the efficiency of a Swiss watch.

React Frontend

Modern, responsive React UI makes learning feel as natural as texting a friend. The interface presents information beautifully, offers chat-style interactions, and makes the entire learning experience feel engaging and intuitive.

From Chaos to "Aha!"

Custom Knowledge Base

Here's what makes this system special: You can provide a specific URL or PDF to build a custom knowledge base for the tutor. The system will use this material to generate the learning path, content, and assessment, making the experience highly tailored to your chosen resource.

No more generic, one-size-fits-all content. Your child studying marine biology? Upload their textbook chapter. Learning about the Revolutionary War? Drop in a Wikipedia link. The AI tutor becomes an expert on exactly what your child needs to learn.

The Full Learning Experience

The system offers a comprehensive suite of features:

Knowledge Base Management:

  • Upload a URL or PDF to build a custom knowledge base (fully implemented)

  • Preview extracted knowledge base content

  • Generate a summary of the knowledge base in a chosen style (concise, poetic, bullet points, etc.)

Interactive Learning:

  • Ask questions about the knowledge base and get instant answers (KB Q&A)

  • Enter a topic and start an initial assessment (personalized question generation)

  • Interactive chat with the tutor (Q&A, feedback loop)

Adaptive Assessment:

  • Tutor checks your answers and provides feedback, corrections, and suggestions

  • All features work with your custom knowledge base (from URL or PDF)

Technical Architecture: The Engineering Behind the Magic

Project Structure That Actually Makes Sense

The project follows a clean, logical structure:

my-tutor/
├── backend/                    # FastAPI, LangGraph, Ollama integration
│   ├── main.py                # Main FastAPI application
│   ├── langgraph_flow.py      # LangGraph workflow definitions
│   ├── ollama_client.py       # Ollama integration layer
│   └── requirements.txt       # Python dependencies
├── frontend/                   # React web UI
│   ├── package.json          # Node.js configuration
│   └── src/
│       ├── App.js            # Main React application
│       └── index.js          # Application entry point
└── README.md                 # Project documentation

Getting Your Hands Dirty: Installation & Setup

Ready to build your own homework revolution? Here's the step-by-step guide to get your AI tutor up and running:

Prerequisites (The Shopping List)

  • Python 3.9+: Our backend's native language

  • Node.js 18+: Powers the frontend magic

  • Ollama running locally: Your local AI powerhouse

  • Git: For cloning the repository

  • 8GB+ RAM: The AI needs room to think

Quick Start Guide

Step 1: Get Ollama Running First, install and set up Ollama from https://ollama.com/. Ensure Ollama is running locally and accessible at http://localhost:11434.

Step 2: Backend Setup (The Brain Surgery)

bash

# Clone the revolution
git clone https://github.com/alankars/my-tutor.git
cd my-tutor

# Navigate to backend directory
cd backend

# Create and activate a Python virtual environment
python3 -m venv env
source env/bin/activate  # On Windows: env\Scripts\activate

# Install Python dependencies
pip install -r requirements.txt

# Start the FastAPI server
uvicorn main:app --reload --host 0.0.0.0 --port 8000

Step 3: Frontend Setup (The Makeover)

bash

# Open a new terminal and navigate to frontend
cd frontend

# Install Node.js dependencies
npm install

# Start the React development server
npm start

Step 4: Launch Your AI Tutor Open your browser and go to http://localhost:3000 to access the web UI.

Getting Started with Learning

Once everything is running, here's how to begin the learning journey:

  1. Enter a topic (e.g., "Introduction to Quantum Physics") and start the assessment

  2. Upload a URL or PDF to use your own material as the knowledge base

  3. Generate summaries, ask questions about your material, and interact with the tutor for personalized learning and feedback

The Homework Revolution

The entire project is open-source and available at my-tutor.

8
Subscribe to my newsletter

Read articles from Alankar Srivastava directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Alankar Srivastava
Alankar Srivastava