A sophisticated voice-enabled AI agent combining Retrieval-Augmented Generation (RAG), multi-agent orchestration, and real-time function calling for intelligent document Q&A and dynamic information retrieval.
- π RAG System: Query 5 comprehensive documents (80+ pages) on AI, Climate, History, Blockchain, and Health
- π€ Voice Interface: Natural conversation with Deepgram STT and Cartesia TTS via LiveKit
- π€ Multi-Agent System: LangGraph orchestrator with specialized agents (RAG, Tool, General)
- π¦οΈ Dynamic Tools: Real-time weather, currency exchange, and timezone information
- β‘ High Performance: <2-5s end-to-end latency with comprehensive metrics logging
- π³ Production Ready: Docker deployment with environment variable configuration
- Python 3.13+
- OpenAI API key
- LiveKit account (for voice features)
- Deepgram API key (for STT)
- Cartesia API key (for TTS)
- WeatherAPI key (for weather tools)
# Clone repository
git clone https://github.com/george07-t/RAGVoice-AI.git
cd soffotech-rag-agent
# Create virtual environment
python -m venv .venv
# Activate (Windows)
.\.venv\Scripts\Activate.ps1
# Activate (Linux/Mac)
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txtCopy .env.example to .env.local and fill in your API keys:
OPENAI_API_KEY="your-openai-key"
WEATHER_API_KEY="your-weather-key"
LIVEKIT_URL="your-livekit-url"
LIVEKIT_API_KEY="your-livekit-key"
LIVEKIT_API_SECRET="your-livekit-secret"
DEEPGRAM_API_KEY="your-deepgram-key"
CARTESIA_API_KEY="your-cartesia-key"python src/rag_system.pyThis will:
- Load 5 documents from
documents/ - Create 112 text chunks
- Generate OpenAI embeddings
- Build FAISS vector store
Console Mode (Terminal Voice Chat):
python src/agent.py consoleDevelopment Mode:
python src/agent.py devProduction Mode:
python src/agent.py start- "What is deep learning?"
- "Explain climate change causes"
- "Tell me about World War II"
- "What is blockchain technology?"
- "How much sleep do I need?"
- "What's the weather in Dhaka?"
- "Give me a 3-day forecast for New York"
- "What's the USD to BDT exchange rate?"
- "What time is it in Tokyo?"
- "Hello! How are you?"
- "What can you help me with?"
docker build -t rag-voice-agent .docker run -d \
-e OPENAI_API_KEY="your-key" \
-e LIVEKIT_URL="your-url" \
-e LIVEKIT_API_KEY="your-key" \
-e LIVEKIT_API_SECRET="your-secret" \
-e DEEPGRAM_API_KEY="your-key" \
-e CARTESIA_API_KEY="your-key" \
-e WEATHER_API_KEY="your-key" \
-p 8080:8080 \
rag-voice-agentlk deploy create| Component | Latency |
|---|---|
| RAG Retrieval (3 docs) | 0.5-1.5s |
| Orchestrator Routing | <0.1s |
| LLM Response | 1-3s |
| Weather API | 0.2-0.5s |
| Total End-to-End | 2-5s |
- LLM: OpenAI GPT-4o-mini
- Embeddings: OpenAI text-embedding-3-small
- Vector DB: FAISS (CPU)
- Orchestration: LangChain + LangGraph
- Voice: LiveKit (Deepgram STT, Cartesia TTS)
- APIs: WeatherAPI.com, ExchangeRate-API.com
soffotech-rag-agent/
βββ src/
β βββ agent.py # LiveKit voice agent entry point
β βββ multi_agent_rag.py # LangGraph multi-agent orchestrator
β βββ rag_system.py # RAG pipeline (FAISS + embeddings)
β βββ dynamic_tools.py # Real-time API tools
β βββ __init__.py
βββ documents/ # Knowledge base (5 docs, 80+ pages)
β βββ artificial_intelligence_guide.txt
β βββ climate_change_report.txt
β βββ world_history_modern.txt
β βββ blockchain_technology.txt
β βββ health_wellness_guide.txt
βββ vector_store/ # FAISS index (auto-generated)
βββ tests/
β βββ test_agent.py
βββ Dockerfile
βββ requirements.txt
βββ livekit.toml
βββ .env.example # Environment template
βββ PROJECT_README.md # Detailed technical documentation
βββ Soffotech_RAG_Voice_Agent_Demo.ipynb # Google Colab demo
βββ LICENSE
βββ README.md # This file
python -c "from src.rag_system import get_rag_system; rag = get_rag_system(); print(rag.retrieve('What is deep learning?'))"python -c "from src.dynamic_tools import get_current_weather; print(get_current_weather.invoke({'city': 'Dhaka'}))"python src/multi_agent_rag.pypytest tests/- PROJECT_README.md: Comprehensive technical documentation with architecture details, scaling strategies, and troubleshooting
- Soffotech_RAG_Voice_Agent_Demo.ipynb: Interactive Google Colab notebook with step-by-step demo
- API keys stored in
.env.local(never committed) - Docker runs as non-privileged user
- Input sanitization for all queries
- HTTPS/TLS for LiveKit connections
This is an assessment project. For questions or suggestions, please open an issue.
MIT License - See LICENSE file for details
George Tonmoy Roy
Soffotech Technical Assessment - November 2025
- LiveKit - Voice AI infrastructure
- LangChain - LLM orchestration framework
- OpenAI - Language models and embeddings
- FAISS - Vector similarity search
- WeatherAPI.com - Weather data provider
β Star this repo if you find it helpful!