- Linux OS(>= 22.04)
- Python(=3.12)
- just (use
sudo apt install justincase not installed)
- Clone the repository:
git clone https://github.com/ashish142402004/nlp_customer_service.git - Inside the main directory run the following commands:
- For initial setup
just setup - To start unified logger run
just run_logger - To start the frontend and backend use
just run - The frontend runs on
http://localhost:8501 - Note: Please check if the backend is running before testing. Wait for a message like
Server started at http://0.0.0.0:8000 - After the backend is successfully running please run the following commands in given order one after the other(we weren't able to combine them as they need to be run one by one after completion of the previous command.):-
ollama servejust prefectjust mlflowjust docker_buildjust docker_run
- For initial setup
This app is a Streamlit-based interface for simulating a customer service chat between an Agent and a Customer. It supports live chat, chat analysis, insights, and micro-skill evaluation for agents.
Visible only if Agent role is selected.
- On click, the following backend calls are triggered :
- Summarization Service →
http://127.0.0.1:8002/summarize - QA Evaluation →
http://127.0.0.1:8004/evaluate - Micro Skill Evaluation →
http://127.0.0.1:8008/ms-advance - Knowledge Base Analysis →
http://127.0.0.1:8006/suggest_solution?type=1- Currently , these 8 files are present for Context-aware informaMon retrieval : - billing_overview.md | feature_requests.md | login_issues.md | payment_issues.md | privacy_policy.md | refund_policy.md | subscription_plans.md | technical_support.md
- Proposed Solution →
http://127.0.0.1:8006/suggest_solution?type=0
- Summarization Service →
- Extracts issue category from the chat.
- Loads predefined rules from a YAML config file and RapidFuzz's
token_sort_ratio(threshold: 55) to match input text with required categories like: Greetings , Disclaimers, Closing Statements - Uses regex patterns to detect and flag personal/sensitive info (e.g., account numbers, PINs, emails).Rule compliances.
- Displays current Sentiment Analysis by combining TextBlob for polarity detection with keyword boosting from config.
- Evaluates agent's response quality
- Displays past successful agent responses.
- Shows potential answers pulled from internal documentation.
- Displays skill ratings (e.g., empathy, professionalism) on a 5-point scale.
- Regenerates chat summary using the summarization API and shows it.
- Auto-assigns ticket priority based on the issue category identified by the LLM.
- Allows agent to add additional information to the ticket and stores them in the ticket log folder.
Each microservice is containerized and exposes a REST endpoint. Most services leverage asynchronous FastAPI routes and async HTTPX calls to improve performance.
1. Receives conversation text and Returns JSON ratings for skills (clarity, empathy, etc.)
1. Accepts agent response and Returns JSON adherence report
1. Fetches similar transcripts via async embedding + vector search
2. Prepares prompt from best examples and Returns suggested text
1. Receives conversation and Returns summary output
- Components:
Embedderuses SentenceTransformer to vectorize documentsTranscriptIndexbuilds and queries HNSWLib vector index- Decorated with MLflow tracking
- Global config:
config.yamldefines shared model hosts and API URLs - Service-level config: Each service (e.g.
llm_config.yaml) sets its own host/model parameters - Dockerized: Each sub-app has a Dockerfile
- Compose:
docker-compose.yamlunder/appbuilds and runs all services



