A Multi-Agent AI Customer Support Automation System that automatically analyzes customer support tickets, identifies the responsible department, predicts resolution time, retrieves similar historical tickets using RAG + FAISS, and generates an AI-powered support response.
The system is built using:
- π€ Multi-Agent AI Architecture
- π Semantic Search
- π§ RAG (Retrieval-Augmented Generation)
- ποΈ FAISS Vector Database
- β‘ FastAPI Backend
- π Web/API Frontend
Make sure Python is installed, then install the project's dependencies:
pip install -r requirements.txtBefore running the application for the first time, create the FAISS vector database from the historical support tickets.
Run:
python vector_store/build_vector_store.pyThis processes the historical tickets, generates embeddings, and stores them in the FAISS database.
It creates:
vector_store/faiss_index/
β οΈ Important: You only need to runbuild_vector_store.pyinitially, or whenever you update/rebuild the historical ticket dataset.
The FastAPI backend must always be started before the frontend/index file.
Run:
uvicorn api.main:app --reloadThe API server will start locally.
Keep this terminal running.
After the backend is running, open another terminal and run your project's index/frontend file.
For example:
python index.pyReplace
index.pywith the actual entry-point file used by your project.
The complete system follows this architecture:
Customer Ticket
β
FastAPI Backend
β
Master Agent
β
ββββββββββββββββββΌβββββββββββββββββ
β β β
Summarizer Routing Prediction
Agent Agent Agent
ββββββββββββββββββΌβββββββββββββββββ
β
RAG Retrieval Agent
β
FAISS Vector DB
β
Response Agent
β
Final AI Response
In simple terms:
Customer Ticket β Analyze β Route β Predict β Retrieve Knowledge β Generate Response
The user submits a customer support ticket.
Example:
payment ssl issue
The request is received by:
api/main.py
through the API endpoint:
POST /analyze-ticket
Inside:
api/main.py
the backend sends the ticket to:
master_agent(ticket)
The Master Agent then takes control of the entire AI workflow.
File:
agents/master_agent.py
The Master Agent is the central orchestrator of the system.
It coordinates the different specialized agents and ensures that the ticket passes through the required processing stages.
Master Agent
β
Summarizer
β
Routing
β
Prediction
β
RAG Retrieval
β
Response
File:
agents/summarizer_agent.py
Converts a long or complicated support ticket into a concise summary.
Example:
Original Ticket:
"After installing the latest software update,
the application fails to start and shows an error..."
β
Summary:
"Software installation issue"
This gives the other agents a cleaner representation of the problem.
File:
agents/routing_agent.py
Determines which department or team should handle the ticket.
Example:
Payment SSL Issue
β
Security / Payment Team
The routing agent helps automatically direct the ticket to the appropriate support department.
File:
agents/prediction_agent.py
Estimates how long the issue may take to resolve.
Example:
Estimated Resolution Time:
3 Hours
This provides an expected resolution timeline for the support ticket.
Files:
rag/retriever.py
rag/vector_store.py
rag/embeddings.py
This is one of the most important AI components of the system.
The RAG pipeline gives the AI access to historical support-ticket knowledge.
The user's ticket:
payment ssl issue
is converted into an embedding.
The system then performs semantic similarity search against the FAISS vector database.
Customer Ticket
β
Embedding Model
β
Vector Representation
β
FAISS Similarity Search
β
Similar Historical Tickets
For example:
payment ssl issue
β
Similar historical tickets
β
Previous SSL/payment failures
β
Relevant solutions/context
This provides the AI with historical context rather than relying only on the current ticket.
File:
agents/response_agent.py
Generates the final AI-powered customer support response.
The Response Agent uses information gathered from the previous agents and the RAG system.
Example:
Verify the SSL certificate and TLS configuration.
Check whether the certificate has expired and
ensure that the correct certificate chain is installed.
After all agents complete their tasks, the backend combines the results into a structured response.
Example:
{
"summary": "Payment SSL issue",
"department": "Security / Payment Team",
"prediction": "3 Hours",
"similar_tickets": [
"...",
"..."
],
"ai_response": "Verify SSL certificate and TLS configuration."
}This response is then returned by the FastAPI backend to the frontend/client.
The project uses FAISS as the vector database for semantic retrieval.
The vector database is created using:
vector_store/build_vector_store.py
This script:
- Loads historical support tickets
- Converts tickets into embeddings
- Stores the embeddings in FAISS
- Creates the searchable vector index
Historical Support Tickets
β
Embedding Model
β
Vector Embeddings
β
FAISS Index
β
AI Knowledge Base
The resulting database is stored in:
vector_store/faiss_index/
Run:
python vector_store/build_vector_store.pyonly during initial setup or when the historical dataset changes and the vector index needs to be rebuilt.
You do not need to rebuild the vector database every time you start the application.
project/
β
βββ agents/
β βββ master_agent.py
β βββ summarizer_agent.py
β βββ routing_agent.py
β βββ prediction_agent.py
β βββ response_agent.py
β βββ rag_agents.py
β
βββ rag/
β βββ embeddings.py
β βββ retriever.py
β βββ vector_store.py
β
βββ vector_store/
β βββ build_vector_store.py
β βββ faiss_index/
β
βββ data/
β βββ tickets/
β
βββ api/
β βββ main.py
β
βββ index.py
βββ requirements.txt
βββ README.md
Contains the specialized AI agents responsible for different stages of ticket processing.
| File | Purpose |
|---|---|
master_agent.py |
Controls and orchestrates all agents |
summarizer_agent.py |
Summarizes customer tickets |
routing_agent.py |
Determines the appropriate department |
prediction_agent.py |
Predicts estimated resolution time |
response_agent.py |
Generates the final support response |
rag_agents.py |
RAG-related testing/agent functionality |
Contains the Retrieval-Augmented Generation pipeline.
| File | Purpose |
|---|---|
embeddings.py |
Generates vector embeddings |
retriever.py |
Searches for similar tickets |
vector_store.py |
Loads and interacts with the FAISS database |
Contains the vector database generation logic.
| File | Purpose |
|---|---|
build_vector_store.py |
Creates the FAISS vector database |
faiss_index/ |
Stores the generated vector index |
Contains historical customer support tickets.
These historical tickets form the system's AI knowledge base.
They are converted into embeddings and stored in FAISS for semantic retrieval.
Contains the FastAPI backend.
| File | Purpose |
|---|---|
main.py |
Starts the API and exposes ticket-analysis endpoints |
The primary endpoint is:
POST /analyze-ticket
For a first-time setup, use:
1. Install dependencies
β
2. Build FAISS Vector Database
β
3. Start FastAPI Backend
β
4. Start Frontend / Index
Commands:
pip install -r requirements.txtThen:
python vector_store/build_vector_store.pyThen start the backend:
uvicorn api.main:app --reloadFinally, in another terminal:
python index.pyOnce the FAISS database has already been created, you generally do not need to rebuild it.
Just start the backend first:
uvicorn api.main:app --reloadThen start the frontend/index:
python index.pyCustomer Ticket
β
FastAPI
β
Master Agent
β
Specialized AI Agents
β
RAG + FAISS Historical Knowledge
β
Response Agent
β
AI-Powered Customer Support Response
Your project uses multiple specialized AI agents together with RAG and a FAISS vector database to automatically understand, classify, predict, retrieve knowledge for, and respond to customer support tickets.