Skip to content
Gautam-R-PatilPublic

About

Viber AI is a generative AI that builds complete, full-stack applications from your ideas. Just describe your app via text or our interactive voice agent, and it generates the entire frontend, backend, and database. It’s "Vibe Coding"—turning your vision into a production-ready project.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Viber AI - Multi-Agent AI Web Development Platform

🧠 Viber AI

A Multi-Agent AI Platform That Turns Ideas Into Production-Ready Websites

Powered by Google Gemini 2.5 · Multi-Agent Orchestration · Real-Time Voice · Live Code Generation

React 19 TypeScript Vite Gemini Tailwind Monaco

Features · Architecture · Tech Stack · Agent System · Getting Started · Project Structure


📌 Overview

Viber AI is a full-stack, multi-agent AI web development platform that transforms natural language descriptions into complete, production-ready websites — in real-time. It simulates an entire software development team using specialized AI agents, each with distinct responsibilities: requirement gathering, PRD generation, code synthesis, quality assurance, and delivery.

Unlike simple AI chatbots that generate a single code snippet, Viber AI orchestrates a 7-phase software development lifecycle with autonomous agent-to-agent communication, automated code review loops, and an integrated IDE — all running in the browser.

🎯 Key Differentiator: This is not just a code generator. It's an autonomous AI development team with a Manager, Frontend Engineer, QA Reviewer, Voice Product Manager, and Prompt Enhancer — all coordinating through a structured state machine to deliver audited, accessible, and standards-compliant code.


✨ Features

🤖 Multi-Agent AI Orchestration

Agent Role Model Capabilities
Manager AI Lead Coordinator & Product Manager gemini-2.5-flash Requirement gathering, PRD generation, workflow orchestration, Google Search grounding
Frontend AI Expert Web Developer gemini-2.5-flash / gemini-2.5-pro Full website code generation with HTML, CSS, JS, multi-file streaming
Reviewer AI Senior QA Engineer gemini-2.5-flash Accessibility audits (WCAG), code quality checks, PRD compliance verification
Voice AI Voice Product Manager gemini-2.5-flash-native-audio Real-time voice conversations via Gemini Live API with function calling
Enhancer AI Prompt Engineer gemini-2.5-flash One-click prompt enhancement from simple ideas to detailed specifications
Memory AI Knowledge Consolidator gemini-2.5-flash Cross-project learning via persistent knowledge base

🔄 7-Phase Autonomous Workflow

┌─────────────────┐    ┌──────────┐    ┌────────────┐    ┌─────────────────┐
│  REQUIREMENT    │───▶│ PLANNING │───▶│ PRD REVIEW │───▶│ CODE GENERATION │
│  GATHERING      │    │          │    │ (Editable) │    │   (Streaming)   │
└─────────────────┘    └──────────┘    └────────────┘    └────────┬────────┘
                                                                  │
┌─────────────┐    ┌─────────────┐    ┌──────────┐               │
│  DELIVERY   │◀───│ USER REVIEW │◀───│  REVIEW  │◀──────────────┘
│  (Download) │    │             │    │  (Auto)  │──── Reject ───▶ Re-generate
└─────────────┘    └─────────────┘    └──────────┘

🎤 Real-Time Voice Interface

  • Gemini Live API integration for real-time, bidirectional audio conversations
  • Live speech-to-text transcription for both user and AI
  • Custom function calling (endConversationAndCreatePrd) to seamlessly transition from voice to PRD generation
  • Full Web Audio API integration with PCM encoding/decoding at 16kHz input / 24kHz output
  • Visual orb animations with distinct states: listening, speaking, thinking, muted

🖥️ Integrated Browser IDE

  • Monaco Editor (VS Code's editor engine) with full syntax highlighting
  • AI-powered code completion via Gemini with context-aware suggestions
  • Live preview with real-time HTML/CSS/JS rendering in a sandboxed iframe
  • Resizable split-pane layout (Editor Only / Preview Only / Split View)
  • File explorer with collapsible folder tree and search with match highlighting
  • Multi-tab file editing with tab management (open, close, switch)
  • One-click ZIP download of all generated project files via JSZip

🧠 Persistent AI Memory (Knowledge Base)

  • Automatic project summarization on completion using dedicated Gemini calls
  • Cross-project context injection into Manager AI's system prompt
  • Memory management UI with clear/reset functionality
  • localStorage persistence for both projects and knowledge base

⚡ Advanced Prompt Enhancement

  • One-click transformation of simple ideas into detailed, structured prompts
  • Dedicated Enhancer AI agent with specialized system instructions
  • Seamlessly enriches prompts with target audience, design aesthetics, features, and content specifications

🔍 Google Search Grounding

  • Real-time web research during requirement gathering
  • Grounding sources displayed inline with citations
  • Enables the Manager AI to provide informed, context-aware suggestions

🧩 Thinking Mode (Extended Reasoning)

  • Toggle between gemini-2.5-flash (fast) and gemini-2.5-pro (deep thinking)
  • Extended thinking budget of 32,768 tokens for complex projects
  • Visual indicators for thinking mode in the UI
  • [THINK]...[/THINK] protocol for transparent AI reasoning visible to users

🏗 Architecture

Viber AI Architecture

System Architecture Overview

graph TB
    subgraph Client["Browser Client (React 19 + Vite)"]
        UI[UI Components] --> SM[State Machine]
        SM --> WS[Workflow Sidebar]
        SM --> CP[Chat Panel]
        SM --> IDE[IDE View Panel]
        SM --> VO[Voice Overlay]
        IDE --> ME[Monaco Editor]
        IDE --> LP[Live Preview iframe]
        IDE --> FE[File Explorer + Tree]
    end

    subgraph Services["Service Layer"]
        GS[geminiService.ts] --> |REST API| GF[Gemini Flash 2.5]
        GS --> |REST API| GP[Gemini Pro 2.5]
        GS --> |WebSocket| GL[Gemini Live Audio API]
        GS --> |Streaming| SC[Code Stream Parser]
        GS --> |Retry + Backoff| RB[Error Recovery Engine]
    end

    subgraph Agents["AI Agent System (Prompt Engineering)"]
        MA[Manager Agent] --> |"[CREATE_PRD]"| PRD[PRD Document]
        MA --> |"[GENERATE]"| FA[Frontend Agent]
        FA --> |Streaming Files| RA[Reviewer Agent]
        RA --> |"[REVIEW_APPROVED]"| MA
        RA --> |"[REVIEW_REJECTED]"| FA
        VA[Voice Agent] --> |Function Calling| MA
        EA[Enhancer Agent] --> MA
        MEM[Memory Agent] --> MA
    end

    Client --> Services
    Services --> Agents
Loading

Key Architectural Decisions

Decision Rationale
Multi-agent over monolithic Specialized prompts per agent yield dramatically better output quality than a single-prompt approach
Streaming code generation Users see files appear in real-time, providing immediate feedback and reducing perceived latency
State machine workflow Deterministic 7-phase pipeline prevents agents from skipping steps or producing incomplete output
Ref-based async management useRef for async callbacks prevents stale closure bugs common in complex React state management
Protocol-based agent communication [GENERATE], [CREATE_PRD], [REVIEW_APPROVED] commands provide reliable inter-agent signaling
Client-side architecture Zero backend dependency — entire platform runs in the browser with direct Gemini API calls

🛠 Tech Stack

Frontend Framework

Technology Version Purpose
React 19.2 UI framework with hooks, memoization, refs for async management
TypeScript 5.8 Type-safe development with strict mode, generics, discriminated unions
Vite 6.2 Lightning-fast HMR, ESM-native build tooling, environment variable injection

AI & ML

Technology Version Purpose
Google Gemini 2.5 Flash Latest Primary model for Manager, Reviewer, Enhancer, Memory agents
Google Gemini 2.5 Pro Latest Advanced thinking mode for complex code generation
Gemini Live Audio API Preview Real-time bidirectional voice conversations (WebSocket)
Google Search Grounding — Real-time web research for requirement enrichment
@google/genai SDK 1.28+ Official Google GenAI JavaScript SDK

Editor & IDE

Technology Version Purpose
Monaco Editor 0.54 VS Code editor engine — syntax highlighting, autocomplete, minimap
@monaco-editor/react 4.6 React integration for Monaco with CDN-based worker loading

Styling & UI

Technology Purpose
Tailwind CSS Utility-first styling with responsive design
Custom CSS Animations Voice orb animations (pulse, glow, swirl), checkmark animations, folder transitions
Web Audio API Real-time PCM audio processing for voice chat

Utilities

Technology Version Purpose
JSZip 3.10 Client-side ZIP file generation for project download
localStorage — Persistent state for projects, knowledge base, and chat history

🤖 Agent System

Agent Communication Protocol

Viber AI uses a command-based protocol for inter-agent communication. Each command triggers a state transition in the workflow state machine:

// State machine transitions driven by agent commands
type WorkflowState =
  | 'WELCOME'
  | 'REQUIREMENT_GATHERING'  // Manager gathers user requirements
  | 'PLANNING'               // Manager synthesizes information
  | 'PRD_REVIEW'             // User reviews/edits the PRD
  | 'CODE_GENERATION'        // Frontend AI generates code
  | 'REVIEW'                 // Reviewer AI audits code quality
  | 'USER_REVIEW'            // User reviews the final output
  | 'DELIVERY';              // Project complete, ready for download

Inter-Agent Commands

Command Emitting Agent Receiving Agent Action
[CREATE_PRD] Manager System Generates editable PRD document
[GENERATE] Manager Frontend Triggers full code generation
[REVIEW_APPROVED] Reviewer Manager Code passes QA — proceed to user review
[REVIEW_REJECTED] Reviewer Manager → Frontend Code fails QA — re-generate with feedback
[PROJECT_COMPLETE] Manager System Marks project as delivered
[THINK]...[/THINK] All Agents UI Transparent reasoning visible to users

Resilience Engineering

// Intelligent retry with API-suggested delays
async function retryWithBackoff<T>(
    operation: () => Promise<T>,
    isRetryable: (error: any) => boolean,
    maxRetries: number = 5,
    initialDelay: number = 2000
): Promise<T>
  • Exponential backoff with configurable initial delay
  • API-suggested retry delay parsing from google.rpc.RetryInfo
  • Handles 429 RESOURCE_EXHAUSTED and 503 UNAVAILABLE errors
  • Separate retry configurations for user-facing features vs. background tasks

🚀 Getting Started

Prerequisites

Installation

# Clone the repository
git clone https://github.com/Gautam-R-Patil/Viber-AI.git
cd Viber-AI

# Install dependencies
npm install

# Create environment file
echo "GEMINI_API_KEY=your_api_key_here" > .env

# Start development server
npm run dev

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

Environment Variables

Variable Required Description
GEMINI_API_KEY ✅ Your Google Gemini API key from AI Studio

📁 Project Structure

viber-ai/
├── 📄 index.html                  # Entry HTML with import maps, CSS animations, Tailwind CDN
├── 📄 index.tsx                   # App bootstrap, Monaco Editor CDN initialization
├── 📄 App.tsx                     # Main application (990 lines) — state management, workflow engine
├── 📄 types.ts                    # TypeScript interfaces and type definitions
├── 📄 vite.config.ts              # Vite config with env injection, path aliases
├── 📄 tsconfig.json               # TypeScript strict configuration
├── 📄 package.json                # Dependencies and scripts
├── 📄 PRD.md                      # Meta-PRD documenting the Manager AI's workflow
│
├── 📂 components/
│   ├── ChatPanel.tsx              # AI chat interface with message rendering, file attachments
│   ├── IdeViewPanel.tsx           # Full IDE with split-pane editor + live preview
│   ├── EditableCodeEditor.tsx     # Monaco Editor wrapper with AI code completion
│   ├── WorkflowSidebar.tsx        # Project history, workflow stepper, AI memory, thinking mode
│   ├── VoiceOverlay.tsx           # Voice chat UI with animated orb and transcription
│   ├── WelcomeScreen.tsx          # Landing screen with new project + demo actions
│   ├── FileExplorer.tsx           # Sidebar file explorer with search
│   ├── FileTree.tsx               # Recursive folder tree with expand/collapse
│   ├── FileTabs.tsx               # Multi-tab file navigation bar
│   └── icons.tsx                  # SVG icon library + agent/file type icon components
│
├── 📂 services/
│   └── geminiService.ts           # Gemini API abstraction layer (662 lines)
│       ├── generateWebsiteCodeStream()    # Streaming code generation with file parsing
│       ├── getAgentResponse()             # Single-turn agent API calls
│       ├── getAgentResponseStream()       # Streaming agent responses with grounding
│       ├── connectLiveSession()           # Gemini Live API WebSocket connection
│       ├── getCodeSuggestions()           # AI-powered code completion
│       ├── enhancePrompt()               # Prompt enhancement pipeline
│       ├── summarizeProjectForMemory()    # Knowledge base entry generation
│       ├── retryWithBackoff()            # Resilient API call retry logic
│       └── createBlob()                  # PCM audio encoding for Live API
│
├── 📂 hooks/
│   └── useDebounce.ts             # Generic debounce hook for live preview optimization
│
└── 📂 prompts/agents/
    ├── manager.ts                 # Manager AI system prompt — workflow orchestrator
    ├── frontend.ts                # Frontend AI system prompt — code generation specialist
    ├── reviewer.ts                # Reviewer AI system prompt — QA & accessibility auditor
    ├── voice.ts                   # Voice AI system prompt — voice interview conductor
    ├── enhancer.ts                # Enhancer AI system prompt — prompt engineering specialist
    ├── backend.ts                 # Backend AI system prompt (future expansion)
    └── integration.ts             # Integration AI system prompt (future expansion)

🔬 Technical Deep Dives

Streaming Code Parser

The code generation pipeline uses a custom streaming parser that processes files in real-time as they arrive from Gemini:

// Custom file boundary protocol
`[START_FILE:path/to/filename.ext]`
... file content streamed in chunks ...
`[END_FILE:path/to/filename.ext]`

The parser handles edge cases including:

  • Partial markers split across chunks
  • Implicit file boundaries (missing END_FILE tags)
  • [THINK] block extraction before code starts
  • Buffer management to prevent partial marker consumption

Live Preview Engine

Generated websites render instantly in a sandboxed iframe:

  1. HTML file detection and prioritization
  2. CSS <link> tags resolved and inlined as <style> blocks
  3. JS <script> tags resolved and inlined
  4. Debounced updates (300ms) prevent excessive re-renders during streaming

Voice Chat Pipeline

Microphone → AudioContext (16kHz) → ScriptProcessor → PCM → Base64
    → Gemini Live API (WebSocket) → Base64 → PCM → AudioBuffer (24kHz)
    → AudioBufferSourceNode → Speaker
  • Supports interruption handling (stops playback when user speaks)
  • Turn-based transcription tracking with automatic history persistence
  • Function calling for workflow transitions (endConversationAndCreatePrd)

🔮 Roadmap

  • Backend AI Agent — Node.js/Express API generation
  • Integration AI Agent — Third-party API integration (payments, auth)
  • Multi-page app support — SPA routing with React/Vue generation
  • Collaborative editing — Real-time multi-user sessions
  • Deployment pipeline — One-click deploy to Vercel/Netlify
  • Version control — Built-in Git-like diffing and history
  • Component library — Reusable component marketplace

📊 Project Metrics

Metric Value
Total TypeScript/TSX ~5,500+ lines
AI Agent Prompts 7 specialized system instructions
React Components 10 modular components
Gemini Models Used 4 (Flash, Pro, Live Audio, Search)
Workflow States 7 deterministic phases
API Service Functions 8 core functions with retry logic

📄 License

This project is open source and available under the MIT License.


Built with 🧠 by Gautam R Patil

If this project impressed you, consider giving it a ⭐

About

Viber AI is a generative AI that builds complete, full-stack applications from your ideas. Just describe your app via text or our interactive voice agent, and it generates the entire frontend, backend, and database. It’s "Vibe Coding"—turning your vision into a production-ready project.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages