Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

📄 Document RAG Chatbot

A document-based Retrieval-Augmented Generation (RAG) chatbot that allows users to upload documents and ask questions about their content.

The system extracts text from documents, processes the content into chunks, converts the chunks into embeddings, retrieves the most relevant information, and uses it to generate grounded answers.

🚀 Features

  • Upload and process documents
  • Support for multiple document formats
  • Text extraction from documents
  • Document chunking
  • Text embeddings
  • Semantic similarity search
  • Retrieval-Augmented Generation (RAG)
  • Question answering based on uploaded documents
  • Metadata associated with documents
  • Streamlit-based user interface
  • Environment-variable based API configuration

📁 Project Structure

Chatbot/
│
├── app/
│   ├── ...
│   └── ...
│
├── data/
│   └── Uploaded documents
│
├── processed_data/
│   └── Processed / generated data
│
├── .env
├── .gitignore
├── requirements.txt
└── README.md

🧠 RAG Pipeline

Documents
    ↓
Document Loading
    ↓
Text Extraction
    ↓
Chunking
    ↓
Text Embeddings
    ↓
Vector Storage
    ↓
Similarity Search
    ↓
Relevant Context
    ↓
LLM
    ↓
Answer

📚 Supported Documents

The project supports the following document formats:

  • CSV
  • PDF
  • Jupyter Notebook (.ipynb)
  • PowerPoint presentation (.pptx)
  • Microsoft Word document (.docx)
  • Plain text file (.txt)

Support for additional formats can be added through new document loaders.

⚙️ Installation

1. Clone the repository

git clone <your-repository-url>
cd Chatbot

2. Create a virtual environment

python -m venv .venv

3. Activate the virtual environment

Windows PowerShell:

.\.venv\Scripts\Activate.ps1

If PowerShell execution policy causes an issue:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
.\.venv\Scripts\Activate.ps1

4. Install dependencies

python -m pip install -r requirements.txt

🔐 Environment Variables

Create a .env file in the project root.

Example:

API_KEY=your_api_key_here

Do not commit .env to GitHub.

The .gitignore file already excludes it.

▶️ Run the Application

After activating the virtual environment, run the Streamlit application using the appropriate entry file from the app directory.

For example:

streamlit run app/main.py

Replace app/main.py with your actual Streamlit entry file if it has a different name.

🛠️ Technologies

  • Python
  • Streamlit
  • Pandas
  • NumPy
  • Sentence Transformers
  • Vector Database / Vector Search
  • LLM
  • RAG
  • PyMuPDF
  • python-pptx

👨‍💻 Author

Abhay Kadam

This project is being developed as a practical implementation of a document-based Retrieval-Augmented Generation system.

About

A document-based RAG chatbot that extracts, processes, embeds, and retrieves information from multiple document formats to generate grounded answers using an LLM.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages