A multi-agent AI chat application with a React frontend and FastAPI backend, supporting multiple LLM providers, custom agents, analytics, and prompt optimization tools.
- Overview
- Features
- Tech Stack
- Project Structure
- Getting Started
- Configuration
- Built-in Agents
- API Reference
- Usage Guide
AstraMindChat is a full-stack AI chat platform that lets users interact with specialized AI agents powered by Google Gemini or Groq (Llama 3). It features a live analytics dashboard, exportable chat history, prompt templates, a Prompt Reviewer panel, and a custom agent builder — all wrapped in a clean dark-mode UI.
| Feature | Description |
|---|---|
| 🤖 Multi-Agent Chat | 6 built-in AI agents, each with a specialized system prompt |
| 🧠 Dual LLM Providers | Switch between Google Gemini and Groq (Llama 3) |
| 🔍 Prompt Reviewer | Real-time AI-powered prompt quality analysis via Groq |
| ✍️ Prompt Generator | Rewrites your rough input into an optimized prompt |
| 📊 Analytics Dashboard | Tracks total prompts, agent usage, provider usage, and mode breakdowns |
| 📁 Chat Export | Download conversation history as JSON or TXT |
| 📝 Prompt Templates | Pre-built templates to speed up common queries |
| 🛠️ Custom Agent Builder | Create, save, and delete your own agents with custom system prompts |
| 🌙 Dark / Light Mode | Persistent theme toggle |
| 💾 Persistent Storage | Chat history and analytics saved to a SQLite database via FastAPI |
- React 19 with Vite
- Lucide React for icons
- Vanilla CSS (custom design system with CSS variables)
localStoragefor client-side persistence (theme, API keys, analytics)
- FastAPI — REST API server
- SQLModel — ORM on top of SQLAlchemy
- SQLite — Embedded database (
astramind.db) - Pydantic — Request/response validation
- Google Gemini API (default provider)
- Groq API — Llama 3, used for the Prompt Reviewer panel
internship-eval-proj/
├── backend/
│ └── venv/
│ └── main.py # FastAPI app — all routes and DB models
│
└── frontend/
├── index.html
├── vite.config.js
├── package.json
└── src/
├── App.jsx # Root component, global state
├── main.jsx
├── agents/
│ └── agents.jsx # Built-in agent definitions + merge util
├── components/
│ ├── analytics/
│ │ └── AnalyticsView.jsx
│ ├── chat/
│ │ ├── ChatWindow.jsx
│ │ ├── InputBox.jsx
│ │ ├── MessageBubble.jsx
│ │ ├── PromptGenerator.jsx
│ │ └── PromptReviewerPanel.jsx
│ ├── header/
│ │ └── Header.jsx
│ ├── settings/
│ │ └── Settings.jsx
│ └── sidebar/
│ └── Sidebar.jsx
├── hooks/
│ └── useLocalStorage.js
├── styles/
│ └── global.css
├── templates/
│ └── templates.js
└── utils/
└── exportUtils.js
- Node.js v18+ and npm
- Python 3.10+
- A Google Gemini API Key → Get one here
- (Optional) A Groq API Key for the Prompt Reviewer → Get one here
# 1. Navigate to the backend venv directory
cd backend/venv
# 2. Install dependencies
pip install fastapi uvicorn sqlmodel
# 3. Start the server
uvicorn main:app --reload --port 8000The backend will be available at http://localhost:8000.
The SQLite database (astramind.db) is created automatically on first run.
# 1. Navigate to the frontend directory
cd frontend
# 2. Install dependencies
npm install
# 3. Start the development server
npm run devThe app will be available at http://localhost:5173.
All configuration is done from the Settings view inside the app:
| Setting | Options | Description |
|---|---|---|
| Tone | Friendly, Formal, Casual, Creative, Technical | Controls the AI's conversational tone |
| Response Style | Short, Medium, Long, Detailed | Controls response length |
| Model Mode | Online, Offline | Switches between live API and offline mode |
| LLM Provider | Gemini (Default), Groq (Llama 3) | Selects which AI provider to use |
| Gemini API Key | (your key) | Stored in localStorage |
| Groq API Key | (your key) | Used for the Prompt Reviewer panel |
| Agent | ID | Description |
|---|---|---|
| Astra Chat | general |
Friendly general-purpose assistant |
| DevCore | code |
Elite coding assistant for clean, optimized code |
| Scribe | writer |
Expert writing and rewriting assistant |
| LogicNode | math |
Step-by-step mathematical reasoning |
| Strategist | planner |
Structured planning and goal breakdown |
| PromptGenerator | prompt |
Rewrites user queries into optimized prompts |
You can also create custom agents from the Settings panel by providing a name, system prompt, color, and emoji icon. Custom agents are persisted in the backend database.
The backend runs on http://localhost:8000.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/message |
Save a chat message |
GET |
/api/history |
Retrieve all chat messages |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/analytics |
Save analytics data |
GET |
/api/analytics |
Retrieve analytics data |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/agents |
Create a new custom agent |
GET |
/api/agents |
List all custom agents |
DELETE |
/api/agents/{id} |
Delete a custom agent by ID |
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Health check |
DELETE |
/api/reset |
Clear all messages, analytics, and custom agents |
- Enter your API key in Settings → Gemini API Key.
- Pick an agent from the dropdown in the chat input (or leave on "Auto").
- Type your message and press Send (or
Enter). - Use Generate Prompt to let AI refine your input before sending.
- The Prompt Reviewer Panel (requires Groq API Key) gives real-time feedback on your draft.
- Browse the Sidebar to load prompt templates or export/reset your chat.
- Switch to the Analytics view to see your usage breakdown.