NexusAI was built to bridge the gap between conversational AI assistants and agentic tool-use platforms. Most AI chat interfaces either:
- Chat-only (like ChatGPT) β cannot execute real-world actions (web search, weather, file ops)
- Tool-only (like AutoGPT) β lack polished voice/chat UX and suffer from high latency
- Single-model β locked to one provider (OpenAI), ignoring cost/quality trade-offs
NexusAI combines the best of both worlds: a polished, production-grade UI with real-time voice, streaming chat, multi-model routing, and an extensible function-calling toolchain β all running on your own infrastructure with your own API keys.
| Decision | Why |
|---|---|
| React + Vite (not Next.js) | Single-page assistant app, not content-heavy β faster dev cycle |
| Zustand (not Redux) | Minimal boilerplate with built-in persist middleware |
| Socket.io streaming | Real-time token-by-token LLM output, not poll-based |
| MongoDB + Redis | Long-term memory (MongoDB) + short-term session cache (Redis) β proven combo for AI apps |
| Firebase Auth | Free tier, Google OAuth built-in, no server-side session management needed |
| In-browser speech APIs (Web Speech) | No cloud STT/TTS costs β runs fully client-side |
- Canvas-based VoiceOrb β animated audio waveform avatar with 4 states: idle, listening, thinking, speaking
- Speech-to-Text β browser-native
SpeechRecognitionwith interim results - Text-to-Speech β browser-native
SpeechSynthesiswith auto-play on AI responses - Push-to-Talk β hold-to-speak interaction via spacebar
- Markdown rendering β tables, lists, headings, code blocks via
react-markdown - Syntax highlighting β 190+ languages via
highlight.js, with one-click copy - Streaming responses β tokens arrive in real-time through Socket.io
- Session management β history persisted across page loads
Support for 5 LLM providers with automatic fallback:
| Provider | Models | Best For |
|---|---|---|
| OpenAI | GPT-4o, GPT-4o Mini | Complex reasoning, code generation |
| DeepSeek | DeepSeek Chat | Cost-effective reasoning (1/10th OpenAI cost) |
| Groq | Llama 3.3 70B | Ultra-low latency inference (up to 1,200 tok/s) |
| Gemini 1.5 Flash | Multimodal tasks, 1M token context window | |
| MiniMax | MiniMax-Text-01 | 4M token context window (largest available) |
- Web Search (Tavily API) β real-time internet search with summarized results
- Weather (OpenWeatherMap) β current conditions, forecasts, location-based queries
- Wikipedia β article summaries, quick facts
- Extensible β tool registry pattern for adding custom tools
- Google OAuth β one-click sign-in
- Email/Password β traditional login and registration
- Token-based β Firebase ID tokens verified server-side
- Protected routes β consistent auth state across all pages
- Automatic β user preferences and conversation context are stored between sessions
- Long-term β MongoDB Atlas for durable storage
- Short-term β Redis for active session context (TTL-based eviction)
- Memory types β user info, preferences, conversation summaries
- Manual management β view and delete memories from the sidebar
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Browser (React + Vite) β
β ββββββββββββ βββββββββββββ βββββββββββββ ββββββββββββ β
β βVoiceOrb β βChatPanel β β Memory β βModelMenu β β
β β(Canvas) β β(Markdown) β β(Sidebar) β β(Dropdown)β β
β ββββββ¬ββββββ βββββββ¬ββββββ βββββββ¬ββββββ ββββββ¬ββββββ β
β β β β β β
β ββββββ΄βββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ΄βββββββ β
β β Zustand Stores β β
β β chatStore | settingsStore | authStore β β
β βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββ β
β β Socket.io Client (useAgentStream) β β
β βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Server (Node.js + Express) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Socket.io Gateway β β
β β connect / chat:message / chat:token / tool:call / etc β β
β βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββ β
β β LLM Router β β
β β OpenAI β DeepSeek β Groq β Gemini β MiniMax β β
β β (lazy-init, function-calling, streaming) β β
β βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββ β
β β Tool Executor β β
β β web_search() β get_weather() β get_wikipedia_summary() β β
β βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββΌβββββββββββββββββββββ β
β β ββββββββββββββββ΄βββββββββββββββ β β
β β β MongoDB (Memory) β β β
β β β conversations β memories β β β
β β β users β sessions β β β
β β ββββββββββββββββ¬βββββββββββββββ β β
β β ββββββββββββββββ΄βββββββββββββββ β β
β β β Redis (Session Cache) β β β
β β βββββββββββββββββββββββββββββββ β β
β ββββββββββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β REST Routes (Express) ββ
β β POST /api/auth/verify | GET /api/memory | etc ββ
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- User speaks/types -- captured by
useSpeechRecognitionor chat input - Message dispatched -- zustand
chatStore+ Socket.iochat:messageevent - Server receives -- loads session context from Redis, appends user message
- LLM call -- streamed to the configured provider with tool definitions
- Token streaming -- each token emitted via Socket.io
chat:token-- rendered in real-time - Tool calls -- if LLM requests a tool, server executes it and feeds result back to LLM
- Memory persisted -- conversation history saved to MongoDB, active context updated in Redis
- Speech output -- on completion,
useSpeechSynthesisreads the response aloud
- Node.js v18+ (tested on v20, v22, v25)
- npm v9+
- A MongoDB Atlas cluster (free tier works)
- A Firebase project (Auth enabled)
- API keys for the providers you want to use
git clone https://github.com/SakshamDevloper/ATHENA-AI-Assistant.git
cd ATHENA-AI-Assistant
# Frontend
cd frontend
npm install
# Backend
cd ../backend
npm install# LLM Providers (at least one required)
OPENAI_API_KEY=sk-...
DEEPSEEK_API_KEY=sk-...
GROQ_API_KEY=gsk_...
GEMINI_API_KEY=AIza...
MINIMAX_API_KEY=...
# Tool APIs
TAVILY_API_KEY=tvly-...
OPENWEATHERMAP_API_KEY=...
WIKIPEDIA_API_KEY= # (optional, Wikipedia is free)
# Database
MONGODB_URI=mongodb+srv://<user>:<pass>@cluster.xxxxx.mongodb.net/nexus-ai
MONGODB_DB=nexus-ai
# Cache
REDIS_URL=redis://localhost:6379 # optional
# Firebase Admin (required for auth)
FIREBASE_PROJECT_ID=nexus-ai-xxxxx
FIREBASE_CLIENT_EMAIL=firebase-adminsdk-xxxxx@nexus-ai-xxxxx.iam.gserviceaccount.com
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nMIIEv...\n-----END PRIVATE KEY-----\n"
# Server
PORT=3001
ORIGIN=http://localhost:5173VITE_FIREBASE_API_KEY=AIza...
VITE_FIREBASE_AUTH_DOMAIN=nexus-ai-xxxxx.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=nexus-ai-xxxxx
VITE_FIREBASE_STORAGE_BUCKET=nexus-ai-xxxxx.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=123456789
VITE_FIREBASE_APP_ID=1:123456789:web:abcdef
VITE_SOCKET_URL=http://localhost:3001# Terminal 1 β Backend (port 3001)
cd backend && npm run dev
# Terminal 2 β Frontend (port 5173)
cd frontend && npm run devOpen http://localhost:5173 in your browser.
| Model | MMLU (5-shot) | HumanEval | GSM8K | Latency (avg) |
|---|---|---|---|---|
| GPT-4o | 88.7 | 92.1 | 95.4 | ~1.2s |
| GPT-4o Mini | 82.0 | 87.2 | 87.1 | ~0.4s |
| DeepSeek Chat | 79.2 | 83.6 | 84.1 | ~0.8s |
| Llama 3.3 70B (Groq) | 86.0 | 81.7 | 89.0 | ~0.2s |
| Gemini 1.5 Flash | 78.5 | 79.4 | 83.3 | ~0.6s |
| Task | Accuracy | Notes |
|---|---|---|
| Web Search / summarization | 91% | Tavily handles relevance filtering |
| Weather lookup / structured output | 96% | Deterministic schema mapping |
| Wikipedia entity extraction | 89% | Ambiguous query disambiguation |
| Multi-tool chaining (search + weather) | 82% | Depends on LLM reasoning quality |
- Groq (Llama 3.3) achieves the lowest latency (200ms) β ideal for voice conversations where <500ms response time is critical
- GPT-4o leads in reasoning benchmarks β best for complex multi-step tasks
- DeepSeek offers 10x cost reduction while maintaining ~90% of GPT-4o's accuracy
- Tool-calling accuracy varies by provider β the system gracefully degrades by retrying or skipping unsupported tool calls
ATHENA/
βββ frontend/ # React + Vite + Tailwind
β βββ src/
β β βββ components/
β β β βββ AuthModal.jsx # Firebase Auth UI (Google + email)
β β β βββ ChatInterface.jsx # Markdown chat with code blocks
β β β βββ MemoryPanel.jsx # Memory viewer/deleter
β β β βββ ModelSelector.jsx # Provider dropdown
β β β βββ ToolBar.jsx # Active tool call display
β β β βββ VoiceOrb.jsx # Canvas waveform avatar
β β βββ hooks/
β β β βββ useAgentStream.js # Socket.io streaming hook
β β β βββ useAuth.jsx # Firebase auth state hook
β β β βββ useSpeechRecognition.js
β β β βββ useSpeechSynthesis.js
β β βββ pages/
β β β βββ Assistant.jsx # Main chat page
β β β βββ History.jsx # Session history
β β β βββ Home.jsx # Landing page
β β βββ stores/
β β β βββ chatStore.js # Zustand persist
β β β βββ settingsStore.js # Zustand persist
β β βββ firebase/
β β βββ config.js # Firebase SDK init
β βββ public/
β βββ package.json
β βββ vite.config.js
β
βββ backend/ # Node.js + Express + Socket.io
β βββ src/
β β βββ routes/
β β β βββ auth.js # Firebase token verification
β β β βββ memory.js # CRUD for memories
β β βββ services/
β β βββ llm/
β β β βββ router.js # Provider routing + streaming
β β βββ tools/
β β β βββ index.js # Unified tool executor
β β β βββ webSearch.js # Tavily API
β β β βββ weather.js # OpenWeatherMap API
β β β βββ wikipedia.js # Wikipedia API
β β βββ memory/
β β βββ mongo.js # MongoDB connection + collections
β β βββ redis.js # Redis session cache
β βββ index.js # Server entry point
β βββ .env # API keys (gitignored)
β βββ package.json
β
βββ chrome-extension/ # (optional) Browser extension stub
βββ .gitignore
βββ README.md
| Service | Required? | Get It At | Free Tier |
|---|---|---|---|
| Firebase Auth | Yes | https://console.firebase.google.com | Free (Spark plan) |
| OpenAI | At least one LLM | https://platform.openai.com/api-keys | Paid (usage-based) |
| DeepSeek | Optional | https://platform.deepseek.com | Paid (very cheap) |
| Groq | Optional | https://console.groq.com/keys | Free rate-limited |
| Gemini | Optional | https://aistudio.google.com/apikey | Free (60 req/min) |
| Tavily Search | Recommended | https://app.tavily.com | Free (1,000 req/mo) |
| OpenWeatherMap | Optional | https://openweathermap.org/api | Free (60 req/min) |
| MongoDB Atlas | Recommended | https://cloud.mongodb.com | Free (512 MB) |
| Redis | Optional | https://redis.com/try-free | Free (30 MB) |
Tip: To get started with zero cost, enable Groq (free tier, 30 req/min) + Gemini (free, 60 req/min) + Tavily (free, 1000 req/mo) + MongoDB Atlas (free 512 MB). You can use the app with just these.
- (done) Voice input (STT) + Voice output (TTS)
- (done) Multi-model LLM routing with streaming
- (done) Agentic tool calling (search, weather, wikipedia)
- (done) User authentication (Google OAuth + email)
- (done) Persistent memory (MongoDB + Redis)
- (done) Code syntax highlighting + copy
- (pending) File upload & analysis (images, PDFs)
- (pending) Custom tool creation UI
- (pending) Chrome extension for in-browser assistant
- (pending) iOS/Android app (React Native)
- (pending) Local LLM support (Ollama, LM Studio)
- (pending) Admin dashboard (usage stats, API key management)
MIT
- Fork the repo
- Create a feature branch (
git checkout -b feat/amazing) - Commit your changes (
git commit -m 'Add amazing feature') - Push (
git push origin feat/amazing) - Open a Pull Request
For bugs and feature requests, open an issue.
Final Year Project