Skip to content

RecroTechGroup/RAI-rtc-api

Repository files navigation

RecroTech AI Avatar System 🤖

RAG-Powered Intelligent Chatbot with Real-Time Avatar Integration

Python LangChain OpenAI ChromaDB FastAPI


� Overview

RecroTech AI Avatar is an intelligent, RAG-powered (Retrieval-Augmented Generation) chatbot system featuring:

  • Real-time Avatar Video Streaming - Dynamic avatar states (standing, listening, thinking, talking)
  • 🧠 RAG System - Context-aware responses from your knowledge base
  • Voice Support - Speech-to-Text (STT) and Text-to-Speech (TTS) with OpenAI
  • WebSocket Streaming - Low-latency real-time communication

✨ Features

Feature Description
Document Processing Load and process Markdown files from categorized folders
Vector Search Semantic similarity search using ChromaDB
Question-Answering GPT-4o-mini powered contextual responses
Voice Interaction Whisper STT + TTS for voice conversations
Avatar Animation State-based video playback synced with AI responses

🚀 Installation

1. Clone the Repository

git clone https://github.com/your-org/recrotech-avatar.git
cd recrotech-avatar

2. Create Virtual Environment

# Windows
python -m venv .venv
.venv\Scripts\activate

# Linux/macOS
python3 -m venv .venv
source .venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

⚙️ Configuration

Environment Variables

Create a .env file in the project root:

API_KEY=your-openai-api-key-here

⚠️ Important: A valid OpenAI API key is required for embeddings, chat, TTS, and STT functionality.


📖 Usage

Start the Server

python main.py

The server will start at http://localhost:8011

API Endpoints

Endpoint Method Description
/ GET Health check
/ai/chat POST Send text message, get AI response
/ai/voice POST Upload audio, get spoken AI response
/avatar/state/{state} POST Change avatar state
/ws/avatar WebSocket Real-time avatar video stream

� Project Structure

├── main.py               # Application entry point
├── ai_handler.py         # AI/RAG/TTS/STT logic
├── rtc_handler.py        # FastAPI routes & WebSocket
├── video_handler.py      # Avatar video state management
├── createRAG.ipynb       # Vector database creation notebook
├── knowledge_base/       # Markdown documents (about, services, solutions)
├── vector_db/            # ChromaDB persistent storage
├── avatar_videos/        # Avatar video files
└── requirements.txt      # Python dependencies

�️ Tech Stack

  • Framework: FastAPI + Uvicorn
  • AI/LLM: OpenAI GPT-4o-mini
  • RAG: LangChain 0.3.x
  • Vector DB: ChromaDB
  • Embeddings: OpenAI text-embedding-ada-002
  • Video: OpenCV
  • Audio: Pydub + OpenAI TTS/Whisper

📄 License

© 2024 RecroTech. All rights reserved.

About

rai recrotech assistant api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors