An intelligent, production-ready support agent that eliminates context-switching for support teams combining RAG, persistent memory, and LangChain tool calling into a one-click response generator.
Support agents lose 60%+ of their time switching between CRM, billing systems, and knowledge bases before they can even begin drafting a reply. This project eliminates that entirely.
A one-click AI copilot that:
- Retrieves customer context from CRM and billing systems via tool calling
- Searches the knowledge base using semantic RAG (ChromaDB)
- Recalls past interactions using persistent memory (Mem0)
- Drafts a complete, personalized response ready for agent review in seconds
┌─────────────────────────────────────────────────────┐
│ Streamlit Dashboard │
│ (Ticket Queue | New Ticket | Analytics) │
└────────────────────┬────────────────────────────────┘
│ HTTP
┌────────────────────▼────────────────────────────────┐
│ FastAPI Backend │
│ POST /tickets/{id}/generate │
└────┬──────────────┬──────────────┬──────────────────┘
│ │ │
┌────▼────┐ ┌──────▼──────┐ ┌───▼────────────┐
│ Mem0 │ │ ChromaDB │ │ LangChain Agent│
│ Memory │ │ RAG Search │ │ + Tool Calling│
└─────────┘ └─────────────┘ └───┬────────────┘
│
┌────────┴────────┐
│ │
┌─────▼─────┐ ┌───────▼───┐
│ CRM Tool │ │Billing Tool│
└───────────┘ └───────────┘
| Layer | Technology |
|---|---|
| LLM | OpenAI GPT-4o-mini |
| Agent Framework | LangChain + OpenAI Tools Agent |
| Persistent Memory | Mem0 |
| Vector Store | ChromaDB |
| Backend | FastAPI + SQLAlchemy + SQLite |
| Frontend | Streamlit |
| Containerization | Docker + Docker Compose |
| CI/CD | GitHub Actions → AWS EC2 |
git clone https://github.com/YOUR_USERNAME/customer-support-copilot.git
cd customer-support-copilot
cp .env.example .env
# Add your OPENAI_API_KEY and MEM0_API_KEY to .envdocker compose up --build- Backend API: http://localhost:8000
- Streamlit UI: http://localhost:8501
- API Docs: http://localhost:8000/docs
# Backend
cd backend
pip install -r requirements.txt
uvicorn main:app --reload
# Frontend (new terminal)
cd frontend
pip install -r requirements.txt
streamlit run app.py| Key | Where to Get It |
|---|---|
OPENAI_API_KEY |
platform.openai.com |
MEM0_API_KEY |
app.mem0.ai (free tier available) |
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Health check |
GET |
/tickets/ |
List all tickets |
POST |
/tickets/ |
Create a new ticket |
GET |
/tickets/{id} |
Get ticket by ID |
POST |
/tickets/{id}/generate |
🤖 Generate AI response |
PUT |
/tickets/{id}/status |
Update ticket status |
GET |
/customers/ |
List all customers |
Interactive docs available at /docs (Swagger UI).
When POST /tickets/{id}/generate is called:
- RAG Search - Queries ChromaDB for knowledge base articles relevant to the ticket
- Memory Recall - Fetches past interaction summaries for the customer from Mem0
- Agent Reasoning - LangChain agent decides which tools to call:
get_customer_crm_info(customer_id)- fetches name, plan, account managerget_billing_info(customer_id)- fetches payment status and invoices
- Response Generation - GPT-4o-mini synthesizes all context into a draft response
- Memory Update - Interaction is saved to Mem0 for future context
customer-support-copilot/
├── backend/
│ ├── main.py # FastAPI application & routes
│ ├── agent/
│ │ └── support_agent.py # Core LangChain agent
│ ├── memory/
│ │ └── mem0_client.py # Mem0 memory client
│ ├── rag/
│ │ └── knowledge_base.py # ChromaDB vector store
│ ├── tools/
│ │ ├── crm_tool.py # CRM lookup tool
│ │ └── billing_tool.py # Billing lookup tool
│ ├── database/
│ │ ├── models.py # SQLAlchemy ORM models
│ │ └── db.py # DB init and session
│ └── requirements.txt
├── frontend/
│ └── app.py # Streamlit dashboard
├── .github/workflows/
│ └── ci-cd.yml # GitHub Actions pipeline
├── docker-compose.yml
└── .env.example
Push to main
↓
Lint (flake8) + Tests
↓
Build Docker Images → Docker Hub
↓
SSH Deploy → AWS EC2 (docker compose up)
To enable: add DOCKER_USERNAME, DOCKER_PASSWORD, EC2_HOST, EC2_USER, EC2_SSH_KEY as GitHub repository secrets.
Author: Aryan Rajguru