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.