Skip to content

HoangP8/rag-realtime

Repository files navigation

🎙️ RAG Real-time Voice Assistant

A real-time voice assistant using Retrieval-Augmented Generation (RAG) that allows users to have natural conversations with an AI about medical topics.

🏗️ Architecture Overview

The application uses a microservices architecture with the following components:

  1. API Gateway - Central entry point for all client requests (Port 8000)
  2. Auth Service - Handles user authentication and authorization (Port 8001)
  3. Conversation Service - Manages conversations, messages, and LLM interactions (Port 8002)
  4. Voice Service - Handles real-time voice communication via LiveKit and OpenAI Realtime API (Port 8003)

🛠️ Prerequisites

Before you begin, ensure you have the following installed:

  • Python: 3.10 or higher
  • Node.js: 18 or higher
  • pnpm: Install with npm install -g pnpm
  • Docker: For containerizing backend services
  • Android Development Tools:
    • Android Studio with API level 21 or higher
    • Android SDK

🔑 API Keys Setup

You'll need to obtain API keys from the following services:

  1. OpenAI - For LLM access
  2. LiveKit - For real-time voice communication
  3. Deepgram - For speech-to-text services
  4. Supabase - For database and authentication

🚀 Setup Instructions

1. Clone the Repository

git clone https://github.com/your-repo-name.git
cd your-repo-name

2. Configure Environment Variables

Create a .env.local file from the example and add your API keys:

cp .env.example .env.local

Edit .env.local and replace all placeholder values with your actual API keys.

3. Run the Backend Services

The backend uses Docker to run multiple microservices:

cd backend
docker-compose up --build

This will start all backend services including the API gateway, auth service, conversation service, and voice service.

4. Run the Web Frontend

Open a new terminal window and run:

cd frontend
pnpm install
pnpm dev

The web application will be available at http://localhost:3000.

5. Run the Mobile Application (Android only)

Open a new terminal window and run:

cd mobile-frontend
pnpm install

# For Android
pnpm android

The mobile app is built with React Native and Kotlin, and currently only supports Android devices. Follow the on-screen instructions to launch the app on your preferred simulator or connected device.

About

LiveKit RAG Realtime App (Mobile/Web)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •