A React application for recording and transcribing personal memories with AI-powered interviewer interjections, now powered by Groq AI.
This version has been migrated from Google's Gemini AI Studio to Groq API. Here are the key changes:
-
Replaced AI Provider
- Removed:
@google/genaipackage - Added:
groq-sdkpackage
- Removed:
-
Updated Live Session Hook (
hooks/useLiveSession.ts)- Now uses Groq's Whisper API for audio transcription
- Uses Groq's
llama-3.3-70b-versatilemodel for chat completions - Implements chunk-based audio transcription (3-second intervals)
- Detects silence and generates AI responses after 5 seconds of quiet
-
API Key Management
- Removed AI Studio specific code
- Uses environment variable
VITE_API_KEYor manual input - Set
dangerouslyAllowBrowser: truefor client-side API calls (see Security Note below)
-
Model Details
- Transcription:
whisper-large-v3-turbo(Groq's Whisper model) - Chat/Responses:
llama-3.3-70b-versatile(Groq's LLaMA model)
- Transcription:
-
Install Dependencies
npm install
-
Get Your Groq API Key
- Visit console.groq.com
- Create an account and generate an API key
-
Set Up Environment Variable Create a
.envfile in the project root:VITE_API_KEY=your_groq_api_key_here
-
Run the Application
npm run dev
The current implementation uses dangerouslyAllowBrowser: true to allow Groq API calls directly from the browser. This is NOT recommended for production as it exposes your API key.
For Production:
- Create a backend proxy server to handle Groq API calls
- Never expose API keys in client-side code
- Use environment variables only on the server side
Example backend setup (Node.js/Express):
app.post('/api/transcribe', async (req, res) => {
const groq = new Groq({ apiKey: process.env.GROQ_API_KEY });
// Handle transcription here
});- ✅ Real-time audio recording and transcription
- ✅ AI-powered interviewer that asks follow-up questions
- ✅ Customizable question sets (JSON/TXT upload)
- ✅ Multiple aspect ratio support (Portrait, Landscape, Square, 3:4)
- ✅ Live transcript display
- ✅ Export transcripts as JSON
- ✅ Pause/Resume functionality
- Audio Capture: Records audio in 3-second chunks using MediaRecorder API
- Transcription: Sends audio chunks to Groq's Whisper API for transcription
- AI Response: After 5 seconds of silence, sends transcript to LLaMA model for follow-up questions
- Display: Shows live transcript and AI interviewer interjections in real-time
- Browser-based API calls (security concern for production)
- 3-second chunking may cause slight delays in transcription
- Conversation history limited to last 20 exchanges to manage context window
Groq pricing (as of creation):
- Whisper API: Very affordable for transcription
- LLaMA 3.3 70B: Pay per token for completions
Check Groq's pricing page for current rates.
"No API Key provided" error:
- Ensure
.envfile exists withVITE_GROQ_API_KEY - Restart dev server after adding environment variables
Transcription not working:
- Check browser console for CORS or API errors
- Verify API key is valid at console.groq.com
- Ensure microphone permissions are granted
AI not responding:
- Check that transcription is working first
- Verify API key has access to chat completions
- Look for rate limit errors in console
# Install dependencies
npm install
# Run development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run previewSee license.txt for details.
This is a modified version of the Memoria app, originally built for Google's Gemini AI Studio.