Transform raw voice notes into structured, actionable personal memories using open-weight AI.
Built for the Hacktoberfest 2026 DEV Weekend Challenge: "Build for a Friend".
My friend records dozens of voice notes throughout the week—while commuting, walking between meetings, or capturing sudden startup ideas and daily errands.
A typical spoken recording sounds like this:
"Hey Sarah, I'm heading over to the office now. Please remember to finalize the Q4 investor pitch deck with Alex by Thursday at 4 PM. We also need to schedule the follow-up meeting with Priya for next Monday afternoon. On my way back I have to order a new microphone for our podcast setup and email the contract to Tom."
The problem? Voice notes are write-only memory.
Days later, finding a specific deadline, promise, or action item requires replaying minutes of audio at 1x speed. Crucial commitments get lost, deadlines slip, and valuable thoughts remain trapped inside unsearchable audio recordings.
Voice2Memory turns unstructured voice notes into structured, searchable, and actionable personal memories using a 100% open-weight AI pipeline:
- Speech-to-Text Transcription: Converts microphone audio streams and uploaded audio files (MP3, WAV, M4A, WebM, OGG, FLAC) into accurate transcripts using local Faster-Whisper (
int8quantized CTranslate2 engine with Voice Activity Detection). - Open-Weight AI Intelligence: Google's Gemma 2 (
gemma2:2b) analyzes the transcript to extract:- Concise Title: 4–8 word executive header.
- Executive Summary: 1–2 sentence synthesis.
- Actionable Tasks: Checklist with live persistence to MongoDB Atlas.
- Important Dates & Times: Temporal entity recognition (deadlines, meetings, appointments).
- People Mentioned: Explicit entity recognition for colleagues, clients, and friends.
- Categorical Topics & Tags: Dynamic tagging (
#Finance,#PitchDeck,#Errands).
- MongoDB Atlas Persistence: Long-term database storage with weighted multi-field text search indexes across titles, summaries, transcripts, people, and topics.
- Voice Narration (ElevenLabs / Web Speech API): Hands-free audio playback of executive summaries.
- Obsidian / Notion Markdown Export: One-click export formatted with markdown checkboxes and metadata.
flowchart TD
User([User Voice Note / Upload]) -->|Browser Mic / Audio File| UI[Voice2Memory Web Studio\nNext.js 16 + React 19]
UI -->|POST /api/transcribe\nAudio Buffer| Whisper[Faster-Whisper int8\nLocal CTranslate2 Engine]
Whisper -->|Raw Transcript + Metadata| UI
UI -->|POST /api/analyze\nTranscript + Gemma 2 Prompt| Gemma[Google Gemma 2\nLocal Ollama / Remote Endpoint]
Gemma -->|Structured Memory JSON| UI
UI -->|POST /api/memories\nStructured Record| Atlas[(MongoDB Atlas Cluster\nWeighted Text Indexes)]
Atlas -->|Real-Time Query & Search| UI
UI -->|POST /api/tts\nSummary Text| ElevenLabs[ElevenLabs TTS / Web Speech]
ElevenLabs -->|Audio Stream| User
Personal voice recordings contain sensitive thoughts, client details, financial plans, medical appointments, and private company roadmaps.
- Absolute Privacy: Voice data and transcripts never need to be uploaded to proprietary cloud AI silos.
- Zero Recurring Token Costs: Eliminates per-minute transcription fees and per-token LLM charges.
- Predictable Latency: Local execution with
int8quantization delivers near-instant inference directly on CPU or GPU. - Model Freedom: Swap between Gemma models (
gemma2:2b,gemma2:9b,gemma2:27b) or host on private cloud infrastructure.
Google's open-weight Gemma 2 (gemma2:2b) serves as the core intelligence engine of Voice2Memory:
- Model Identifier:
gemma2:2b(Google Gemma 2, 2-billion parameter instruction-tuned model with sliding window attention and logit soft-capping). - Execution Environment: Runs locally via Ollama or remotely via OpenAI-compatible Gemma endpoints.
- Instruction Prompt Template:
<start_of_turn>user You are an expert AI Memory Extraction engine for Voice2Memory powered by Google Gemma 2. Spoken Voice Note Transcript: "{transcript}" Extract the structured memory JSON now:<end_of_turn> <start_of_turn>model - Robust Parser: Multi-stage JSON recovery engine in
src/lib/ollama.tshandles markdown code fence extraction, JSON sanitization, and fallback heuristics for bulletproof extraction.
Voice2Memory uses MongoDB Atlas as its centralized, persistent memory layer:
- Connection Architecture: Configured in
src/lib/db.tswith connection pooling (maxPoolSize: 10,serverSelectionTimeoutMS: 5000,retryWrites: true) and DNS fallback resolvers (8.8.8.8,1.1.1.1). - Compound & Weighted Text Indexing:
MemorySchema.index( { title: "text", summary: "text", transcript: "text", topics: "text", people: "text" }, { weights: { title: 10, topics: 5, summary: 4, people: 3, transcript: 1 } } ); MemorySchema.index({ createdAt: -1, topics: 1 });
- Live Task State Synchronization: Checking off a task updates MongoDB Atlas in real-time via
PATCH /api/memories/[id].
Voice2Memory includes complete production deployment configurations:
- Render Cloud Deployment:
- Native
render.yamlblueprint configuration for web service hosting with persistent environment bindings and automated continuous deployments on git push.
- Native
- Containerized Multi-Stage Build:
- Production multi-stage
Dockerfile(Node.js 20 + Python 3.11 + ffmpeg). - Complete
docker-compose.ymlstack.
- Production multi-stage
- Technology Used: Google Gemma 2 (
gemma2:2bopen-weight model). - Feature: Powers transcript understanding, executive summarization, action item extraction, date/deadline identification, and persona tag classification in
src/lib/ollama.tsandsrc/app/api/analyze/route.ts. - Why It is Necessary: Spoken conversation contains unstructured grammar, filler words, and implicit commitments. Gemma 2 turns messy spoken transcripts into deterministic JSON schemas without hallucinations.
- Judge Verification:
- Inspect
src/lib/ollama.tsfor Gemma 2 instruction formatting (<start_of_turn>user ...). - Set
OLLAMA_MODEL=gemma2:2bin.env.localand start Ollama (ollama pull gemma2:2b). - Navigate to
/record, click any of the 3 "Interactive Sample Scenarios", and verify the active badge:Google Gemma 2 (gemma2:2b).
- Inspect
- Technology Used: MongoDB Atlas Cluster with weighted text search and compound indexing.
- Feature: Persistent long-term storage of extracted memory objects, real-time search filtering (
/api/memories?q=...), and real-time task completion persistence (PATCH /api/memories/[id]). - Why It is Necessary: Enables instantaneous querying across hundreds of voice notes by person name, topic tag, or keyword, without sending search data to third-party search APIs.
- Judge Verification:
- Inspect
src/lib/db.tsfor Atlas connection handling andsrc/models/Memory.tsfor weighted index definitions. - Add
MONGODB_URI=mongodb+srv://...to.env.local. - Save a memory and verify instant search filtering on
/memories.
- Inspect
- Technology Used: ElevenLabs Text-to-Speech API (
eleven_monolingual_v1). - Feature: Converts Gemma-generated summaries into natural voice audio briefings via
POST /api/ttsandVoiceSummaryPlayer.tsx. - Judge Verification:
- Provide
ELEVENLABS_API_KEYin.env.local(or test with automatic browser Web Speech API fallback). - Click "Listen" on any memory to play back the audio narration.
- Provide
| Layer | Technology |
|---|---|
| Frontend Framework | Next.js 16.3 (App Router, React 19, TypeScript) |
| Styling & Design System | Tailwind CSS 4, Linear/Awwwards-tier Design, Lucide Vector Icons |
| Open-Weight AI Brain | Google Gemma 2 (gemma2:2b / gemma2:9b) via Ollama |
| Speech-to-Text Engine | OpenAI Faster-Whisper (int8 CTranslate2 with VAD filter) |
| Database & Search | MongoDB Atlas / Mongoose 9 (Weighted text search) |
| Voice Narration | ElevenLabs API + Web Speech API fallback |
| Deployment & DevOps | Render, Docker, Docker Compose |
- Node.js: v18+ (tested on Node v20/v22)
- Python: 3.10+ with
faster-whisper(pip install faster-whisper) - Ollama: Download Ollama
- MongoDB: Local MongoDB instance or free MongoDB Atlas cluster
git clone https://github.com/hitesh-kumar123/Voice2Memory.git
cd Voice2Memory
npm installollama serve
ollama pull gemma2:2bCopy .env.example to .env.local:
cp .env.example .env.localConfigure your .env.local:
MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/voice2memory?retryWrites=true&w=majority
OLLAMA_BASE_URL=http://127.0.0.1:11434
OLLAMA_MODEL=gemma2:2b
# Optional ElevenLabs Voice Narration:
# ELEVENLABS_API_KEY=your_key_herenpm run devOpen http://localhost:3000 in your browser.
# Type check & build Next.js production bundle
npm run build
# Run ESLint audit
npm run lint- Challenge: Hacktoberfest 2026 DEV Weekend Challenge #1
- Theme: "Build for a Friend"
- Primary Open-Weight Model: Google Gemma 2 (
gemma2:2b) - Persistent Data Store: MongoDB Atlas
- Cloud Deployment: Render
- Pair Programming: Antigravity AI Agent