Skip to content

vercel-labs/ai-facts

Repository files navigation

AI Facts

Note: LLMs can sometimes provide incorrect or outdated information. Always verify critical information through trusted sources.

Deploy with Vercel

This project is a Next.js application that performs real-time fact checking on spoken statements. It uses Deepgram for audio transcription and leverages both OpenAI and Perplexity 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

How It Works

  1. Speak into microphone
  2. Deepgram processes the audio stream in real-time and returns transcribed text
  3. The transcribed text is analyzed for distinct statements ('?!.')
  4. Each statement is sent to OpenAI and Perplexity for fact checking
  5. The verification status and explanation are displayed to the user

Getting Started

To get the project up and running, follow these steps:

  1. Install dependencies:

    npm install
  2. Copy the example environment file:

    cp .env.example .env
  3. Add your API keys to the .env file:

    OPENAI_API_KEY=your_api_key_here
    DEEPGRAM_API_KEY=your_api_key_here
    PERPLEXITY_API_KEY=your_api_key_here
    
  4. 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: