# Project export: Phone AI

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: TreeHacks 2026
- Tagline: Phone AI is your personal agent for every call. It makes and takes calls on your behalf, using history to get things done. Reclaim your time and stay focused on what matters.
- Devpost: https://devpost.com/software/a3-artificial-assistant-for-anything
- GitHub: https://github.com/kanakapalli/phone_ai
- Demo: https://drive.google.com/file/d/1IuLlNh3Poz_nuAmB5I0EcVFNyM9imcmb/view?usp=sharing
- Video: https://www.youtube.com/embed/mraVC2SK5qA?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 0 GitHub contributor(s) — 

## Devpost submission (written by the team)

### Overview

The

### Inspiration

In a world of constant digital noise, our phones have become sources of disruption. Between relentless marketing calls, promotional spam, and the anxiety of "unknown numbers," we are losing our most valuable asset: focus. As a developer and an introvert, I realized that many of us face major hurdles: The Noise: Endless random calls that break our deep work. The Social Drain: The mental energy required for "small-talk" errands when we just want to stay focused on what matters. The Broadcast Burden: The difficulty of sharing information with many people simultaneously without losing hours to manual calling. The Memory Gap: Trying to recall exactly what was discussed in a call weeks or months ago. I was inspired to build AI Phone — a "Communication Shield" that doesn't just transcribe, but acts as your professional double. It makes and receives calls on your behalf, remembers every detail, and resolves errands while you live your life. What It Does AI Phone is a full-stack mobile application that delegates phone calls to an intelligent AI agent. At its core, it offers: Real-Time AI Voice Calls Initiate outbound calls through natural language missions ("Call my dentist and reschedule my appointment") AI speaks naturally using Gemini's Multimodal Live API with voice synthesis Bidirectional audio streaming with real-time transcription Automatic call completion with AI-generated summaries Customizable AI Agents Create multiple AI personas with distinct personalities Choose from 10 unique voice profiles: Aoede (casual), Charon (professional), Kore (calm), Fenrir (energetic), Leda (youthful), Orus (authoritative), Puck (playful), Zephyr (breeze), Vale (warm), Sage (British accent) Configure tone, behavior guidelines, and caller information Set language restrictions (single or multi-language support) Designate a primary agent for quick calls Context-Aware Memory Every call is transcribed and stored with a structured summary AI can access previous conversations with the same contact Ask your AI: "What did we discuss last time?" — it knows Knowledge Base Chat Chat interface to query your entire call history Gemini-powered RAG (Retrieval-Augmented Generation) for intelligent answers Referenced calls displayed alongside responses Unified Call Log Seamlessly merges AI calls with your device's native call history Contact integration with fast Trie-based search Filter by call type (AI vs. Device) How I Built It The project is built on an industrial-grade, full-stack architecture designed for real-time interaction: Architecture Overview Backend (The Engine) I used Serverpod as the backbone. Its Dart-first ORM and high-performance capabilities allowed me to build a seamless bridge between the database and the telephony logic. Key services include: MediaStreamHandler: Bidirectional WebSocket bridge between Twilio and Gemini AudioTranscoder: Real-time μ-law ↔ PCM conversion with upsampling/downsampling GeminiLiveService: Manages WebSocket connections to Gemini's real-time API CallSchedulerService: Handles scheduled calls via Serverpod's FutureCalls CallEventService: WebSocket broadcasting for live UI updates The Intelligence Gemini 2.5 Flash serves as the reasoning core via the Multimodal Live API. Using a RAG (Retrieval-Augmented Generation) system, I gave the AI a long-term memory by storing call histories in a PostgreSQL database. The AI has access to tool functions: get_call_history() — Retrieve previous conversations with the same contact end_call(reason, summary) — Autonomously terminate calls when mission complete Telephony Twilio Programmable Voice handles the global telephony infrastructure: REST API for call initiation with TwiML webhooks Media Streams for bidirectional audio via WebSocket Automatic call recording with MP3 storage Status callbacks for real-time call state tracking Frontend A clean Flutter interface with Riverpod state management across 12 screens: DialerScreen: Contact integration with Trie-based search CallAgentsScreen: Create and manage AI personas ActiveCallMonitorScreen: Live transcript and status updates CallHistoryScreen: Unified AI + device call log ChatScreen: Knowledge base queries with referenced calls Challenges I Faced: Mastering the Conversation Challenge 1: The Audio Mismatch The most significant hurdle was the Audio Format Gap. Telephony standards operate at 8,000 Hz μ-law (Narrowband), while Gemini requires high-fidelity PCM at 16,000 Hz for input and outputs at 24,000 Hz. Solution — Custom Audio Transcoder: I built a real-time audio transcoding pipeline with: Pre-computed μ-law decode/encode tables (256 entries) for O(1) conversion Linear interpolation for upsampling (8kHz → 16kHz) 3:1 averaging for downsampling (24kHz → 8kHz) 20ms audio chunks (~200 bytes) processed in real-time Challenge 2: The Latency Paradox For conversations to feel natural, the AI's first response must arrive in under 3 seconds. Initial tests showed 5+ second delays. Solution — Gemini Pre-initialization: Instead of waiting for Twilio to connect before initializing Gemini, I start the Gemini WebSocket connection during call setup. By the time the recipient answers, the AI is ready to speak. Challenge 3: Transcript Persistence Real-time transcripts were being lost when calls ended abruptly. The solution involved: Debounced database updates (500ms) to avoid excessive writes Saving transcript before broadcasting status changes FutureCall-based post-call analysis with 5-second delay Challenge 4: Memory Retrieval at Scale The AI needs instant access to call history for context-aware conversations: [ T(n) = O(\log n) ] By optimizing PostgreSQL indexes on (userId, phoneNumber, completedAt), the AI retrieves relevant history from thousands of calls in milliseconds. What I Learned I learned that the future of AI isn't about replacing human connection; it's about filtering the noise. Building this taught me: Technical Insights Real-time systems are unforgiving: Every millisecond matters. A 100ms delay in audio processing compounds into awkward pauses. State synchronization is hard: Coordinating state between Flutter, Serverpod, Twilio, and Gemini required careful event-driven architecture. Audio engineering is its own discipline: Understanding μ-law encoding, sample rates, and interpolation algorithms opened a new world. Product Insights Context is everything: An assistant that remembers previous conversations is infinitely more valuable than one that just talks. Voice UX differs from chat UX: Users expect immediate responses. Silence feels like failure. Customization breeds adoption: Letting users create their own AI personas with unique voices and behaviors dramatically increases engagement. Architecture Insights Dart everywhere works: Having Flutter, Serverpod, and shared models all in Dart eliminated entire categories of bugs. WebSocket > Polling: Real-time updates via WebSocket broadcasting transformed the user experience. Pre-computation pays off: Lookup tables for audio conversion, Trie structures for contact search — these optimizations compound. The Call Flow Here's how a typical AI call works end-to-end: Tech Stack Summary Future Roadmap AI Phone is just the beginning. The next 12 months will focus on: Near-Term (Q1-Q2) Inbound Call Handling: Let AI answer calls on your behalf with caller ID screening Call Transfer: Seamless handoff to human operator with full context Multi-party Broadcasts: Call multiple recipients with the same message Mid-Term (Q3-Q4) Emotional Intelligence: Adapt AI's tone based on caller's urgency or mood Autonomous Scheduling: Calendar integration to resolve booking conflicts automatically Advanced Analytics: Success metrics, failure analysis, conversation insights Long-Term (Year 2) Visual Context: AI can "see" documents or images shared during calls Language Expansion: Localized voice profiles for any language or dialect Barge-in Detection: Allow user to interrupt and take over mid-call Project Statistics The Impact AI Phone is for the busy professional, the introvert, and anyone tired of the noise. Whether you need to: Handle a tedious customer service call while you focus on work Follow up with leads without the mental drain of repetitive conversations Schedule appointments while your AI remembers all the details Query your call history — "What did the insurance company say last month?" AI Phone ensures you can reclaim your time and stay focused on what actually matters. Try It Yourself The project demonstrates: Full-stack Dart development (Flutter + Serverpod) Real-time WebSocket communication Audio engineering with format transcoding AI integration with tool calling Production-grade state management Built with passion for developers who value their focus.

## README (from the GitHub repository)

<p align="center">
  <img src="phone_ai_flutter/assets/app_logo/phoneaiapp_logo.png" alt="AI Phone Logo" width="200"/>
</p>

<h1 align="center">AI Phone</h1>

<p align="center">
  <strong>An AI-powered phone assistant that makes calls on your behalf.</strong><br>
  Tell it what you need, and it handles the conversation.
</p>

## About

AI Phone is a full-stack mobile application that delegates phone calls to an intelligent AI agent. Give it a mission like *"Call my dentist and reschedule my appointment"* — the AI makes the call, has a natural conversation, and reports back with a summary.

### Key Features

- **AI Voice Calls** — AI makes real phone calls and speaks naturally
- **Live Transcription** — Watch the conversation in real-time
- **Call Memory** — AI remembers previous conversations with the same contact
- **Custom AI Agents** — Create personas with different voices and personalities
- **10 Voice Options** — Professional, casual, energetic, calm, and more
- **Scheduled Calls** — Set calls to happen at a specific time
- **Call History Search** — Ask questions about past calls in plain English

## Architecture

```
┌─────────────────────────────────────────────────────────────────┐
│                        Flutter Mobile App                       │
│   (Riverpod State Management • 12 Screens • Contact Integration)│
└─────────────────────────┬───────────────────────────────────────┘
                          │ REST + WebSocket
┌─────────────────────────▼───────────────────────────────────────┐
│                     Serverpod Backend                           │
│  (Dart-first ORM • Real-time Streams • FutureCalls Scheduling)  │
└───────────┬─────────────────────────────────────────────────────┘
            │
    ┌───────┴───────┐
    │               │
┌───▼───┐       ┌───▼───────────────────┐
│Twilio │◀─────▶│   Gemini Live API     │
│ Voice │ Audio │ (Speech-to-Speech AI) │
└───────┘ Bridge└───────────────────────┘
```

### Tech Stack

| Component | Technology |
|-----------|------------|
| Mobile App | Flutter 3.32 |
| State Management | Riverpod 2.5 |
| Backend | Serverpod 3.2 |
| Database | PostgreSQL |
| AI Engine | Gemini 2.5 Flash (Multimodal Live API) |
| Telephony | Twilio Programmable Voice |
| Real-time | WebSocket |

## Project Structure

```
phone_ai/
├── phone_ai_flutter/          # Flutter mobile app
│   ├── lib/
│   │   ├── screens/           # UI screens (12 screens)
│   │   ├── providers/         # Riverpod state management
│   │   ├── widgets/           # Reusable components
│   │   └── constants/         # App constants
│   └── pubspec.yaml
│
├── phone_ai_server/           # Serverpod backend
│   ├── lib/src/
│   │   ├── services/          # Core services
│   │   │   ├── gemini_live_service.dart
│   │   │   ├── twilio_service.dart
│   │   │   └── audio_transcoder.dart
│   │   ├── websocket/         # WebSocket handlers
│   │   ├── calls/             # Call endpoints
│   │   └── web/routes/        # HTTP routes
│   └── config/
│       └── passwords.yaml     # Credentials (not in git)
│
├── phone_ai_client/           # Generated client code
└── docs/                      # Documentation
    └── passwords.sample.yaml  # Sample credentials file
```

## Prerequisites

Before running the project, you need:

1. **Flutter SDK** (3.32+)
2. **Dart SDK** (3.0+)
3. **Docker** (for PostgreSQL and Redis)
4. **ngrok** (for local development webhooks)
5. **Twilio Account** — [Get one here](https://www.twilio.com/try-twilio)
6. **Google AI API Key** — [Get one here](https://ai.google.dev/)

## Setup Instructions

### Step 1: Clone the Repository

```bash
git clone https://github.com/yourusername/phone_ai.git
cd phone_ai
```

### Step 2: Set Up Credentials

1. Copy the sample credentials file:
   ```bash
   cp docs/passwords.sample.yaml phone_ai_server/config/passwords.yaml
   ```

2. Edit `phone_ai_server/config/passwords.yaml` and fill in your credentials:

   **Twilio** (from [console.twilio.com](https://console.twilio.com)):
   - `twilio_account_sid` — Your Account SID (starts with 'AC')
   - `twilio_auth_token` — Your Auth Token
   - `twilio_phone_number` — Your Twilio phone number (E.164 format: +1234567890)

   **Gemini** (from [ai.google.dev](https://ai.google.dev)):
   - `gemini_api_key` — Your API key

   **Webhook URL** — See Step 4

### Step 3: Start the Database

```bash
cd phone_ai_server
docker compose up -d
```

This starts PostgreSQL and Redis containers.

### Step 4: Set Up ngrok (for Twilio webhooks)

Twilio needs to reach your local server via a public URL. ngrok creates a tunnel.

1. **Install ngrok:**
   ```bash
   # macOS
   brew install ngrok

   # Or download from https://ngrok.com/download
   ```

2. **Start ngrok:**
   ```bash
   ngrok http 8085
   ```

3. **Copy the HTTPS URL** (e.g., `https://abc123.ngrok-free.app`)

4. **Update passwords.yaml:**
   ```yaml
   webhook_base_url: 'https://abc123.ngrok-free.app'
   ```

   > **Important:** Every time you restart ngrok, you get a new URL. Update `passwords.yaml` accordingly.

### Step 5: Start the Backend Server

```bash
cd phone_ai_server
dart bin/main.dart
```

The server runs on `http://localhost:8080` (API) and `http://localhost:8085` (Web/Webhooks).

### Step 6: Run the Flutter App

```bash
cd phone_ai_flutter
flutter pub get
flutter run
```

## Running in Development

Here's the typical development workflow:

### Terminal 1: Database
```bash
cd phone_ai_server
docker compose up
```

### Terminal 2: ngrok
```bash
ngrok http 8085
# Copy the URL and update passwords.yaml
```

### Terminal 3: Backend Server
```bash
cd phone_ai_server
dart bin/main.dart
```

### Terminal 4: Flutter App
```bash
cd phone_ai_flutter
flutter run
```

## Configuration Reference

### passwords.yaml

| Key | Description | Where to Get It |
|-----|-------------|-----------------|
| `twilio_account_sid` | Twilio Account SID | [Twilio Console](https://console.twilio.com) |
| `twilio_auth_token` | Twilio Auth Token | [Twilio Console](https://console.twilio.com) |
| `twilio_phone_number` | Your Twilio phone number | [Twilio Console > Phone Numbers](https://console.twilio.com/us1/develop/phone-numbers/manage/incoming) |
| `webhook_base_url` | Public URL for webhooks | ngrok or your server domain |
| `gemini_api_key` | Google AI API key | [Google AI Studio](https://ai.google.dev) |
| `gemini_live_model` | Model for voice calls | Default: `gemini-2.5-flash-preview-native-audio-dialog` |
| `gemini_analysis_model` | Model for summaries | Default: `gemini-2.5-pro` |

### Twilio Setup

1. Create a Twilio account at [twilio.com](https://www.twilio.com/try-twilio)
2. Get a phone number with **Voice** capability
3. Your webhooks will be automatically configured when calls are initiated

### ngrok Tips

- **Free tier** works fine for development
- **Keep ngrok running** while testing calls
- **Update webhook_base_url** every time ngrok restarts (new URL each time)
- For persistent URLs, consider [ngrok paid plans](https://ngrok.com/pricing) or deploy to a server

## Troubleshooting

### "No audio from AI"
- Check that `webhook_base_url` in passwords.yaml matches your current ngrok URL
- Ensure ngrok is running: `ngrok http 8085`
- Check server logs for errors

### "Call fails to connect"
- Verify Twilio credentials are correct
- Check that your Twilio phone number has Voice capability
- Ensure the destination number is in E.164 format (+1234567890)

### "Gemini connection error"
- Verify your Gemini API key is valid
- Check that the model names are correct
- Ensure you have API access to the Multimodal Live API

### "Database connection error"
- Make sure Docker is running: `docker compose up -d`
- Check PostgreSQL logs: `docker compose logs postgres`

## API Endpoints

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/call/initiateCall` | POST | Start a new AI call |
| `/call/getCallStatus` | GET | Get call status by ID |
| `/call/getCallHistory` | GET | Get user's call history

[README truncated for size]

## Detected evidence (automated analysis)

Indexed codebase: 171 recognized source files, 1054 KB.
- C (language) — detected in the code
- C++ (language) — detected in the code
- CSS (language) — detected in the code
- Dart (language) — detected in the code
- HTML (language) — detected in the code
- Kotlin (language) — detected in the code
- SQL (language) — detected in the code
- Swift (language) — detected in the code
- AI coding agent: Claude Code — evidence: config files committed to the repository

## Codebase structure (from repository index)

### Files (120 of 254)

```
.claude/settings.json
.github/workflows/analyze.yml
.github/workflows/format.yml
.github/workflows/tests.yml
.vscode/settings.json
docs/CALL_FLOW_ARCHITECTURE.md
docs/CALL_STATUS_TRANSCRIPT_FIXES.md
docs/flow.md
docs/passwords.sample.yaml
docs/project_story.md
phone_ai_client/.gitignore
phone_ai_client/analysis_options.yaml
phone_ai_client/CHANGELOG.md
phone_ai_client/dartdoc_options.yaml
phone_ai_client/doc/endpoint.md
phone_ai_client/lib/phone_ai_client.dart
phone_ai_client/lib/src/protocol/agents/call_agent.dart
phone_ai_client/lib/src/protocol/calls/call_request.dart
phone_ai_client/lib/src/protocol/calls/call_response.dart
phone_ai_client/lib/src/protocol/calls/call_session.dart
phone_ai_client/lib/src/protocol/calls/call_status.dart
phone_ai_client/lib/src/protocol/chat/chat_message.dart
phone_ai_client/lib/src/protocol/chat/chat_request.dart
phone_ai_client/lib/src/protocol/chat/chat_response.dart
phone_ai_client/lib/src/protocol/client.dart
phone_ai_client/lib/src/protocol/future_calls/initiate_call_args.dart
phone_ai_client/lib/src/protocol/future_calls/post_call_analysis_args.dart
phone_ai_client/lib/src/protocol/greetings/greeting.dart
phone_ai_client/lib/src/protocol/protocol.dart
phone_ai_client/pubspec.yaml
phone_ai_client/README.md
phone_ai_flutter/.gitignore
phone_ai_flutter/.metadata
phone_ai_flutter/analysis_options.yaml
phone_ai_flutter/android/.gitignore
phone_ai_flutter/android/app/build.gradle.kts
phone_ai_flutter/android/app/src/debug/AndroidManifest.xml
phone_ai_flutter/android/app/src/main/AndroidManifest.xml
phone_ai_flutter/android/app/src/main/kotlin/com/example/phone_ai_flutter/MainActivity.kt
phone_ai_flutter/android/app/src/main/res/drawable-v21/launch_background.xml
phone_ai_flutter/android/app/src/main/res/drawable/launch_background.xml
phone_ai_flutter/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
phone_ai_flutter/android/app/src/main/res/values-night/styles.xml
phone_ai_flutter/android/app/src/main/res/values/colors.xml
phone_ai_flutter/android/app/src/main/res/values/styles.xml
phone_ai_flutter/android/app/src/profile/AndroidManifest.xml
phone_ai_flutter/android/build.gradle.kts
phone_ai_flutter/android/gradle.properties
phone_ai_flutter/android/gradle/wrapper/gradle-wrapper.properties
phone_ai_flutter/android/settings.gradle.kts
phone_ai_flutter/assets/config.json
phone_ai_flutter/ios/.gitignore
phone_ai_flutter/ios/Flutter/AppFrameworkInfo.plist
phone_ai_flutter/ios/Flutter/Debug.xcconfig
phone_ai_flutter/ios/Flutter/Release.xcconfig
phone_ai_flutter/ios/Podfile
phone_ai_flutter/ios/Podfile.lock
phone_ai_flutter/ios/Runner.xcodeproj/project.pbxproj
phone_ai_flutter/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
phone_ai_flutter/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
phone_ai_flutter/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
phone_ai_flutter/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
phone_ai_flutter/ios/Runner.xcworkspace/contents.xcworkspacedata
phone_ai_flutter/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
phone_ai_flutter/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
phone_ai_flutter/ios/Runner/AppDelegate.swift
phone_ai_flutter/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
phone_ai_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
phone_ai_flutter/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
phone_ai_flutter/ios/Runner/Base.lproj/LaunchScreen.storyboard
phone_ai_flutter/ios/Runner/Base.lproj/Main.storyboard
phone_ai_flutter/ios/Runner/Info.plist
phone_ai_flutter/ios/Runner/Runner-Bridging-Header.h
phone_ai_flutter/ios/RunnerTests/RunnerTests.swift
phone_ai_flutter/lib/constants/gemini_languages.dart
phone_ai_flutter/lib/main.dart
phone_ai_flutter/lib/providers/call_agents_provider.dart
phone_ai_flutter/lib/providers/call_providers.dart
phone_ai_flutter/lib/providers/contacts_provider.dart
phone_ai_flutter/lib/providers/user_provider.dart
phone_ai_flutter/lib/screens/active_call_monitor_screen.dart
phone_ai_flutter/lib/screens/call_agents_screen.dart
phone_ai_flutter/lib/screens/call_detail_screen.dart
phone_ai_flutter/lib/screens/call_history_screen.dart
phone_ai_flutter/lib/screens/chat_screen.dart
phone_ai_flutter/lib/screens/contacts_screen.dart
phone_ai_flutter/lib/screens/device_call_detail_screen.dart
phone_ai_flutter/lib/screens/dialer_screen.dart
phone_ai_flutter/lib/screens/main_navigation.dart
phone_ai_flutter/lib/screens/onboarding_call_agent_screen.dart
phone_ai_flutter/lib/screens/profile_screen.dart
phone_ai_flutter/lib/screens/sign_in_screen.dart
phone_ai_flutter/lib/widgets/call_options_bottom_sheet.dart
phone_ai_flutter/linux/.gitignore
phone_ai_flutter/linux/CMakeLists.txt
phone_ai_flutter/linux/flutter/CMakeLists.txt
phone_ai_flutter/linux/flutter/generated_plugin_registrant.cc
phone_ai_flutter/linux/flutter/generated_plugin_registrant.h
phone_ai_flutter/linux/flutter/generated_plugins.cmake
phone_ai_flutter/linux/runner/CMakeLists.txt
phone_ai_flutter/linux/runner/main.cc
phone_ai_flutter/linux/runner/my_application.cc
phone_ai_flutter/linux/runner/my_application.h
phone_ai_flutter/macos/.gitignore
phone_ai_flutter/macos/Flutter/Flutter-Debug.xcconfig
phone_ai_flutter/macos/Flutter/Flutter-Release.xcconfig
phone_ai_flutter/macos/Flutter/GeneratedPluginRegistrant.swift
phone_ai_flutter/macos/Podfile
phone_ai_flutter/macos/Podfile.lock
phone_ai_flutter/macos/Runner.xcodeproj/project.pbxproj
phone_ai_flutter/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
phone_ai_flutter/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
phone_ai_flutter/macos/Runner.xcworkspace/contents.xcworkspacedata
phone_ai_flutter/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
phone_ai_flutter/macos/Runner/AppDelegate.swift
phone_ai_flutter/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
phone_ai_flutter/macos/Runner/Base.lproj/MainMenu.xib
phone_ai_flutter/macos/Runner/Configs/AppInfo.xcconfig
phone_ai_flutter/macos/Runner/Configs/Debug.xcconfig
phone_ai_flutter/macos/Runner/Configs/Release.xcconfig
[134 more files omitted for size]
```

### Dependencies

No dependency index available.

### Recent commits (newest first)

- refactor: Reduce logging frequency in audio transcoding and Gemini services to minimize spam
- style: Update README layout for improved presentation and alignment
- feat: Add README and sample passwords.yaml for project setup and configuration
- Add call status and transcript update fixes, flow documentation, project story, and call options bottom sheet
- logo updated and app name
- feat: Enhance call history screen with silent refresh and lifecycle management
- refactor: enhance conversation flow and remove greeting retry mechanism in GeminiLiveService
- feat: implement transcript persistence and status synchronization in media stream handler
- Add database migration for call_agent table enhancements
- feat(database): add call_agent and related tables with UUID v7 support
- refactor: Update call option handling and improve UI components across screens
- Add migration files for call_agent table creation
- Merge remote-tracking branch 'origin/black_and_white'
- refactor: Remove GreetingsScreen and optimize media stream handling for lower latency
- refactor: Enhance SignInScreen structure with dynamic form handling and improved UI components
- serverside
- Merge branch 'main' into black_and_white
- chat fix
- Refactor MainNavigation and Profile screens for improved UI and functionality
- feat: Add user profile management with shared preferences

## Key source files (fetched from GitHub, selected and truncated for size)

### project_story.md

```markdown
# Project Story: AI Phone — Your Autonomous Communication Agent

## The Inspiration

In a world of constant digital noise, our phones have become sources of disruption. Between relentless marketing calls, promotional spam, and the anxiety of *"unknown numbers,"* we are losing our most valuable asset: **focus**.

As a developer and an introvert, I realized that many of us face major hurdles:

- **The Noise:** Endless random calls that break our deep work.
- **The Social Drain:** The mental energy required for "small-talk" errands when we just want to stay focused on what matters.
- **The Broadcast Burden:** The difficulty of sharing information with many people simultaneously without losing hours to manual calling.
- **The Memory Gap:** Trying to recall exactly what was discussed in a call weeks or months ago.

I was inspired to build **AI Phone** — a *"Communication Shield"* that doesn't just transcribe, but acts as your professional double. It makes and receives calls on your behalf, remembers every detail, and resolves errands while you live your life.

---

## What It Does

AI Phone is a mobile app that lets an AI assistant make phone calls for you. Simply tell it what you need — like "Call my dentist and reschedule my appointment" — and it handles the entire conversation.

### Real-Time AI Voice Calls
- **Give a mission in plain English** — "Call the restaurant and book a table for Saturday"
- **AI makes the call and talks naturally** — Using Google's Gemini AI with realistic voice
- **Watch the conversation live** — See what's being said in real-time on your screen
- **Get a summary when done** — Key points, outcomes, and any action items

### Customizable AI Agents
Create your own AI personas — like having multiple assistants for different situations:
- **10 unique voices** to choose from:
  - *Aoede* — Casual & conversational (great for everyday calls)
  - *Charon* — Professional & steady (perfect for business)
  - *Kore* — Calm & grounded (good for sensitive topics)
  - *Fenrir* — Fast & energetic (quick inquiries)
  - *Puck* — Upbeat & playful (friendly check-ins)
  - *Orus* — Deep & authoritative (important negotiations)
  - *Leda* — Soft & youthful (gentle reminders)
  - *Zephyr* — Bright & clear (general purpose)
  - *Sage* — British accent (formal requests)
  - *Vale* — Warm & engaging (relationship building)
- **Set personality and behavior** — How formal? How persistent?
- **Your identity** — AI introduces itself as calling on your behalf
- **Language preferences** — Single or multi-language support

### Context-Aware Memory
Your AI remembers everything:
- Every call is **recorded and transcribed**
- AI can **recall previous conversations** — "What did we discuss last time?"
- **Search your history** — "What did the insurance company say about my claim?"

### Knowledge Base Chat
- Ask questions about your call history in plain English
- AI finds relevant calls and gives you answers
- See which calls the answer came from

### Unifie
[truncated — 12529 more characters]
```

### phone_ai_client/CHANGELOG.md

```markdown
## 1.0.0

- Initial version, created by Stagehand

```

### phone_ai_server/Dockerfile

```
# Build stage
FROM dart:3.8.0 AS build
WORKDIR /app
COPY . .

# Install dependencies and compile the server executable
RUN dart pub get
RUN dart compile exe bin/main.dart -o bin/server

# Final stage
FROM alpine:latest

# Environment variables
ENV runmode=production
ENV serverid=default
ENV logging=normal
ENV role=monolith

# Copy runtime dependencies
COPY --from=build /runtime/ /

# Copy compiled server executable
COPY --from=build /app/bin/server server

# Copy configuration files and resources
COPY --from=build /app/config/ config/
COPY --from=build /app/web/ web/
COPY --from=build /app/migrations/ migrations/

# This file is required to enable the endpoint log filter in Insights.
COPY --from=build /app/lib/src/generated/protocol.yaml lib/src/generated/protocol.yaml

# Expose ports
EXPOSE 8080
EXPOSE 8081
EXPOSE 8082

# Define the entrypoint command
ENTRYPOINT ./server --mode=$runmode --server-id=$serverid --logging=$logging --role=$role

```

### phone_ai_server/docker-compose.yaml

```yaml
services:
  # Development services
  postgres:
    image: pgvector/pgvector:pg16
    ports:
      - "8090:5432"
    environment:
      POSTGRES_USER: postgres
      POSTGRES_DB: phone_ai
      POSTGRES_PASSWORD: "ZUx_dlGx7rB7jKxBnrZVsoTe-2lIY35L"
    volumes:
      - phone_ai_data:/var/lib/postgresql/data

  redis:
    image: redis:6.2.6
    ports:
      - "8091:6379"
    command: redis-server --requirepass "jRqMt1RAft5g4SdVN7mVtRT6SLf7OI2S"
    environment:
      - REDIS_REPLICATION_MODE=master

  # Test services
  postgres_test:
    image: pgvector/pgvector:pg16
    ports:
      - "9090:5432"
    environment:
      POSTGRES_USER: postgres
      POSTGRES_DB: phone_ai_test
      POSTGRES_PASSWORD: "e6Six33eM78v7ZTcmDwtzBo0IHtrVLTv"
    volumes:
      - phone_ai_test_data:/var/lib/postgresql/data

  redis_test:
    image: redis:6.2.6
    ports:
      - "9091:6379"
    command: redis-server --requirepass "t3VPBHxzCcXOUrBDe0SCak2RURdYebOn"
    environment:
      - REDIS_REPLICATION_MODE=master

volumes:
  phone_ai_data:
  phone_ai_test_data:

```

### phone_ai_server/dart_test.yaml

```yaml
tags:
  integration: {}

```

### phone_ai_client/dartdoc_options.yaml

```yaml
dartdoc:
  categories: 
    "Endpoint":
      markdown: doc/endpoint.md
      name: Endpoint
```

### phone_ai_client/pubspec.yaml

```yaml
name: phone_ai_client
description: Starting point for a Serverpod client.

environment:
  sdk: '^3.8.0'

dependencies:
  serverpod_auth_idp_client: 3.2.3
  serverpod_client: 3.2.3


```

### phone_ai_client/analysis_options.yaml

```yaml
# Defines a default set of lint rules enforced for
# projects at Google. For details and rationale,
# see https://github.com/dart-lang/pedantic#enabled-lints.

# For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
# Uncomment to specify additional rules.
# linter:
#   rules:
#     - camel_case_types

analyzer:
  exclude:
    - lib/src/protocol/**

formatter:
  trailing_commas: preserve

```

### phone_ai_server/pubspec.yaml

```yaml
name: phone_ai_server
description: Starting point for a Serverpod server.
# version: 1.0.0
# homepage: https://www.example.com

environment:
  sdk: '^3.8.0'

dependencies:
  serverpod: 3.2.3
  serverpod_auth_idp_server: 3.2.3
  http: ^1.2.0
  web_socket_channel: ^3.0.1
  mailer: ^6.1.0

dev_dependencies:
  lints: '>=3.0.0 <7.0.0'
  serverpod_test: 3.2.3
  test: ^1.25.5


serverpod:
  scripts:
    # Starts the server and applies migrations
    start: dart bin/main.dart --apply-migrations

    # Build the Flutter web app and move it to the server's web directory
    # 
    # Unfortunately, we can't use the `-o` flag directly because of an error
    # that happens on windows. Issue is tracked in the flutter
    # repository here: https://github.com/flutter/flutter/issues/157886
    flutter_build: cd ../phone_ai_flutter && flutter build web --base-href /app/ --wasm && rm -rf ../phone_ai_server/web/app && mv build/web/ ../phone_ai_server/web/app

```

### phone_ai_server/analysis_options.yaml

```yaml
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.

linter:
  rules:
    unawaited_futures: true
    avoid_print: true

analyzer:
  exclude:
    - lib/src/generated/**
    - test/integration/test_tools/serverpod_test_tools.dart
# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options

formatter:
  trailing_commas: preserve

```

[156 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]