DEV Community

Cover image for ๐Ÿค– YOGA AI ASSISTANT-BOTโœจ
YOGARATHNAM-S
YOGARATHNAM-S Subscriber

Posted on

๐Ÿค– YOGA AI ASSISTANT-BOTโœจ

๐Ÿค– YOGA AI Assistant -โœจ

๐Ÿค” What is this?

This is a smart chatbot website that can help you with different things depending on what you need. Think of it as having 6 different AI assistants in one app! ๐ŸŽ‰


๐ŸŽญ What can it do?

The AI has 6 different "modes" or personalities:

  1. ๐Ÿง  General โ€” Answers everyday questions and has normal conversations ๐Ÿ’ฌ
  2. ๐ŸŽฏ Productivity โ€” Helps you organize tasks and manage your time โฐ
  3. โค๏ธ Wellness โ€” Gives advice about health, fitness, and feeling good ๐ŸŒฑ
  4. ๐Ÿ“š Learning โ€” Acts like a tutor to help you study and learn new things ๐ŸŽ“
  5. ๐Ÿ’ก Creative โ€” Helps with brainstorming ideas and creative projects ๐ŸŽจ
  6. ๐Ÿ’• BFF โ€” Talks like a friendly Gen-Z bestie for emotional support ๐Ÿ‘ฏโ€โ™€๏ธ

โœจ Cool Features

  • ๐ŸŽค Voice Chat: Talk to it instead of typing โ€” and it talks back!
  • ๐Ÿง  Multiple AI Brains: Powered by Groq, Google, OpenAI, Claude ๐Ÿ”ฅ
  • ๐Ÿ’พ Remembers Conversations: Keeps memory per mode ๐Ÿ“
  • ๐Ÿ“ฑ Responsive Design: Works great on desktop, tablet, and phone
  • ๐ŸŒ™ Dark/Light Mode: Choose your vibe โ˜€๏ธ๐ŸŒ™

๐Ÿ‘จโ€๐Ÿ’ป Technical Stuff (for developers)

Built using modern web tech:

  • Next.js, React, TypeScript, Tailwind CSS
  • Uses Vercel AI SDK to connect with multiple AI models

๐Ÿง  Multi-Mode Intelligence

Mode Description
๐Ÿง  General All-purpose companion for everyday chats
๐ŸŽฏ Productivity Task manager, planner, and time optimizer
โค๏ธ Wellness Health tips, mental support, and fitness guidance
๐Ÿ“š Learning Tutor-like help for learning and studying
๐Ÿ’ก Creative Idea generator for all your creative projects
๐Ÿ’• BFF Casual chats, emotional support, Gen-Z style

๐Ÿค– Multi-Provider AI Support

Provider Description
Groq Fast responses via Llama models (no API key needed)
Google Gemini Multimodal AI from Google (no API key needed)
OpenAI GPT-4o, GPT-4 Turbo, GPT-3.5 (API key required)
Claude Anthropic's Claude models (API key required)

๐Ÿš€ Advanced Chat Interface

  • โšก Streaming Responses
  • ๐Ÿง  Mode-Specific Memory
  • ๐Ÿ’ฌ Persistent Chat History
  • ๐ŸŽจ Beautiful Responsive UI
  • ๐ŸŒ“ Dark & Light Themes
  • ๐Ÿ“ค Message Export (coming soon)

๐ŸŽค Voice Integration

  • Speech-to-Text input
  • Text-to-Speech output
  • Multi-language support
  • Voice Controls with indicators and interruption
  • Natural-Sounding Voices

โšก Quick Actions & Smart Features

  • Quick Prompts per mode
  • One-Click Access for tasks
  • Context-Aware Suggestions
  • Robust Error Handling
  • Secure API Key Management

๐ŸŽจ Dynamic AI Visualization

  • Interactive 3D Particle System
  • Mode-based Color Themes
  • Real-Time Activity Animation
  • Live AI Usage Analytics

๐Ÿ“Š Activity Analytics

  • Track message counts, response times, and session data
  • Mode Usage Breakdown
  • Live AI Status + voice activity monitoring

๐Ÿ› ๏ธ Tech Stack

Frontend

  • Next.js 14, React 18, TypeScript
  • Tailwind CSS, shadcn/ui, Lucide Icons
  • Three.js for 3D effects

Backend & AI

  • Vercel AI SDK
  • Providers: Groq, Gemini, OpenAI, Claude
  • Speech APIs: WebKit for STT/TTS
  • Storage: localStorage for persistence

๐Ÿ’ƒ Smart Model Selection

let modelType = "fast"; // llama-3.1-8b-instant

if (query.includes("analyze", "compare", "plan", "strategy")) {
  modelType = "reasoning"; // llama-3.3-70b
}
if (query.includes("creative", "idea", "write", "design")) {
  modelType = "creative"; // qwen3-32b
}
Enter fullscreen mode Exit fullscreen mode

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+
  • Modern browser (for speech features)
  • Optional: API Keys for OpenAI/Claude

Installation

Use

git clone https://github.com/yogarathnam-s/ai-assistant.git
cd ai-assistant
npm install     # or bun install
Enter fullscreen mode Exit fullscreen mode

Set up your .env file:

GROQ_API_KEY=your_key
GOOGLE_GENERATIVE_AI_API_KEY=your_key
# Optional:
# OPENAI_API_KEY=
# ANTHROPIC_API_KEY=
Enter fullscreen mode Exit fullscreen mode

Run dev server:

npm run dev     # or bun run dev
Enter fullscreen mode Exit fullscreen mode

Open http://localhost:3000


๐ŸŽฎ Usage Guide

Switching Modes

Click any of the six mode icons to shift the assistantโ€™s behavior.

Choosing AI Providers

Select between:

  • Groq (default)
  • Gemini
  • OpenAI
  • Claude

Using Voice Features

  • Click ๐ŸŽค to talk
  • Click ๐Ÿ”Š to hear the AI speak
  • Works in multiple languages

Managing Chats

  • Auto-saves per mode
  • Clear history with trash button
  • Switch modes without losing past chats

Themes & UX

  • Toggle between Light and Dark
  • Fully responsive and accessible

๐Ÿ—๏ธ Project Structure

ai-assistant/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ api/chat/route.ts          # Multi-provider chat API endpoint
โ”‚   โ”œโ”€โ”€ globals.css                # Global styles and theme variables
โ”‚   โ”œโ”€โ”€ layout.tsx                 # Root layout with metadata
โ”‚   โ””โ”€โ”€ page.tsx                   # Main application orchestrator
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ ui/                        # shadcn/ui base components
โ”‚   โ”œโ”€โ”€ chat-header.tsx            # Header with controls and mode display
โ”‚   โ”œโ”€โ”€ chat-sidebar.tsx           # Mode selection and quick actions
โ”‚   โ”œโ”€โ”€ chat-messages.tsx          # Message display and formatting
โ”‚   โ”œโ”€โ”€ chat-input.tsx             # Input field with voice controls
โ”‚   โ”œโ”€โ”€ chat-container.tsx         # Chat logic and state management
โ”‚   โ”œโ”€โ”€ ai-visualization.tsx       # 3D particle system visualization
โ”‚   โ””โ”€โ”€ activity-matrix.tsx        # Real-time analytics dashboard
โ”œโ”€โ”€ hooks/
โ”‚   โ””โ”€โ”€ use-speech.ts              # Speech recognition and synthesis
โ”œโ”€โ”€ types/
โ”‚   โ””โ”€โ”€ speech.d.ts                # TypeScript definitions for speech APIs
โ””โ”€โ”€ lib/
    โ””โ”€โ”€ utils.ts                   # Utility functions and helpers
Enter fullscreen mode Exit fullscreen mode

Each folder is modularized for easy extension.


๐Ÿ”ง Configuration

Model Selection

Set preferred models per task:

const MODELS = {
  groq: {
    fast: "llama-3.1-8b-instant",
    reasoning: "llama-3.3-70b-versatile", 
    creative: "qwen/qwen3-32b"
  },
  gemini: { default: "gemini-2.0-flash" },
  openai: { default: "gpt-4o" },
  claude: { default: "claude-3-5-sonnet-20241022" }
}
Enter fullscreen mode Exit fullscreen mode

Customize:

  • Quick Actions โ€” in app/page.tsx
  • Mode Styling โ€” color and behavior
  • Particles โ€” in ai-visualization.tsx
  • Voice Settings โ€” in use-speech.ts

๐ŸŒŸ Key Highlights

  • Smart AI Model Routing
  • Per-Mode Chat History
  • Real-time 3D Feedback
  • Voice in + out
  • Multi-provider support
  • Analytics dashboard

๐Ÿค Contributing

We welcome contributions!

git checkout -b feature/your-feature
# make changes
git commit -m "Add feature"
git push origin feature/your-feature
Enter fullscreen mode Exit fullscreen mode

Submit a pull request!

Dev Guidelines

  • Use TypeScript
  • Follow existing structure
  • Add tests if possible
  • Keep it accessible and responsive

๐Ÿ“„ License

MIT License โ€” See LICENSE


๐Ÿ“ž Support & Community


๐Ÿ”ฎ Roadmap

Coming Soon

  • [ ] Export chat history
  • [ ] Custom AI personalities
  • [ ] Real-time collaboration
  • [ ] Voice cloning

Performance

  • [ ] Response caching
  • [ ] Data compression

โญ Star the repo โ€ข ๐Ÿž Report bugs


Top comments (0)