Inspiration

Existing AI learning platforms forget everything between sessions. I wanted to build an AI tutor with genuine memory—one that remembers not just what you learned, but how you learn, even after a complete system restart.

What it does

ReflectAI is an AI learning coach with perfect memory powered by MemMachine—a dual-database memory system that stores and retrieves your learning patterns.

Core Features:

Week 1 Pattern Discovery: Tracks reading pace, engagement, and resource preferences to build your learning profile Week 2+ Personalization: Adapts content difficulty, pacing, and resources based on discovered patterns Memory Persistence: Survives system restarts—MemMachine ensures AI remembers your journey Dynamic Learning Paths: AI-generated content with validated YouTube videos and curated documentation Memory Transparency: Purple badges show why content was chosen based on your history

MemMachine Architecture:

PostgreSQL + pgvector: Stores structured profile data (reading_pace: fast, prefers: video) with semantic search Neo4j: Maps relationships (STRUGGLED_WITH: loops, EXCELLED_AT: data_structures, REQUIRES: arrays) Data Ingestion Agent: Captures behavior (clicks, time spent, pauses) and structures it into memory nodes Context Retrieval Agent: Queries both databases to build rich context for AI decisions

How we built it

Tech Stack: Next.js 14, React, TypeScript, TailwindCSS OpenAI GPT-4o for content generation PostgreSQL (pgvector) + Neo4j for MemMachine Docker Compose for orchestration

MemMachine Flow:

User learns Day 1 → Behavioral tracker captures reading time (45s), video clicks (2), hover patterns Ingestion Agent → Stores {tag: 'reading_pace', value: 'thorough', embedding: [...]} in PostgreSQL + (User)-[:PREFERS]->(Video) in Neo4j User starts Day 2 → Retrieval Agent queries: "What resources did user prefer?" → Returns video preference AI generates content → Uses memory context to include more videos, adjust difficulty System restarts → All memory persists in databases User returns → Retrieval Agent rebuilds context from memory → AI continues personalization seamlessly

Challenges we ran into

OpenAI Rate Limits: Truncated memory context to essential highlights only Auto-Completion Bugs: Implemented first-render flag to prevent unintended completions Video Embedding: Built validation system using YouTube oEmbed API Content Repetition: Pass previous topics + unique seeds to AI prompts Memory Structure: Standardized JSONB keys (week_1.day_1) with extensive logging

Accomplishments that we're proud of

✅ Restart Demo Works: Stop containers, restart system—AI still knows your learning style ✅ Dual-Database Success: PostgreSQL + Neo4j working together for rich memory ✅ Memory Transparency: Users see why content was chosen via UI badges ✅ Behavioral Tracking: Goes beyond completion to how you learn ✅ Real Resources: Every video validated, every doc link curated

What we learned

Dual databases excel for AI memory: PostgreSQL for facts, Neo4j for relationships Truncated context > full context: Quality beats quantity for AI decisions Explicit user control matters: Completion should be user-driven, not automatic Validation is critical: Always verify external resources before displaying

What's next for ReflectAI

Immediate: Enhanced restart demo with memory survival metrics Interactive knowledge graph visualization Week 3+ compounding adaptation logic

Long-term: Multi-language support (25+ programming languages) Spaced repetition using memory patterns Cross-platform learning memory (code → math → languages) Open memory standard for the learning industry

MemMachine proves AI can have genuine memory—not just progress tracking, but true understanding of how you learn. Even after restart.

Built With

  • docker-compose
  • neo4j
  • next.js-14-(typescript
  • nextauth.js
  • oembed
  • openai-gpt-4o-+-embeddings
  • postgresql-(pgvector)
  • react
  • tailwindcss)
  • youtube
Share this project:

Updates