Files
povtornyy-ekzamen-faq-bot-c…/README.md
T

71 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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 commandline 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
```bash
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).
```bash
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 `.txt` files into `data/` and restart the bot.
- **Changing the embedding model** modify `mcp_tool.get_embedding` to use a different provider.
## License
MIT License