Team - Target Team Leader:Thanush J Team Members: Shishir R bangera , Danish Hussain Anvith S Shetty
An AI-Powered Personal Journaling Application with Autonomous Reminder Creation
MIRA is a production-ready personal journaling web application that uses a local AI model (Llama3) to automatically analyze your journal entries, extract insights, detect future events, and create calendar reminders autonomously with intelligent 3-layer duplicate prevention.
Agentic AI with Memory - MIRA uses intelligent AI that doesn't just extract events from your journalsβit makes autonomous decisions about which events deserve reminders by:
- Analyzing your recent journal history for behavioral patterns
- Detecting semantic duplicates (understands "client demo" = "preparing for demo")
- Autonomously deciding priority levels based on context and urgency
- Enhancing event descriptions with preparation notes from your journal content
- 3-Layer Duplicate Prevention system (rule-based + AI semantic + database) ensures zero duplicate reminders
- Auto-Save: Automatically saves journals 2 seconds after you stop typing
- Auto-Analysis: Automatically analyzes journals 5 seconds after typing stops using local Llama3 LLM
- Semantic Understanding: Deep semantic analysis using Llama3 (Temperature: 0.15 for consistent results)
- Natural Language Event Detection: AI detects future events from conversational text:
- "I have a meeting tomorrow at 3pm"
- "Dentist appointment on December 12 at 10am"
- "Submit report by Friday at 5pm"
- Intelligently ignores vague mentions and past events
The AI agent autonomously manages your reminders through intelligent decision-making:
Context-Aware Decision Making:
- Receives your current journal entry plus last 5 journal entries for pattern recognition
- Accesses all existing reminders for comprehensive duplicate detection
- Analyzes detected events against your personal history
Autonomous Intelligence:
- Decides
shouldCreate: true/falsefor each detected event - Assigns priority levels (high/medium/low) based on context
- Adds intelligent preparation notes from journal context
- Filters casual mentions and duplicate events automatically
3-Layer Duplicate Prevention System:
- Pre-Filter (Rule-Based): Same date + similar title detection (~70% of duplicates caught)
- AI Semantic Analysis: Llama3 understands "client demo" = "preparing for demo" = "demo with client"
- Database Safety Net: Unique constraints prevent any edge cases
Real Example:
User writes: "Working on project. Client demo on the 25th at 3pm. Still preparing for the demo."
AI Processing:
- Detects: "Client demo" and "preparing for the demo" (same date)
- Decides: Create 1 reminder (filters duplicate mention)
- Enhances: "Client demo - Prepare slides, test environment, review features"
- Priority: HIGH (based on context)
- Activity Categorization: Productive, unproductive, and restful activities with semantic understanding
- Emotional Intelligence: Detects explicit emotions and reads emotional tone from context
- Personalized Suggestions: 3-5 actionable recommendations tailored to your journal content
- Sentiment Analysis: Overall mood detection (positive/neutral/negative)
- One-click OAuth 2.0 secure authentication
- Auto-sync AI-created reminders without manual intervention
- Timezone-aware event creation (defaults to Asia/Kolkata, customizable)
- Each event includes AI-enhanced descriptions with preparation notes
- Automatic popup (30min) and email (60min) reminders
- Real-time sync status with calendar links
- Create, read, update, and delete journal entries
- Auto-save technology (2-second delay prevents data loss)
- Sequential journal numbering (#1, #2, #3...)
- Streak tracking for consecutive journaling days
- Delete confirmation for safety
Built with Chart.js for beautiful data visualization:
- Real-time Stats: Total journals, current streak, completed tasks, upcoming events
- Productivity Chart: 7-day activity visualization with interactive tooltips
- Yesterday's Summary: Quick preview with sentiment analysis
- Activity Timeline: Recent journals and reminders in chronological order
- Comprehensive reminder viewing with smart filters (Today/Upcoming/Past/Cancelled)
- Detailed event cards displaying:
- Full event information with date/time
- Status badges (proposed/synced/completed/cancelled)
- AI reasoning explanations
- Direct Google Calendar links (when synced)
- Quick complete/delete actions
- Create, update, and delete todos with ease
- Manual drag-and-drop reordering
- AI Prioritization Engine:
- Llama3 analyzes all incomplete todos
- Considers due dates, urgency, and task context
- Intelligently ranks and reorders based on importance
- Due date/time support with smart sorting
- Visual completion tracking
- Real-time voice transcription in journal editor
- Continuous recording mode with live feedback
- Interim and final transcription results
- Seamless text insertion at cursor position
- JWT-based authentication system (30-day token expiration)
- bcrypt password hashing for maximum security
- Protected routes with automatic login redirect
- Per-user OAuth tokens stored securely in MongoDB
- Each user connects their own Google Calendar account
- Node.js + Express.js 4.18.2 - RESTful API server
- MongoDB Atlas + Mongoose 8.19.3 - Cloud NoSQL database
- Ollama + Llama3 8B - Local AI model (Temperature: 0.15, JSON format)
- Google Calendar API v3 - OAuth 2.0 + Event synchronization
- JWT + bcryptjs - Secure authentication and password hashing
- Axios, Multer, CORS - HTTP client, file handling, cross-origin support
- Pure Vanilla JavaScript (ES6+) - Zero framework overhead
- HTML5 + CSS3 - Modern glassmorphism design
- Hash-based SPA Routing - Seamless navigation (#/dashboard, #/journals, #/events, #/todos)
- Native Fetch API - JWT-authenticated HTTP requests
- Chart.js 4.4.0 - Beautiful data visualization
- Web Speech API - Browser-native voice input
- User Model: Authentication, OAuth tokens, timezone preferences
- Journal Model: Content, AI analysis results, streak tracking
- Reminder Model: Events, calendar sync status, AI metadata
- Todo Model: Tasks, priority scores, completion status
/MIRA
βββ backend/
β βββ config/
β β βββ db.js # MongoDB Atlas connection
β βββ models/
β β βββ User.js # User schema with OAuth tokens
β β βββ Journal.js # Journal schema with AI analysis
β β βββ Reminder.js # Reminder schema with calendar sync
β β βββ Todo.js # Todo schema with AI prioritization
β βββ routes/
β β βββ authRoutes.js # Authentication endpoints
β β βββ journalRoutes.js # Journal CRUD + AI analysis
β β βββ reminderRoutes.js # Reminder management
β β βββ calendarRoutes.js # Google Calendar OAuth & sync
β β βββ todoRoutes.js # Todo CRUD + AI prioritization
β βββ controllers/
β β βββ authController.js # Signup, login, getMe
β β βββ journalController.js # Journal operations + AI analysis
β β βββ reminderController.js # Reminder operations + calendar sync
β β βββ calendarController.js # OAuth flow + Google Calendar API
β β βββ todoController.js # Todo operations + AI prioritization
β βββ services/
β β βββ ollamaService.js # Llama3 AI integration (834 lines)
β βββ middleware/
β β βββ authMiddleware.js # JWT authentication middleware
β βββ .env # Environment variables (NOT in git)
β βββ package.json # Backend dependencies
β βββ server.js # Express server entry point
β
βββ frontend-vanilla/ # ACTIVE FRONTEND
β βββ js/
β β βββ pages/
β β β βββ landing.js # Landing page
β β β βββ login.js # Login/signup page
β β β βββ journals.js # Journal list with streak
β β β βββ journal-view.js # Journal editor with AI
β β β βββ dashboard.js # Dashboard with Chart.js
β β β βββ events.js # Events management
β β β βββ todos.js # Todo list with AI prioritization
β β β βββ calendar-connected.js # OAuth success
β β βββ components/
β β β βββ navbar.js # Reusable navigation bar
β β βββ api.js # API client with JWT auth
β β βββ auth.js # Authentication utilities
β β βββ router.js # Hash-based SPA routing
β β βββ app.js # Application entry point
β βββ index.html # Main HTML file
β βββ styles.css # Global styles (1400+ lines)
β
βββ Main/HomePage/ # Static homepage
βββ home.html
βββ home.css
βββ home.js
- Node.js (v18+) - Download here
- MongoDB Atlas account - Free tier signup
- Ollama + Llama3 - Install guide
- Google Cloud account (for Calendar) - Console
1. Install Ollama and Llama3
# Download Ollama from https://ollama.ai
# After installation:
ollama pull llama3
ollama list # Verify installation2. Clone and Setup Backend
cd backend
npm install
# Create .env file with your credentials
# See .env.example for template3. Configure Environment Variables
PORT=5000
MONGO_URI=mongodb+srv://username:password@cluster.mongodb.net/mira
GOOGLE_CLIENT_ID=your_google_client_id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=http://localhost:5000/api/calendar/callback4. Get Google Calendar Credentials
- Create project at Google Cloud Console
- Enable "Google Calendar API"
- Create OAuth 2.0 Client ID (Web application)
- Add redirect URI:
http://localhost:5000/api/calendar/callback - Copy credentials to
.env
5. Start the Application
cd backend
npm run dev6. Open Browser
http://localhost:5000
That's it! The frontend is served automatically by the backend.
POST /api/auth/signup- Register new userPOST /api/auth/login- Login and receive JWT tokenGET /api/auth/me- Get current user profile (protected)
POST /api/journals/create- Create new journal entryGET /api/journals- Get all user journalsGET /api/journals/:id- Get specific journalPUT /api/journals/:id- Update journalDELETE /api/journals/:id- Delete journalPOST /api/journals/:id/analyze- AI analysis + auto-create reminders + auto-sync calendar
POST /api/reminders/propose- Create reminder manuallyPOST /api/reminders/:id/confirm- Confirm proposed reminderPOST /api/reminders/:id/toggle-complete- Mark complete/incompleteGET /api/reminders- Get all user remindersDELETE /api/reminders/:id- Delete reminderPOST /api/reminders/:id/sync-to-calendar- Sync to Google Calendar
POST /api/todos- Create new todoGET /api/todos- Get all user todosPUT /api/todos/:id- Update todoDELETE /api/todos/:id- Delete todoPOST /api/todos/reorder- Reorder todosPOST /api/todos/prioritize-ai- AI-powered prioritization
GET /api/calendar/auth- Get OAuth authorization URLGET /api/calendar/callback- OAuth callback handlerGET /api/calendar/status- Check connection statusPOST /api/calendar/disconnect- Disconnect Google Calendar
#/- Landing page / Dashboard#/login- Login/Signup#/dashboard- Analytics dashboard#/journals- Journal list#/journal/new- Create journal#/journal/:id- Edit journal#/events- Events management#/todos- Todo list#/calendar-connected- OAuth success
Step 1: Journal Creation
User types journal β Auto-save (2s delay) β Saved to MongoDB
Step 2: Automatic AI Analysis (5s delay)
Parallel AI Processing (faster performance):
βββ Analysis #1: Activity categorization, emotions, sentiment, suggestions
βββ Analysis #2: Event detection from natural language
Step 3: Agentic AI Decision Making
AI Agent receives:
- Detected events from Step 2
- User's last 5 journals (pattern recognition)
- All existing reminders (duplicate prevention)
AI Agent decides for each event:
- shouldCreate: true/false (autonomous decision)
- priority: high/medium/low (context-based)
- Enhanced description with preparation notes
- Filters duplicates through 3-layer system
Output: Only necessary reminders created
Step 4: Automatic Calendar Sync (if connected)
For each created reminder:
- OAuth2 authentication with stored tokens
- Create Google Calendar event
- Add AI-enhanced description
- Set timezone (Asia/Kolkata default)
- Add popup + email reminders
- Update reminder status to 'synced'
Journal: "Working on project. Client demo on the 25th. Still preparing for demo."
AI Processing:
β Detects: "Client demo on the 25th" + "preparing for demo"
β Recognizes: Same event (semantic duplicate)
β Decides: Create 1 reminder only
β Enhances: "Client demo - Prepare slides, test environment, review features"
β Priority: HIGH (deadline-based)
Result: 1 smart reminder created (not 2 duplicates)-
Agentic AI with Memory Context
- AI receives user history (last 5 journals + all reminders)
- Makes context-aware decisions, not just pattern matching
- Autonomous
shouldCreatedecision for each event
-
3-Layer Duplicate Prevention
- Layer 1: Rule-based pre-filter (70% duplicates caught)
- Layer 2: AI semantic understanding
- Layer 3: Database unique constraints
-
Timezone-Aware Calendar Sync
- User-specific timezone settings (default: Asia/Kolkata)
- Prevents time mismatch issues in calendar events
-
Auto-Save + Auto-Analyze Architecture
- Non-blocking async processing
- User never loses work
- AI analysis happens in background
-
Privacy-First Design
- Llama3 runs locally via Ollama
- Journal analysis never sent to cloud AI services
- Per-user OAuth tokens (not shared between users)
-
Zero-Build Frontend
- Pure vanilla JavaScript (no React/Vue/Angular)
- Served directly by Express
- Instant deployment, no compilation needed
- Open
http://localhost:5000in your browser - Sign up with name, email, and password
- Login to access your personal dashboard
- Click "Connect Google Calendar" in navigation
- Authorize MIRA in Google OAuth screen
- Once connected, all AI-created reminders auto-sync
- Click "New Entry" button
- Write naturally about your day
- Auto-save activates after 2 seconds (see "Saved" indicator)
- Auto-analyze starts after 5 seconds (AI processing spinner appears)
Below your journal, you'll automatically see:
- Productive Activities: Work, study, exercise detected
- Restful Activities: Sleep, breaks, relaxation
- Emotional States: Feelings from your writing
- AI Suggestions: 3-5 personalized recommendations
- Detected Events: Future events with auto-created reminders
- View all events on Events page
- Filter by: Today | Upcoming | Past | Cancelled
- Mark events as complete
- Delete unwanted reminders
- Click calendar links to view in Google Calendar
- Add todos with optional due dates
- Click "AI Prioritize" button
- Llama3 analyzes urgency and reorders tasks
- Manually drag-and-drop to adjust
The AI understands:
- "tomorrow at 3pm"
- "December 12 at 10am"
- "next Monday"
- "on the 25th"
- "Friday at 5pm"
- "in 3 days"
- JWT Authentication: Secure token-based auth with 30-day expiration
- Password Hashing: bcryptjs with salt rounds (10 rounds)
- Google OAuth 2.0: Industry-standard OAuth flow
- Per-User Token Storage: OAuth tokens stored in MongoDB per user (NOT hardcoded)
- Environment Variables: Sensitive keys in
.env(excluded from git via.gitignore) - Protected Routes: Backend JWT middleware + frontend route guards
- Refresh Tokens: Google refresh tokens stored securely, used to get new access tokens
- Each Developer: Must create their own Google Cloud credentials
- Each User: Connects their own Google Calendar account independently
AI Analysis Speed (with GPU - RTX 4050):
- Journal semantic analysis: ~3-5 seconds
- Event detection: ~2-3 seconds
- AI reminder decision-making: ~2-4 seconds
- Parallel execution: Analysis + Event Detection run simultaneously β ~5 seconds
- Sequential: Then AI decides on reminders β +2-4 seconds
- Total: ~7-9 seconds for complete AI workflow (analysis + event detection + intelligent reminder creation)
- Temperature: 0.15 for analysis, 0.3 for reminder decisions (more consistent decision-making)
Without Ollama Running:
- Returns 503 error: "Ollama service not available. Please ensure Ollama is running and llama3 model is installed."
- App still works for writing/saving journals
- AI analysis just won't be available until Ollama is started
Auto-Save/Auto-Analyze Timers:
- Auto-save debounce: 2 seconds
- Auto-analyze debounce: 5 seconds
- Skips initial load (prevents unnecessary API calls)
- Modular MVC Pattern: Controllers, routes, models cleanly separated
- Auto-save/Auto-analyze: Debounced timers prevent excessive API calls
- Parallel AI Calls: Promise.all() runs analysis + event detection simultaneously (50% faster)
- π€ Agentic AI: Third sequential AI call makes intelligent decisions about reminder creation
- Llama3 Integration: Local LLM via Ollama for complete privacyβno data sent to external APIs
- Semantic NLP: Deep language understanding, not regex or keyword matching
- AI Decision Engine: Llama3 filters events, assigns priorities, adds context, and decides what needs reminders
- Event Detection: AI-powered date/time parsing with relative date conversion
- Google Calendar: Persistent access via OAuth 2.0 refresh tokens (stored per-user)
- Error Handling: Try-catch blocks with user-friendly error messages
- CORS Enabled: Secure frontend-backend communication (configured for localhost)
- Hash Routing: SPA-style routing without page reloads
- Static File Serving: Express serves vanilla frontend directly (no separate server needed)
- β User signup and login with JWT authentication
- β Create, read, update, delete journal entries
- β Streak tracking for consecutive journaling days
- JWT Authentication: 30-day token expiration with secure bcrypt password hashing
- Per-User OAuth Tokens: Each user connects their own Google Calendar (tokens never shared)
- Protected API Routes: All journal/reminder endpoints require valid JWT
- Local AI Processing: Llama3 runs locally via Ollama (journal content never sent to cloud)
- Environment Variables: Sensitive credentials stored in
.env(not committed to git) - MongoDB Security: Cloud database with authentication and encrypted connections
β Fully Functional Features:
- AI-powered journal analysis with Llama3
- Autonomous reminder creation with 3-layer duplicate prevention
- Google Calendar integration with OAuth 2.0
- Interactive dashboard with Chart.js visualizations
- AI-powered todo prioritization
- Real-time speech-to-text input
- Auto-save and auto-analyze functionality
- Streak tracking and analytics
- Email, password (bcrypt hashed)
- Google OAuth tokens (refresh + access)
- Timezone preferences (default: Asia/Kolkata)
- Title, content, date
- AI analysis results (activities, emotions, sentiment, suggestions)
- Streak counter
- Event details (title, description, date, priority)
- Status tracking (proposed/synced/completed/cancelled)
- Google Calendar event ID and link
- AI metadata (reasoning, preparation notes)
- Task text, completion status
- Priority score (AI-assigned)
- Due date/time, manual ordering
This is an academic project demonstrating agentic AI capabilities. Contributions welcome for:
- Enhanced AI prompt engineering
- Additional calendar provider integrations
- UI/UX improvements
- Performance optimizations
MIT License - Free for learning and development
MIRA - Mindful Intelligent Reflective Assistant
Journaling powered by autonomous AI decision-making
Built with β€οΈ using Ollama + Llama3, Node.js, MongoDB, and Vanilla JavaScript