2.1 KiB
2.1 KiB
FAQ Bot – ChromaDB + MCP-tool
This repository contains a simple FAQ bot that uses ChromaDB for vector storage and a single MCP-tool for auxiliary functionality. The bot answers user questions by retrieving relevant FAQ documents and generating responses with OpenAI’s LLM.
Features
- Vector search with ChromaDB (persisted locally).
- OpenAI embeddings (
text-embedding-ada-002) for document indexing. - OpenAI function calling to invoke a single MCP-tool (
get_current_utc_time). - Interactive command‑line interface.
Setup
-
Clone the repository
git clone https://git.brojs.ru/kuzakhmetovartur/povtornyy-ekzamen-faq-bot-chromadb-odin.git cd povtornyy-ekzamen-faq-bot-chromadb-odin -
Create a virtual environment
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate -
Install dependencies
pip install -r requirements.txt -
Set environment variables
Create a
.envfile in the project root:OPENAI_API_KEY=your_openai_api_key FAQ_FILE=data/faq.jsonl # optional, defaults to data/faq.jsonl -
Prepare FAQ data
Place your FAQ documents in
data/faq.jsonl. Each line should be a JSON object:{"id": "1", "text": "What is ChromaDB?", "metadata": {"category": "database"}} {"id": "2", "text": "How to use the MCP-tool?", "metadata": {"category": "tool"}}If the file is missing, the bot will start without pre‑loaded documents.
Running the Bot
python src/main.py
You will see:
FAQ Bot (ChromaDB + MCP-tool). Type 'exit' to quit.
You:
Type a question, e.g.:
You: What is the current time?
The bot may invoke the MCP-tool and return the current UTC time.
Testing
The repository includes no automated tests, but you can manually verify:
- The bot can answer FAQ questions.
- The MCP-tool is invoked when the model requests it.
- ChromaDB persists data between runs (check the
chromadb/directory).
License
MIT License