All projects
PROJECTlive

Portfolio AI Voice Agent — Sada

A real-time browser-based AI voice assistant that lets portfolio visitors speak naturally, see live transcription and receive grounded spoken answers backed by RAG and multi-turn memory.

The browser captures microphone audio, resamples it to PCM16 at 16 kHz and streams it over a WebSocket to FastAPI. Deepgram performs real-time speech recognition with interim transcripts. Once the user finishes speaking, MongoDB memory, Pinecone retrieval and the ElevenLabs connection are prepared in parallel. Retrieved portfolio context and conversation memory are passed to Gemini for streaming response generation. Gemini text is immediately forwarded to ElevenLabs streaming TTS, and generated MP3 audio plus alignment timing data are streamed back to the browser for synchronized playback and captions.

Source code
PROJECT MEDIA

Demo & screenshots

Sada AI Voice Agent Demo
Sada real-time AI voice agent browser interface
Real-Time Voice Conversation Interface
THE SYSTEM, STEP BY STEP

System flow

01Portfolio Visitor
→
02Browser Microphone
→
03Web Audio API
→
04WebSocket /ws/call
→
05FastAPI
→
06Deepgram Nova-3
→
07MongoDB Memory
→
08Pinecone RAG
→
09Google Gemini
→
10ElevenLabs TTS
→
11MP3 Playback + Synced Captions

Click Play a Run to follow the system from start to finish.

What it is

Sada is a portfolio-native real-time AI voice assistant built with FastAPI, WebSockets, Deepgram, Pinecone, Gemini, MongoDB and ElevenLabs. Visitors can speak directly through their browser microphone, watch their words appear while they are still talking, receive portfolio-specific answers grounded in retrieved knowledge and hear the AI response while its text appears in sync with the generated speech.

The problem it solves

Traditional portfolio websites require visitors to manually browse multiple sections to understand a developer's experience, skills and projects. A text chatbot improves discovery, but still requires typing. The goal of Sada was to create a natural voice interaction where visitors can ask questions conversationally while keeping answers grounded in real portfolio information.

How it works

  1. Real-time browser microphone audio streaming

  2. Live user transcription while speaking

  3. Deepgram Nova-3 streaming speech-to-text

  4. Interim and final transcription handling

  5. Pinecone retrieval-augmented generation

  6. Grounded answers from portfolio knowledge

  7. Pinecone llama-text-embed-v2 embeddings

  8. Top-3 semantic knowledge retrieval

  9. MongoDB multi-turn conversation memory

  10. Three-phase conversation memory strategy

  11. Automatic TTL cleanup for expired sessions

  12. Gemini streaming response generation

  13. ElevenLabs WebSocket streaming text-to-speech

  14. Character-aligned synchronized agent captions

  15. Incremental MP3 playback through MediaSource

  16. Parallel RAG, memory and TTS preparation

  17. Pre-connected TTS to reduce response latency

  18. Browser microphone suppression while the agent speaks

  19. LISTENING, THINKING and SPEAKING call-state management

  20. API key and account rotation with fallback handling

  21. Clean WebSocket and speech-session cleanup when calls end

The engineering focus

The browser captures microphone audio, resamples it to PCM16 at 16 kHz and streams it over a WebSocket to FastAPI. Deepgram performs real-time speech recognition with interim transcripts. Once the user finishes speaking, MongoDB memory, Pinecone retrieval and the ElevenLabs connection are prepared in parallel. Retrieved portfolio context and conversation memory are passed to Gemini for streaming response generation. Gemini text is immediately forwarded to ElevenLabs streaming TTS, and generated MP3 audio plus alignment timing data are streamed back to the browser for synchronized playback and captions.

Built with

See the other projects