You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MindAgent is a full-stack AI-powered productivity platform where users interact with multiple specialized AI Agents to generate content, analyze data, understand images, and chat with an intelligent assistant. Each agent is purpose-built for a specific task β Content Writer, Data Analyzer, Image Analyst, Chat Assistant β making this a multi-agent workflow platform, not a single-purpose chatbot. Built with Next.js, Express.js, MongoDB, and OpenRouter, it emphasizes agentic behavior (memory, reasoning, tool-calling), streaming responses, and a polished user experience.
User uploads CSV/XLSX/JSON file
β Multer middleware (5MB limit, type validation)
β File parser extracts rows, columns, row count
β Build analysis prompt with data sample (first 5 rows)
β OpenRouter API (GPT-4o-mini) generates structured JSON insights
β Store parsed data + AI insights in MongoDB (Item collection)
β Return item with summary, trends, KPIs, risks, chart data
AI Chat Flow (Streaming)
User sends message
β Create or load existing ChatSession
β Add user message to session history
β Send full history to OpenRouter (GPT-4o-mini) with streaming
β Server-Sent Events (SSE) stream tokens to frontend
β Parse AI response for follow-up suggestions (JSON array)
β Save assistant message to session
β Display streaming text + suggestion buttons
AI Content Generation Flow
User enters topic, selects type/tone/length
β Select prompt template (blog/social/product/docs)
β Replace placeholders with user input
β OpenRouter API call (GPT-4o-mini, max_tokens based on length)
β Save to GeneratedContent collection
β Return generated text to frontend
Image Analysis Flow
User uploads image (base64)
β Optional: user provides custom prompt
β OpenRouter Vision API (GPT-4o) with image + prompt
β Save analysis to ImageAnalysis collection
β Display analysis text, tags, dimensions, palette
Authentication Flow
Login/Register
β Zod validation
β bcrypt hash (register) or compare (login)
β Sign JWT (7-day expiry)
β Store token in localStorage
β Attach Bearer token to all API requests
β protect middleware verifies token on protected routes
Google OAuth Flow
Google Sign-In button
β Google One-Tap returns credential
β Decode Google JWT β extract name, email, googleId, avatar
β POST /api/auth/google (auto-creates user if new)
β Receive MindAgent JWT + user data
β Store in auth context
cd client
npm install
cp .env.example .env.local
# Fill in NEXT_PUBLIC_API_URL, NEXT_PUBLIC_GOOGLE_CLIENT_ID
npm run dev
Server Setup
cd server
npm install
cp .env.example .env
# Fill in MONGO_URI, JWT_SECRET, OPENROUTER_API_KEY
npm run dev
Seed Database (Optional)
cd server
npm run seed
Creates a demo user (demo@mindagent.ai / demo123) with 4 sample data analysis reports.
Environment Variables
Client (.env.local)
Variable
Required
Description
NEXT_PUBLIC_API_URL
Yes
Backend API URL (e.g. http://localhost:5000/api)
NEXT_PUBLIC_GOOGLE_CLIENT_ID
Yes
Google OAuth client ID
Server (.env)
Variable
Required
Description
MONGO_URI
Yes
MongoDB connection string
JWT_SECRET
Yes
Secret key for JWT signing
OPENROUTER_API_KEY
Yes
OpenRouter API key
PORT
No
Server port (default: 5000)
Future Enhancement Opportunities
Multi-Provider AI: Add Groq, Gemini, Anthropic, or OpenAI as alternative providers via the AIProvider interface
RAG (Retrieval-Augmented Generation): Vector search over user's uploaded documents for context-aware responses
Agent Tool Calling: Enable AI agents to invoke external tools (web search, calculator, database queries)
Conversation Branching: Allow users to branch chat conversations from any point
Collaborative Workspaces: Share items and chat sessions with team members
Export Formats: PDF, Markdown, and HTML report exports in addition to XLSX
Real-Time Notifications: WebSocket-based alerts for completed analyses
Advanced Data Visualization: Interactive charts with drill-down, filtering, and custom dashboard builder
User Analytics Dashboard: Usage statistics, token consumption tracking, and productivity metrics
API Key Management: Allow users to bring their own API keys for higher rate limits
Webhooks: Notify external services when analyses complete
Mobile App: Native iOS/Android apps for on-the-go AI assistance
About
A multi-agent AI productivity platform powered by Next.js 15, Express, MongoDB, and OpenRouter. Features specialized agents for content writing, file/data analysis, image vision, and persistent chats.