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.
- 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
Chatbot/
│
├── app/
│ ├── ...
│ └── ...
│
├── data/
│ └── Uploaded documents
│
├── processed_data/
│ └── Processed / generated data
│
├── .env
├── .gitignore
├── requirements.txt
└── README.md
Documents
↓
Document Loading
↓
Text Extraction
↓
Chunking
↓
Text Embeddings
↓
Vector Storage
↓
Similarity Search
↓
Relevant Context
↓
LLM
↓
Answer
The project supports the following document formats:
- CSV
- 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.
git clone <your-repository-url>
cd Chatbotpython -m venv .venvWindows PowerShell:
.\.venv\Scripts\Activate.ps1If PowerShell execution policy causes an issue:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned
.\.venv\Scripts\Activate.ps1python -m pip install -r requirements.txtCreate a .env file in the project root.
Example:
API_KEY=your_api_key_hereDo not commit .env to GitHub.
The .gitignore file already excludes it.
After activating the virtual environment, run the Streamlit application using the appropriate entry file from the app directory.
For example:
streamlit run app/main.pyReplace
app/main.pywith your actual Streamlit entry file if it has a different name.
- Python
- Streamlit
- Pandas
- NumPy
- Sentence Transformers
- Vector Database / Vector Search
- LLM
- RAG
- PyMuPDF
- python-pptx
Abhay Kadam
This project is being developed as a practical implementation of a document-based Retrieval-Augmented Generation system.