AI-powered customer support system with LangGraph workflow orchestration, RAG (Retrieval-Augmented Generation), and intelligent routing.
- 🤖 AI-Powered Responses: Uses OpenAI GPT-4o-mini for intelligent customer support
- 🔍 RAG with ChromaDB: Vector database for knowledge base retrieval
- 🎯 Smart Routing: Automatic categorization (Technical, Billing, General)
- 😊 Sentiment Analysis: Detects customer sentiment (Positive, Neutral, Negative)
- 🔄 LangGraph Workflows: State-based conversation management
- 🚀 Production Ready: FastAPI backend with NGINX reverse proxy
- 📊 Real-time & REST APIs: WebSocket and HTTP endpoints
- AWS EC2 instance (Ubuntu 24.04 LTS, t2.medium or larger)
- OpenAI API key
- Domain name (optional, for HTTPS)
- Clone the repository:
git clone https://github.com/YOUR_USERNAME/YOUR_REPO.git ~/customer-support-agent
cd ~/customer-support-agent- Run the setup script:
sudo chmod +x deployment/ec2/setup.sh
sudo deployment/ec2/setup.sh- Configure your OpenAI API key:
sudo nano ~/customer-support-agent/backend/.env
# Add: OPENAI_API_KEY=sk-your-actual-key-here- Restart the service:
sudo systemctl restart support-agent- Access your application:
- Frontend:
http://YOUR-EC2-IP/ - API Docs:
http://YOUR-EC2-IP/docs - Health Check:
http://YOUR-EC2-IP/health
.
├── backend/
│ ├── app/
│ │ ├── agents/ # AI agent modules
│ │ ├── config/ # Configuration
│ │ ├── database/ # ChromaDB integration
│ │ ├── models/ # Pydantic schemas
│ │ ├── workflows/ # LangGraph workflows
│ │ └── main.py # FastAPI application
│ ├── data/ # Knowledge base JSON
│ ├── requirements.txt # Python dependencies
│ └── .env.example # Environment variables template
├── frontend/
│ ├── index.html # Web UI
│ └── static/ # CSS, JS, images
└── deployment/
├── ec2/ # EC2 deployment files
│ ├── setup.sh # Automated setup script
│ ├── nginx/ # NGINX configuration
│ └── systemd/ # Systemd service
└── docker/ # Docker deployment (optional)
Edit backend/.env:
# Required
OPENAI_API_KEY=sk-your-key-here
# Optional (defaults provided)
LLM_MODEL=gpt-4o-mini
EMBEDDING_MODEL=text-embedding-3-small
API_PORT=8000POST /api/chat- Send a customer queryGET /health- Health checkGET /api/status- API statusWS /ws/chat- WebSocket chat endpoint
# Check status
sudo systemctl status support-agent
# View logs
sudo journalctl -u support-agent -f
# Restart
sudo systemctl restart support-agent
# Stop
sudo systemctl stop support-agent- Backend: FastAPI, Python 3.12
- AI: OpenAI GPT-4o-mini, LangChain, LangGraph
- Database: ChromaDB (vector database)
- Web Server: NGINX
- Process Manager: Systemd
- Frontend: Vanilla HTML/CSS/JavaScript
MIT License
For issues and questions, please open a GitHub issue.