0% found this document useful (0 votes)
86 views4 pages

RAG Chatbot Final Report

The IEEE SPS Summer Mentorship Program 2025 presents a project focused on developing a Retrieval-Augmented Generation (RAG) Chatbot for efficient interaction with company policy documents. This AI-powered system utilizes a custom-trained embedding model and LangChain to provide real-time, context-aware responses to employee queries, thereby reducing reliance on HR personnel. Future enhancements include cloud integration, multi-document support, and advanced user authentication.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views4 pages

RAG Chatbot Final Report

The IEEE SPS Summer Mentorship Program 2025 presents a project focused on developing a Retrieval-Augmented Generation (RAG) Chatbot for efficient interaction with company policy documents. This AI-powered system utilizes a custom-trained embedding model and LangChain to provide real-time, context-aware responses to employee queries, thereby reducing reliance on HR personnel. Future enhancements include cloud integration, multi-document support, and advanced user authentication.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

IEEE SPS Summer Mentorship Program 2025

Company Policy Chatbot using RAG with Fine-Tuned Embeddings

Dr. Nikunj Tahilramani, Sr. Data Scientist, Data Sentinel Inc.


Param Shah, [Link]. 3rd Year

1.​ Abstract

This project presents a Retrieval-Augmented Generation (RAG) Chatbot system designed for
interacting with company policy documents using natural language queries. It incorporates a
custom-trained embedding model for semantic search and LangChain for managing
context-aware conversation. The solution offers a scalable and interactive platform for efficient
policy understanding and query resolution.

2.​ Introduction

With the increase in complexity and volume of internal company policies, accessing and
interpreting policy documents has become increasingly time-consuming. This project builds an
AI-powered policy assistant chatbot using RAG architecture, aimed at automating document
understanding and improving policy communication. The system leverages LangChain,
HuggingFace embeddings, and ChromaDB for vector storage, enabling intelligent question
answering based on contextual document understanding.

3.​ Problem Statement

In many organizations, employees frequently encounter difficulty when attempting to access and
interpret internal policy documents. These documents are often lengthy, distributed across
different formats (PDFs, Word files, intranet pages), and may lack a centralized, user-friendly
access point. As a result, employees tend to rely heavily on HR or administrative personnel to
answer routine questions—such as those regarding leave policy, reimbursement procedures, or
IT access protocols.

This leads to inefficiencies and places an unnecessary burden on support staff. A scalable,
intelligent solution is required to enable employees to get accurate, real-time answers to their
policy-related questions without manual intervention.
4.​ Objective

The objective of this project is to develop a conversational AI chatbot that can accurately
respond to employee questions by retrieving relevant information from company policy
documents using a Retrieval-Augmented Generation (RAG) approach.

5.​ Project Design


a.​ System Architecture
i.​ Frontend: Streamlit-based web interface
ii.​ Backend: Python scripts using LangChain, HuggingFace Transformers,
and Chroma vector store
iii.​ Model: Sentence Transformer fine-tuned using company-specific training
data
iv.​ Storage: Local ChromaDB storing document embeddings
v.​ Input Data: Company policy PDF documents converted into chunks and
embedded
b.​ Tools and Libraries
i.​ Python 3
ii.​ LangChain
iii.​ HuggingFace Transformers
iv.​ Streamlit
v.​ SentenceTransformers
vi.​ ChromaDB

6.​ Methodology
a.​ Embedding & Fine-tuning
i.​ Custom company policy training data was used to fine-tune a
sentence-transformer model for better contextual understanding.
b.​ Preprocessing
i.​ Company policy PDFs are split into small chunks.
ii.​ Each chunk is embedded using the fine-tuned transformer and stored in
ChromaDB.
c.​ Retrieval-Augmented Generation (RAG)
i.​ Query is embedded using the same fine-tuned model.
ii.​ Top-k relevant chunks are retrieved from ChromaDB.
iii.​ LangChain passes the context along with the user query to the language
model (e.g., Groq, OpenAI).
d.​ Deployment
i.​ Chatbot is launched using run_chatbot.bat, running a Streamlit UI with
real-time response capabilities.
7.​ Applications
a.​ Internal company helpdesk
b.​ HR policy assistant
c.​ Compliance documentation chatbot
d.​ Employee onboarding Q&A system

8.​ Future Work


a.​ Integrate with cloud-based vector stores (e.g., Pinecone, Weaviate)
b.​ Support for multi-document and multi-modal queries
c.​ Voice assistant integration
d.​ Web scraping and auto-update capabilities
e.​ Advanced user authentication and access control
f.​ Analytics dashboard for query trends and FAQ mining

9.​ Conclusion

The Company Policy Chatbot effectively demonstrates how RAG and embedding-based retrieval
systems can streamline access to complex documentation. By integrating fine-tuned models and
real-time interfaces, it provides a responsive and intelligent user experience, aiding in
organizational communication and document accessibility.

10.​Appendix
a.​ Files and Scripts
i.​ rag_chatbot.py
ii.​ [Link]
iii.​ training_data.json
iv.​ [Link]
v.​ fine-tuned-embedder/ (embedding model directory)
b.​ Libraries Used
i.​ LangChain
ii.​ HuggingFace Transformers
iii.​ SentenceTransformers
iv.​ ChromaDB
v.​ Streamlit
vi.​ dotenv
vii.​ PyPDFLoader

Common questions

Powered by AI

LangChain is crucial in managing context-aware conversations within the RAG-based chatbot by handling the passage of contextual information between retrieved document chunks and user queries to the language model. This allows for generating responses that are not only accurate but also contextually relevant, promoting a more natural and interactive user dialogue .

The methodology involves using custom company policy training data to fine-tune a sentence-transformer model, optimizing it for better contextual understanding and retrieval accuracy. Policy documents are divided into chunks and embedded using the fine-tuned model, stored in ChromaDB. The tuned model's embeddings enable accurate retrieval of document chunks when user queries are processed, significantly enhancing document retrieval performance by ensuring the chatbot understands the context of queries and documents accurately .

Traditional methods of accessing internal policy documents are inefficient due to the documents' length, varied formats, and lack of centralized access points, leading employees to rely heavily on HR staff for answers. A RAG-based chatbot addresses these challenges by providing a centralized, scalable platform for retrieving precise policy information in real-time without manual intervention, thus reducing the burden on support staff .

The fine-tuned sentence-transformer model is critical for understanding nuanced policy-related queries by embedding both document chunks and user queries in a semantically rich vector space. This ensures that the chatbot retrieves and generates responses that are contextually aligned with complex policy documents. The model's enhancement allows for accurate interpretations of the intent behind queries, directly contributing to precise and context-sensitive answers .

Including an analytics dashboard for query trends and FAQ mining would enable companies to identify common employee inquiries, optimize policy document availability, and enhance content to address frequently asked questions proactively. This data-driven insight could improve strategic planning by highlighting areas for process improvement, refining policy communication, and creating more targeted HR initiatives, thus leveraging the chatbot as a tool for organizational growth and efficiency .

Integrating voice assistants can make the chatbot more accessible and user-friendly, allowing users to receive answers through natural conversation rather than typing. Cloud-based vector stores, like Pinecone and Weaviate, would provide scalable storage solutions, supporting larger data volumes and faster retrieval times. These features together would significantly enhance the chatbot's functionality, offering a seamless and more intuitive user experience .

ChromaDB acts as the vector storage solution, storing the embeddings of policy document chunks. Its significance lies in facilitating efficient retrieval of relevant information during query processing. The advantages include compact storage, scalability, and fast retrieval times, which are essential for maintaining a responsive and efficient chatbot system. ChromaDB also supports fine-grained access to stored embeddings, allowing precise matches to user queries .

The Streamlit-based web interface simplifies deployment and provides a user-friendly platform that can be easily accessed by employees. Its real-time response capabilities support dynamic interactions, making it easier for users to engage with the chatbot and obtain information quickly. This enhances the system's usability by offering an intuitive interface that is both easy to navigate and efficient for end-users .

Beyond its current scope, the chatbot could be used for applications such as compliance verification, automated meeting roles, and personalized learning guides. Each application could leverage the core capabilities of document retrieval and context-aware interactions, thereby enhancing organizational efficiency by reducing manual workloads, improving compliance adherence, and facilitating personalized employee development .

The integration of RAG with custom embeddings enhances document accessibility by enabling semantic search, which allows the retrieval of relevant document chunks in response to user queries. The system uses a fine-tuned sentence-transformer model trained on company-specific data, improving contextual understanding. By embedding documents and user queries similarly, the model retrieves top-k relevant document chunks from ChromaDB, facilitating accurate, context-aware responses to user queries .

You might also like