Skip to content

vedith12/AstraMindChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AstraMindChat 🌌

A multi-agent AI chat application with a React frontend and FastAPI backend, supporting multiple LLM providers, custom agents, analytics, and prompt optimization tools.


πŸ“‹ Table of Contents


Overview

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.


✨ Features

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

πŸ› οΈ Tech Stack

Frontend

  • React 19 with Vite
  • Lucide React for icons
  • Vanilla CSS (custom design system with CSS variables)
  • localStorage for client-side persistence (theme, API keys, analytics)

Backend

  • FastAPI β€” REST API server
  • SQLModel β€” ORM on top of SQLAlchemy
  • SQLite β€” Embedded database (astramind.db)
  • Pydantic β€” Request/response validation

AI / LLM

  • Google Gemini API (default provider)
  • Groq API β€” Llama 3, used for the Prompt Reviewer panel

πŸ“ Project Structure

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

πŸš€ Getting Started

Prerequisites

  • 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

Backend Setup

# 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 8000

The backend will be available at http://localhost:8000.
The SQLite database (astramind.db) is created automatically on first run.


Frontend Setup

# 1. Navigate to the frontend directory
cd frontend

# 2. Install dependencies
npm install

# 3. Start the development server
npm run dev

The app will be available at http://localhost:5173.


βš™οΈ Configuration

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

πŸ€– Built-in Agents

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.


πŸ“‘ API Reference

The backend runs on http://localhost:8000.

Messages

Method Endpoint Description
POST /api/message Save a chat message
GET /api/history Retrieve all chat messages

Analytics

Method Endpoint Description
POST /api/analytics Save analytics data
GET /api/analytics Retrieve analytics data

Custom Agents

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

System

Method Endpoint Description
GET / Health check
DELETE /api/reset Clear all messages, analytics, and custom agents

πŸ“– Usage Guide

  1. Enter your API key in Settings β†’ Gemini API Key.
  2. Pick an agent from the dropdown in the chat input (or leave on "Auto").
  3. Type your message and press Send (or Enter).
  4. Use Generate Prompt to let AI refine your input before sending.
  5. The Prompt Reviewer Panel (requires Groq API Key) gives real-time feedback on your draft.
  6. Browse the Sidebar to load prompt templates or export/reset your chat.
  7. Switch to the Analytics view to see your usage breakdown.

About

AstraMindChat is a multi-agent AI chat app built with React + FastAPI. It supports Google Gemini and Groq, custom agent creation, prompt optimization, and usage analytics.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors