1.8 KiB
1.8 KiB
FAQ Bot – ChromaDB + MCP-tool
This repository contains a lightweight FAQ bot that uses ChromaDB as the vector store and a single MCP-tool for generating embeddings.
The bot loads FAQ documents, stores them in ChromaDB, and answers user questions by retrieving the most relevant documents.
Features
- Single vector store stack – ChromaDB
- One MCP-tool for embeddings (OpenAI or deterministic fallback)
- Interactive command‑line interface
- Easy to add new FAQ documents
Requirements
- Python 3.10+
- An OpenAI API key (optional – a deterministic dummy embedding is used if not provided)
Installation
git clone https://git.brojs.ru/kuzakhmetovartur/povtornyy-ekzamen-faq-bot-chromadb-odin.git
cd povtornyy-ekzamen-faq-bot-chromadb-odin
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
Configuration
Create a .env file in the project root with your OpenAI key:
OPENAI_API_KEY=sk-...
If the key is missing, the bot will use a deterministic dummy embedding.
Usage
Place your FAQ documents as plain text files in the data/ directory (one file per FAQ).
python src/faq_bot.py
You will see a prompt:
FAQ Bot is ready. Type your question (or 'exit' to quit).
Q:
Type a question and press Enter. The bot will display the top 3 most relevant answers.
Project Structure
src/
├── faq_bot.py # Main entry point
├── vector_store.py # Wrapper around ChromaDB
└── mcp_tool.py # Embedding generation
Extending
- Adding new documents – drop new
.txtfiles intodata/and restart the bot. - Changing the embedding model – modify
mcp_tool.get_embeddingto use a different provider.
License
MIT License