Voice Notes AI is a web application that allows users to record voice notes, transcribe them using Groq's Whisper API, and interact with an AI assistant based on the transcriptions. The app uses OpenAI's GPT-4 Mini model for generating responses, stores conversation data in a PostgreSQL database, and saves audio files in an Amazon S3 bucket.
- Voice recording and playback
- Audio transcription using Groq's Whisper API
- Real-time chat interface with an AI assistant based on transcriptions
- Persistent chat history stored in a database
- Audio file storage in Amazon S3
Before running the application, make sure to set up the following environment variables in your .env
file:
DATABASE_URL
: Your PostgreSQL database connection stringOPENAI_API_KEY
: Your OpenAI API key for accessing the GPT-4 Mini modelAWS_ACCESS_KEY_ID
: Your AWS access key IDAWS_SECRET_ACCESS_KEY
: Your AWS secret access keyAWS_REGION
: The AWS region where your S3 bucket is located (e.g., "us-east-2")GROQ_API_KEY
: Your Groq API key for accessing the Whisper API
- Create an AWS account if you don't have one.
- Go to the AWS Management Console and navigate to the S3 service.
- Click "Create bucket" and follow the prompts to create a new bucket for storing audio files.
- Note down the bucket name and region.
- Go to the IAM service and create a new user with programmatic access.
- Attach the "AmazonS3FullAccess" policy to this user (or create a custom policy with more restricted permissions if needed).
- After creating the user, you'll receive an Access Key ID and Secret Access Key. Use these in your environment variables.
Make sure to configure your S3 bucket's CORS settings to allow access from your application's domain.
- Sign up for a Groq account at https://console.groq.com/
- Navigate to the API Keys section and create a new API key.
- Copy the API key and add it to your
.env
file asGROQ_API_KEY
.
- Go to https://platform.openai.com/ and sign up for an account if you don't have one.
- Once logged in, navigate to the API keys section in your account dashboard.
- Click on "Create new secret key" to generate a new API key.
- Copy the generated API key immediately (you won't be able to see it again).
- Add the API key to your
.env
file asOPENAI_API_KEY
.
- Clone this repository
- Install dependencies:
npm install
- Set up your
.env
file with the required environment variables - Run database migrations:
npx prisma migrate dev
- Start the development server:
npm run dev
Visit http://localhost:3000
in your browser to use the application.
- Next.js 14 with server actions
- React
- TypeScript
- Tailwind CSS
- Prisma
- PostgreSQL (Neon Serverless Postgres)
- OpenAI API
- Amazon S3
- Web Audio API
- Groq Whisper API
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.