An intelligent, real-time Perplexity-like AI search engine and chat platform powered by multi-LLM orchestration and web search grounding.
QuickMind is a full-stack AI research assistant and conversational platform inspired by Perplexity AI. It combines real-time Web Search Grounding with Multi-LLM Orchestration (Groq, Mistral AI, Google Gemini) to deliver fast, accurate, and source-cited responses to user queries.
- π Live Web Search Grounding & Citations: Automatically detects real-time or time-sensitive user queries (
latest,news,today,current,2026,recent) and triggers live Tavily web searches, feeding structured web results to the LLM and displaying cited sources (title and URL) with every response. - π€ Multi-LLM Orchestration:
- Groq (
llama-3.3-70b-versatile): Provides ultra-fast responses for general conversational queries. - Mistral AI (
mistral-small-latest): Synthesizes structured, fact-grounded responses when web search results are retrieved. - Google Gemini (
gemini-2.5-flash-lite): Generates concise, 2-to-4-word thread titles automatically from the initial prompt.
- Groq (
- β‘ Real-Time WebSockets: Powered by Socket.IO for live room management (
join) and real-time message broadcasting (new-message). - π Authentication & Security:
- JWT authentication with secure HTTP-only cookies (
sameSite: "None"). - Password encryption using
bcrypt(10 rounds). - Express request validation (
express-validator).
- JWT authentication with secure HTTP-only cookies (
- π§ Email Verification Workflow: Integrated with
Nodemailervia Google OAuth2 to send styled verification emails with 10-minute expiring tokens. - π
Responsive & Rich UI: Built with React 19, Redux Toolkit, React Router v7, Vite, Tailwind CSS v4, Framer Motion, and markdown rendering (
react-markdown,remark-gfm,react-syntax-highlighter).
+---------------------------+
| React 19 Frontend |
| (Redux Toolkit, Vite) |
+-------------+-------------+
|
+---------------------+---------------------+
| REST API (Axios) | WebSockets (Socket.IO Client)
v v
+----------------------------+ +----------------------------+
| Express 5 HTTP Server | | Socket.IO WS Server |
| (Auth, Chats, Middleware) | | (Room Join, New Message) |
+--------------+-------------+ +--------------+-------------+
| |
+--------------------+---------------------+
|
+-----------------------+-----------------------+
| Backend Services |
+-------+---------------+---------------+-------+
| | |
v v v
+---------------+ +-----------+ +---------------+
| MongoDB Atlas| | Tavily AI | | Multi-LLM Core|
| (Users/Chats) | | (Search) | | Groq/Mistral/ |
+---------------+ +-----------+ | Gemini |
+---------------+
- Authentication: Users register, receive an email verification link, and log in to receive an HTTP-only JWT cookie.
- Chat & Title Creation: On sending the first message of a thread, Gemini generates a 2-4 word title, creating a new
Chatsession. - Query Grounding: If the prompt requests live/current information, Tavily search is executed, and Mistral AI synthesizes the answer with citations. Otherwise, Groq generates the response directly.
- Broadcast: Responses are saved to MongoDB and emitted via Socket.IO to the user's private room.
- Runtime: Node.js
- Framework: Express 5
- Database: MongoDB & Mongoose ODM
- Real-Time: Socket.IO
- AI & Search Frameworks: LangChain, Groq SDK, Tavily Search SDK
- LLM Models:
llama-3.3-70b-versatile(Groq),mistral-small-latest(Mistral),gemini-2.5-flash-lite(Google) - Auth & Email:
jsonwebtoken,bcrypt,cookie-parser,nodemailer
- Core: React 19, Vite
- State Management: Redux Toolkit, React Redux
- Routing: React Router v7
- Styling & UI: Tailwind CSS v4, Framer Motion, Lucide React, React Icons
- Markdown & Code:
react-markdown,remark-gfm,react-syntax-highlighter - Networking: Axios,
socket.io-client
{
username: { type: String, required: true, trim: true },
email: { type: String, required: true, unique: true, lowercase: true },
password: { type: String, required: true, minlength: 6 }, // Hashed with bcrypt
isVerified: { type: Boolean, default: false },
timestamps: true
}{
user: { type: mongoose.Schema.Types.ObjectId, ref: "User", required: true, index: true },
title: { type: String, default: "New Chat" },
timestamps: true
}{
chat: { type: mongoose.Schema.Types.ObjectId, ref: "Chat", required: true, index: true },
role: { type: String, enum: ["user", "ai"], required: true },
content: { type: String, required: true },
sources: [{ title: String, url: String }],
timestamps: true
}QuickMind/
βββ Backend/
β βββ src/
β β βββ config/ # Database connection (database.js)
β β βββ controllers/ # Auth & Chat handlers (auth.controller.js, chat.controller.js)
β β βββ middlewares/ # Auth guard & validation (auth.middleware.js, validate.js)
β β βββ models/ # Mongoose models (user.model.js, chat.model.js, message.model.js)
β β βββ routes/ # Express route declarations (auth.routes.js, chat.routes.js)
β β βββ services/ # AI orchestration, web search & email services
β β βββ sockets/ # Socket.IO setup (chat.socket.js)
β β βββ app.js # Express app setup & CORS configuration
β βββ server.js # HTTP & WebSocket server launcher
β βββ package.json
β βββ .env # Environment variables
βββ Frontend/
βββ src/
β βββ app/ # Main App component, store & router configuration
β βββ features/
β β βββ auth/ # Auth state slice, services, hooks, & pages
β β βββ chat/ # Chat components (ChatWindow, Sidebar, Message, InputBox), slice, & sockets
β β βββ components/ # Protected & PublicRoute guards, Loading UI
β βββ pages/ # Landing page (Welcome.jsx)
β βββ main.jsx # React application entry point
βββ vite.config.js
βββ package.json
Create a .env file in the Backend folder:
# Server Configuration
PORT=3000
CLIENT_URL=http://localhost:5173
# Database Connection
MONGO_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/quickmind
# JWT Secret
JWT_SECRET=your_jwt_secret_key
# AI API Keys
GOOGLE_API_KEY=your_google_gemini_api_key
GROQ_API_KEY=your_groq_api_key
MISTRAL_API_KEY=your_mistral_api_key
# Search API Key
TAVITY_API=your_tavily_search_api_key
# Nodemailer Google OAuth2 Configuration
GOOGLE_USER=your_email@gmail.com
GOOGLE_CLIENT_ID=your_oauth_client_id
GOOGLE_CLIENT_SECRET=your_oauth_client_secret
GOOGLE_REFRESH_TOKEN=your_oauth_refresh_token
GOOGLE_APP_PASSWORD=your_app_password- Node.js:
v18.0.0or higher - MongoDB: Local instance or MongoDB Atlas URI
- API Keys for Groq, Mistral AI, Google Gemini, and Tavily AI
# Navigate to the Backend folder
cd Backend
# Install dependencies
npm install
# Run backend in development mode
npm run devThe server will start on http://localhost:3000.
# Open a new terminal and navigate to the Frontend folder
cd Frontend
# Install dependencies
npm install
# Start Vite dev server
npm run devThe client will be running on http://localhost:5173.
| Method | Endpoint | Description | Authentication |
|---|---|---|---|
POST |
/api/auth/register |
Register a new user & trigger verification email | None |
POST |
/api/auth/login |
Authenticate user & receive HTTP-only JWT cookie | None |
GET |
/api/auth/verify-email?token= |
Verify user email token | None |
GET |
/api/auth/get-me |
Get currently logged-in user profile | JWT Cookie |
POST |
/api/auth/logout |
Clear authentication cookie | None |
| Method | Endpoint | Description | Authentication |
|---|---|---|---|
POST |
/api/chats/message |
Send message, trigger AI/Search pipeline & return answer | JWT Cookie |
GET |
/api/chats |
Fetch all chat sessions for the authenticated user | JWT Cookie |
GET |
/api/chats/:chatId/messages |
Fetch all messages for a specific chat | JWT Cookie |
DELETE |
/api/chats/:chatId/delete |
Delete a chat session and associated messages | JWT Cookie |
| Event Name | Direction | Payload / Description |
|---|---|---|
join |
Client β Server | userId (String) β Joins user's private socket room |
new-message |
Server β Client | { title, chat, aiMessage } β Real-time AI response payload |
Contributions, issues, and feature requests are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the ISC License.