
AI Facts
Note: LLMs can sometimes provide incorrect or outdated information. Always verify critical information through trusted sources.
This project is a Next.js application that performs real-time fact checking on spoken statements. It uses Deepgram for audio transcription and leverages OpenAI and Perplexity (via the Vercel AI Gateway) to verify the accuracy of claims.
Features
- Real-time Audio Transcription: Captures and transcribes spoken audio using Deepgram's API
- AI Fact Checking: Uses both OpenAI and Perplexity to cross-reference and verify statements
- Live Results: Shows fact-checking results in real-time as statements are processed
- Explanation of Validity: Provides detailed explanations for why statements are considered true or false
Technology Stack
- Next.js for the frontend and API routes
- AI SDK for interacting with LLMs
- Vercel AI Gateway for unified access to OpenAI and Perplexity
- Deepgram for audio transcription
- ShadcnUI for UI components
- Tailwind CSS for styling
How It Works
- Speak into microphone
- Deepgram processes the audio stream in real-time and returns transcribed text
- The transcribed text is analyzed for distinct statements ('?!.')
- Each statement is routed through the AI Gateway to OpenAI and Perplexity for fact checking
- The verification status and explanation are displayed to the user
Getting Started
To get the project up and running, follow these steps:
-
Install dependencies:
npm install -
Copy the example environment file:
cp .env.example .env -
Add your API keys to the
.envfile:AI_GATEWAY_API_KEY=your_api_key_hereDEEPGRAM_API_KEY=your_api_key_hereYou can create an AI Gateway API key from the Vercel dashboard. When deployed on Vercel, authentication happens automatically via OIDC and
AI_GATEWAY_API_KEYis not required. -
Start the development server:
npm run dev
Your project should now be running on http://localhost:3000.
Deployment
The project is set up for one-click deployment on Vercel. Use the "Deploy with Vercel" button above to create your own instance of the application.
Learn More
To learn more about the technologies used in this project, check out the following resources:

