An autonomous AI learning coach with perfect memory that remembers not just what you learned, but how you learn. Uses dual-database architecture (PostgreSQL + Neo4j) to persist learning patterns, struggles, and breakthroughsโeven after complete system restart. Built for the "AI Agents with Memory" hackathon.
- Perfect Memory Persistence: Uses PostgreSQL with pgvector for semantic search and Neo4j for relationship-based memory
- Adaptive Teaching: AI agent learns from every interaction and adapts its teaching style
- Dual Practice Modes: Code practice with Monaco editor and quiz mode with confidence tracking
- Real-time Feedback: Personalized feedback that references past learning patterns
- Memory Dashboard: Transparent view into your learning data and patterns
- Restart Demo: Complete container restart with perfect memory recall
- Node.js 18+ and npm
- Docker and Docker Compose
- OpenAI API key (GPT-3.5-Turbo)
git clone https://github.com/ThilakNarasimhamurthy/ReflectAI.git
cd ReflectAI
npm installCopy the example environment file and configure your settings:
cp env.example .envEdit .env with your OpenAI API key:
OPENAI_API_KEY=sk-your-openai-api-key-here
NEXTAUTH_SECRET=your-random-secret-hereStart PostgreSQL and Neo4j using Docker Compose:
docker-compose up -dThis will:
- Start PostgreSQL with pgvector extension on port 5432
- Start Neo4j on ports 7474 (HTTP) and 7687 (Bolt)
- Initialize the database schemas automatically
npm run devThe application will be available at http://localhost:3000
In a separate terminal:
cd mcp-server
pip install -r requirements.txt
python main.pyThe MCP server will be available at http://localhost:8080
-
Setup Phase:
- Create account:
demo@hackathon.com/demo123 - Complete onboarding
- Practice JavaScript arrays challenge
- Make specific mistakes (off-by-one errors)
- Use hints and complete the challenge
- Create account:
-
Restart Phase:
docker-compose down docker-compose up -d
-
Payoff Phase:
- Log back in with same account
- Agent recalls everything: "Welcome back! Last time you struggled with array indexing..."
- Memory dashboard shows persistent data
- Next challenge targets your weak areas
PostgreSQL (Profile Memory):
memvergeprofile: Structured user knowledge with embeddingssession_history: Conversation logs and interactionscitations: Links profile knowledge to source conversationsusers: Authentication data
Neo4j (Relationship Memory):
- User, Session, Topic, Skill, Mistake, Breakthrough nodes
- Rich relationships showing learning patterns
- Graph queries for complex memory retrieval
- Data Ingestion Agent: Captures and structures user behavior
- Context Retrieval Agent: Intelligently queries memories from both databases
- Main Agent: Makes decisions using retrieved context + GPT-3.5 for language
- Frontend: Next.js 14, React 18, Tailwind CSS, Monaco Editor
- Backend: Next.js API Routes, OpenAI GPT-3.5-Turbo
- Databases: PostgreSQL with pgvector, Neo4j
- Infrastructure: Docker Compose, NextAuth
- Skills mastery levels with embeddings
- Learning preferences and styles
- Goals and objectives
- Semantic search across all memories
- User learning journey
- Topic relationships and prerequisites
- Mistake patterns and breakthroughs
- Session outcomes and progression
- Monaco editor with JavaScript syntax highlighting
- Real-time code execution via MCP server
- Test case validation
- Performance tracking (typing speed, pauses, mistakes)
- Multiple choice questions
- Confidence slider for each answer
- Immediate feedback with explanations
- Memory-referenced insights
- Calculate next practice topic based on skill levels
- Determine difficulty using mastery percentages
- Choose between code vs quiz based on recent activity
- All decisions are deterministic and fast
- Convert decisions into friendly messages
- Generate quiz questions from templates
- Create personalized feedback
- Explain concepts when asked
Four-panel layout showing:
- Overview Cards: Total memories, health status
- Profile Memory Table: Searchable, editable memories
- Knowledge Graph: D3.js visualization of Neo4j data
- Timeline: Chronological session history
ReflectAI/
โโโ src/
โ โโโ app/ # Next.js app router
โ โโโ components/ # React components
โ โโโ lib/ # Utilities and services
โ โโโ types/ # TypeScript definitions
โโโ mcp-server/ # Python FastAPI server
โโโ docker-compose.yml # Database orchestration
โโโ config.yaml # MemMachine configuration
# Development
npm run dev
# Database management
docker-compose up -d
docker-compose down
docker-compose logs postgres
docker-compose logs neo4j
# MCP Server
cd mcp-server
python main.py- Email: demo@hackathon.com
- Password: demo123
This project demonstrates:
- Perfect Memory Persistence: Survives complete container restart
- Dual Database Architecture: PostgreSQL + Neo4j working together
- GPT-3.5 Optimization: Fast, cost-effective AI responses
- Real-time Learning: Agent adapts after every interaction
- Transparent Memory: Users can inspect and edit their learning data
Built for the "AI Agents with Memory" hackathon. MIT License.
This is a hackathon project. For questions or issues, please open an issue on the repository.
Built with โค๏ธ for the AI Agents with Memory hackathon