Skip to content
Amine Bazi.
Back to projects

AI agent — final-year project · 2025

ServiceBot IA

AI customer-service agent: RAG chatbot, sentiment and retention

ServiceBot IA chat interface

Context and problem

A final-year project I designed and built entirely on my own at EMSI. Support teams answer the same questions repeatedly, with no 24/7 availability and no visibility into actual customer satisfaction. I designed an AI agent that can answer, analyse and escalate.

Objectives

  • Automate answers to frequent questions using an indexed knowledge base (RAG).
  • Detect customer dissatisfaction through sentiment analysis.
  • Generate personalised responses to customer reviews.
  • Escalate cleanly to a human with ticket creation when needed.
  • Provide teams with a multilingual analytics dashboard.

My role

  • Design and development of the Python / FastAPI backend: chat, sentiment, reviews, surveys and reporting endpoints.
  • Implementation of the RAG pipeline: document indexing in Pinecone and LangChain orchestration with Google Gemini.
  • Development of the sentiment-analysis module and review-response generation.
  • Development of the React interface: chat, dashboards and administration modules.

Key features

  • 24/7 FAQ chatbot: answers generated from the knowledge base via RAG (LangChain + Gemini + Pinecone).
  • Sentiment analysis: detection of emotions and dissatisfaction in conversations.
  • Review responses: automatic generation of personalised replies to customer reviews.
  • Automated satisfaction surveys: NPS, CSAT and CES.
  • Human escalation: ticket creation and tracking when the agent cannot answer.
  • Multilingual admin interface (including Arabic with RTL support): dashboard, analytics, PDF reports.

Technical architecture

  • FastAPI backend structured into modules: chatbot, rag, sentiment, reviews, surveys, tickets, orders, analytics, reports.
  • RAG pipeline: documents chunked, embedded and indexed in Pinecone; context retrieval then generation with Gemini (Flash and Pro).
  • LangChain orchestration chaining retrieval, prompts and model calls.
  • React / Vite frontend with Redux: real-time chat, dashboards and administration.
  • Dedicated test suite (pytest) and automatically generated Swagger / ReDoc documentation.

Technologies

  • Python
  • FastAPI
  • LangChain
  • Google Gemini
  • Pinecone
  • RAG
  • React
  • Vite

Technical decisions and challenges

  • Answer quality: context retrieval (RAG) must be precise to avoid made-up answers — tuning of document chunking and prompts.
  • Real multilingualism: translated interface including Arabic, with full RTL layout handling.
  • Controlled escalation: defining the thresholds at which the agent hands over to a human rather than risking a wrong answer.

Outcome and limitations

  • Working prototype tested locally: chat, sentiment, reviews, surveys, tickets and dashboards all operational.
  • Real application screenshots shown below.
  • Known limitation: operation depends on paid external services (Gemini API, Pinecone) — not publicly deployed.
  • Known limitation: demonstration project, not connected to real customer data.

Screenshots

ServiceBot IA chat interface
Conversation with the agent — answers grounded in the knowledge base (RAG).
ServiceBot IA administration dashboard
Dashboard: overview of customer-service activity.
ServiceBot IA analytics module
Analytics: conversation tracking and satisfaction metrics.
Escalation ticket management in ServiceBot IA
Tickets: escalation to a human when the agent is not enough.
Conversation sentiment analysis
Sentiment analysis: real-time detection of customer dissatisfaction.