Skip to content

About

AI based assistant to help Agents in customer service domain for efficient and accurate query resolution

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Functionality and Usage

Pre Requisites

  • Linux OS(>= 22.04)
  • Python(=3.12)
  • just (use sudo apt install just incase not installed)

Running the Application

  1. Clone the repository: git clone https://github.com/ashish142402004/nlp_customer_service.git
  2. 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 serve
      • just prefect
      • just mlflow
      • just docker_build
      • just docker_run

Application Features


Frontend

Customer Service Assistant – UI Description

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.


Main Features

Role Selection

  • A sidebar with a radio button allows the user to choose between:
    • Customer lvl_test
    • Agent lvl_test

Agent-Only Section: Contextual Insights

Visible only if Agent role is selected.

Get Insights Button

  • 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

Agent Tabs

1. Transcript Analysis

  • 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.

2. Quality Assurance

  • Evaluates agent's response quality

3. Suggested Responses

  • Displays past successful agent responses.

4. KB Insights

  • Shows potential answers pulled from internal documentation.

5. Micro-Skill Advancement

  • Displays skill ratings (e.g., empathy, professionalism) on a 5-point scale.

Additional Actions for Agents

Get Current Summary

  • Regenerates chat summary using the summarization API and shows it.

Raise Ticket

  • 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.

Backend

Services Overview

Each microservice is containerized and exposes a REST endpoint. Most services leverage asynchronous FastAPI routes and async HTTPX calls to improve performance.


1. Micro-Skill Evaluation (ms_advance)

1. Receives conversation text  and Returns JSON ratings for skills (clarity, empathy, etc.)

2. Quality Assurance (quality_assurance)

1. Accepts agent response  and  Returns JSON adherence report

3. Solution Suggestions (suggestions)

1. Fetches similar transcripts via async embedding + vector search 
2. Prepares prompt from best examples and Returns suggested text

4. Summarization (summarizer_llm)

1. Receives conversation  and Returns summary output

5. Document Search (doc_search)

  • Components:
    • Embedder uses SentenceTransformer to vectorize documents
    • TranscriptIndex builds and queries HNSWLib vector index
    • Decorated with MLflow tracking

Configuration & Deployment

  • Global config: config.yaml defines 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.yaml under /app builds and runs all services

lvl_test Sample Screenshot of MLflow run

lvl_test Sample Screenshot of Prefect run

About

AI based assistant to help Agents in customer service domain for efficient and accurate query resolution

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages