https://studymode-ai.vercel.app/
StudyMode is an AI-powered learning extraction system designed to improve reasoning, clarity, and depth of understanding.
Instead of behaving like a traditional chatbot that gives direct answers, StudyMode acts as a cognitive refinement system that helps users:
- structure raw thoughts
- strengthen mental models
- refine reasoning
- transform vague understanding into clear knowledge
The goal is not passive consumption. The goal is deeper thinking.
Most AI tools optimize for answer generation.
StudyMode optimizes for:
- reasoning
- reflection
- structured understanding
- knowledge extraction
The system is intentionally designed to:
- slow down shallow thinking
- force causal reasoning
- encourage active recall
- build connected mental models
It acts as a thinking amplifier rather than an answer machine.
graph TD
A[User Input] --> B[Next.js Frontend]
B --> C[API Route /api/chat]
C --> D[Authentication Layer]
D --> E[Rate Limiting Layer]
E --> F[Conversation Builder]
F --> G[System Prompt Engine]
G --> H[Gemini AI API]
H --> I[Response Processor]
I --> J[Structured Learning Output]
J --> B
B --> K[Generate Post API /api/generate]
K --> L[Prompt Transformation Layer]
L --> H
H --> M[LinkedIn Style Post Output]
M --> B
- AI-powered reasoning refinement
- Structured learning outputs
- Mental model focused responses
- Active recall oriented conversation flow
- System guided reasoning instead of direct answers
- Centered chat layout inspired by Claude
- Persistent sidebar (UI-level only, no database persistence yet)
- Dark / Light theme toggle system
- Chat-first minimal interface design
- Responsive input dock with action buttons
- Converts learning sessions into structured posts
-
insights
-
pain points
-
analogies
-
realizations
-
Generates LinkedIn-style educational content
- Backend-only AI execution
- Environment variable protection
- Global AI kill switch
- API route protection
- Google OAuth authentication via NextAuth.js (session-based authentication)
- Session-based user identity system
- Request rate limiting
- Structured backend logging (console-based; no external observability pipeline yet)
- Production-aware request handling
- Redis-based request rate limiting (Upstash / Redis-compatible store)
- Redis-based global cost budgeting system (atomic reservation)
- Daily AI cost budgeting per user
- Prevents uncontrolled API billing
- Token usage estimation before AI execution
- Blocks requests when estimated cost exceeds budget
Google OAuth supports both environments:
http://localhost:3000/api/auth/callback/google
https://studymode-ai.vercel.app/api/auth/callback/google
Both must be configured in Google Cloud Console.
- Vercel deployment pipeline
- CI/CD through GitHub integration
- Environment-separated configuration
- Serverless backend architecture
The following must be configured in Vercel:
- GOOGLE_CLIENT_ID
- GOOGLE_CLIENT_SECRET
- NEXTAUTH_SECRET
- NEXTAUTH_URL (production URL)
- GEMINI_API_KEY
- REDIS_URL
- Next.js App Router
- React
- TypeScript
- Tailwind CSS
- Next.js API Routes
- Rate Limiting Layer
- Structured Logging System
- Google Generative AI (Gemini)
- Vercel
- GitHub CI/CD
- User enters raw thought or confusion
- Request passes Google OAuth (NextAuth session layer)
- Request passes rate limiting layer (Redis)
- Token usage is estimated before AI execution
- AI cost budget is validated (Redis stored quota)
- Prompt engine constructs structured reasoning prompt
- Gemini processes request
- Response is returned with usage metadata
- Usage is stored for daily tracking
- User completes learning session
- Conversation history is transformed into structured context
-
insight
-
struggle
-
analogy
-
realization
-
System generates LinkedIn-ready educational content
The system is built around strict reasoning constraints.
- No shallow direct answers
- Force reasoning before explanation
- Encourage active recall
- Use real-world analogies
- Preserve user-generated insight
- Avoid replacing user thinking
- Build connected mental models
- One deep concept at a time
The AI is intentionally constrained to improve cognitive depth rather than maximize convenience.
graph TD
A[User Request] --> B[Auth Layer]
B --> C[Rate Limit Layer<br/>Redis - requests]
C --> D[Token Estimation Layer]
D --> E[Cost Budget Check<br/>Redis - tokens]
E --> F[AI Execution<br/>Gemini]
F --> G[Usage Logging<br/>Redis]
G --> H[Response]
Handles:
- learning extraction pipeline
- conversation orchestration
- reasoning enforcement
- prompt construction
- AI interaction
- backend protection layers
- request rate limiting
Handles:
- post generation pipeline
- structured transformation of learning sessions
- insight extraction
- content refinement
- LinkedIn-style formatting
No new ideas are introduced during generation.
The pipeline only transforms user-generated understanding.
- Backend-only AI calls
- Protected API routes
- Environment variable isolation
- Global AI kill switch
- Request rate limiting
- Structured logging
- Request-level observability
- CI/CD deployment pipeline
- Serverless infrastructure awareness
- Separation of concerns
- Modular AI pipeline design
- Stateless serverless architecture
- Protection before execution
- Observability over assumptions
- UI and backend are decoupled; UI state is currently ephemeral and will later support persistent storage
The system is a production-capable MVP with core safety and cost-control architecture implemented.
- Observability is limited to structured logging only (no tracing or monitoring dashboards)
- No distributed quota coordination (single Redis instance)
- Cost enforcement is based on token estimation, not real-time billing reconciliation
- No automated anomaly detection or abuse detection system
- Chat persistence layer is not implemented (no database storage)
- Sidebar chat history is UI-only and resets on refresh
🟡 Production-Ready MVP Stage
- Authentication
- Rate limiting
- Cost control
- AI pipeline architecture
- Deployment pipeline
- Persistent storage layer
- Observability stack
- Analytics dashboard
- Multi-session memory system
- Persistent database layer
- Distributed quota coordination
- Request tracing system
- Metrics and monitoring dashboards
- Persistent learning history
- Personal knowledge graph
- Spaced repetition system
- Session memory
- AI-generated revision cards
- Multi-model support
- Claude integration
- GPT integration
- Model routing system
- Personalized prompting systems
- Usage analytics dashboard
- Subscription system
- Token usage tracking
- User-level quotas
- Exportable learning archives
StudyMode is built around one core belief:
Better learning comes from better thinking.
The system is designed to help users:
- observe their reasoning
- strengthen understanding
- identify gaps
- connect concepts
- think from first principles
The objective is not answer generation.
The objective is cognitive amplification.
The system prioritizes user cognitive quality over response speed, but UI is optimized to feel real-time through streaming simulation techniques.