A local AI chatbot for company documents
Developed as part of a practical bachelor thesis with a focus on privacy-friendly document retrieval using RAG (Retrieval-Augmented Generation).
-
📄 PDF Upload & Processing
Extracts and splits content from uploaded PDFs -
🧠 Vector-based Knowledge Retrieval
Document search using ChromaDB -
🔌 LLM Support (Local)
Uses models from Ollama
→ e.g.mistral,llama3,gemma,nomic-embed-text -
🧬 Embedding Backend Selection
- HuggingFace (
sentence-transformers) - Ollama (
nomic-embed-text)
- HuggingFace (
-
💬 User-Friendly Streamlit Interface
- LLM model selection
- Uploaded files list + delete option
- Manual index refresh
- Contextual Q&A interface
-
📦 Privacy-First & Fully Local
- Runs entirely offline, no cloud dependency
-
Ollama must be installed and running locally
-
Optional: .env file to override config variables (e.g. EMBEDDING_TYPE)
QueryMate2/
├── backend/
│ ├── chroma_index.py # Chroma index & vector search
│ ├── ollama_client.py # LLM requests via Ollama (API or library)
│ ├── embedding.py # Select and initialize embedding method
│ ├── config.py # Central configuration
│ └── logger.py # Logging setup
├── frontend/
│ ├── ui.py # Main UI logic (Streamlit)
│ ├── sidebar.py # Model selector, index actions
│ └── faq.py # Help/FAQ sidebar section
├── data/ # Uploaded PDF documents
├── models/chroma_index/ # Persistent vector index
└── requirements.txt # Python dependencies
- Code is organized into
backend/,frontend/, andtests/ - Logging is configured via
backend/logger.py - Embedding options (HuggingFace vs. Nomic) are set in
backend/config.pyor via CLI - Use
python backend/chroma_index.py --resetto rebuild the document index - Run validation scripts from
tests/orbackend/ollama_validation.py
- Clone the Repository:
git clone https://github.com/emacs45/querymate2.git
cd querymate2- Create a virtual environment
python3 -m venv venv
source venv/bin/activate- Install dependencies
pip install -r requirements.txtstreamlit run frontend/ui.pypython backend/chroma_index.py --reset| Variable | Description | Default value |
|---|---|---|
OLLAMA_METHOD |
Choose requests or library mode | library |
OLLAMA_URL |
API URL if using requests method | http://127.0.0.1:11434/api/generate |
EMBEDDING_TYPE |
Embedding backend: huggingface or nomic | huggingface |
OLLAMA_MODEL |
Default LLM model | mistral:latest |
Copy the example .env file and modify it as needed:
cp .env.example .env
Q: “What changes are introduced in the latest software release?” QueryMate scans your internal documentation and provides a concise summary based on the extracted context.
MIT License — Free to use for learning, research, or internal company purposes.
This chatbot was developed as part of a Bachelor of Science in Business Informatics. The goal was to prototype an AI assistant for SMEs that runs locally, protects sensitive data, and helps support agents or employees retrieve knowledge from internal documents quickly.
Found a bug? Have an idea? PRs and Issues are welcome!
