Skip to content

Wisawathep/AI_Customer_Service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Customer Service Chatbot | Pet Shop Chatbot

AI Customer Support with RAG is an intelligent customer service chatbot designed to answer customer inquiries using company-specific knowledge. The system leverages Retrieval-Augmented Generation (RAG) to retrieve relevant information from a knowledge base before generating responses, reducing reliance on the language model's internal knowledge and improving response accuracy

⭐ Motivation

This project was developed to explore how Retrieval-Augmented Generation (RAG) can improve the reliability of AI-powered customer support systems. The goal was to build a chatbot that answers customer questions based only on company knowledge, while reducing hallucinations through prompt engineering, guardrails, and semantic retrieval techniques. In addition to providing accurate responses, the project focuses on building a modular, production-oriented AI pipeline that is easy to maintain, monitor, and extend.

🔑 Key Features

  • AI-powered customer support chatbot using Retrieval-Augmented Generation (RAG)
  • Semantic search with BAAI/bge-m3 embeddings and ChromaDB
  • Custom document chunking for structured company knowledge
  • Input and Output Guardrails for safer AI responses
  • Prompt engineering to restrict responses to the knowledge base
  • Conversation history management with PostgreSQL
  • FastAPI backend with Vue.js frontend

🛠️ Tech Stacks

Python | Javascript | Vue.js | Uvicorn | FastAPI | FastAPI | LLama (Groq) | PostgreSQL | ChromaDB | Pydantic

python logo javascript logo nextjs logo uvicorn logo fastapi logo langchain logo gemini logo huggingface logo pydantic logo vscode logo

📚 What I Learned

Through this project, I gained hands-on experience in designing and implementing an end-to-end Retrieval-Augmented Generation (RAG) system. I learned how to preprocess and chunk knowledge documents, generate vector embeddings, perform semantic retrieval with ChromaDB, and integrate large language models into a production-style application. I also explored prompt engineering, guardrail design, and debugging techniques to improve response reliability and reduce hallucinations. Most importantly, this project strengthened my understanding of AI system architecture and the practical challenges of deploying LLM-based applications.

⚙️ Architecture (RAG Pipeline)

Document Loader

Loads raw knowledge documents from text files and converts them into a unified document format for further processing in the RAG pipeline.

Text Cleaner

Preprocesses raw text by removing unnecessary whitespace, formatting inconsistencies, and unwanted characters to improve document quality before chunking.

Chunker

Splits documents into smaller semantic chunks while preserving their structure and metadata, enabling more accurate retrieval during question answering.

Embedder

Generates dense vector embeddings for each text chunk using the BAAI/bge-m3 embedding model, allowing semantic similarity search instead of keyword matching.

ChromaDB

Stores vector embeddings and metadata for all knowledge chunks, enabling efficient semantic retrieval of the most relevant information based on user queries.

Input Guardrail

Validates user input before processing by detecting invalid, malicious, or out-of-scope requests to protect the system from prompt injection and unsafe inputs.

Prompt Builder

Constructs the final prompt by combining the system instructions, retrieved knowledge context, and the user's question before sending it to the language model.

Output Guardrail

Validates the generated response to ensure it is consistent with the retrieved context and reduces the risk of hallucinated or unsupported information.

PostgreSQL

Stores conversation history, including user messages and AI responses, to support multi-turn conversations, session management, and future analytics.

📜 Result

📜 Test Case


COMPUTER ENGINEERING
KING MONGKUT'S UNIVERSITY OF TECHNOLOGY NORTH BANGKOK, A.Y. 2023/27

About

Pet Shop AI Customer Service Chatbot

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors