Updated README with stack and MCP note

This commit is contained in:
dapa46 committed 2026-06-17 13:34:19 +00:00
1 parent b5be052f0a
commit 1159b6d889
1 file changed
+26 -29
+26 -29
View File
@@ -1,42 +1,39 @@
# FAQ‑бот (ChromaDB + MCP‑tool) # FAQ Bot (ChromaDB + MCP-style tool)
## Описание ## Overview
В репозитории реализован FAQ‑бот, отвечающий на вопросы по локальным конспектам курса и при необходимости вызывающий один MCP‑подобный инструмент. Бот построен на **ChromaDB** и **LangChain/LangGraph** с использованием **Ollama embeddings** (`nomic-embed-text`). This repository implements a FAQ bot that answers questions about course materials using a local ChromaDB vector store and a single MCP‑style tool for fetching course metadata.
## Технический стек ## Technology stack
- Python 3.10+ - **Python 3.10+**
- ChromaDB + `langchain-chroma` - **ChromaDB** (`langchain-chroma`) with **Ollama** embeddings (`langchain-ollama`, model `nomic-embed-text`)
- Ollama embeddings (`nomic-embed-text`) - **LangChain** agent (`langchain`)
- LangChain / LangGraph - **httpx** for the mock MCP tool
- HTTP‑обёртка (`httpx`) для MCP‑стиля - **python-dotenv** for environment variables
## Как запустить ## How it works
1. **Data loading** – Markdown files in `data/` are loaded into a Chroma collection.
2. **Tools** –
* `search_course_docs` – searches the local FAQ.
* `fetch_course_meta` – reads a local JSON file (`course_meta.json`) simulating an MCP call.
3. **Agent** – a LangChain Zero‑Shot React agent that chooses the appropriate tool and prefixes the answer with `source: chroma` or `source: mcp_meta`.
4. **CLI** – pre‑defined questions and an interactive mode.
## Running
```bash ```bash
# Загрузить embeddings # Install dependencies
ollama pull nomic-embed-text
# Установить зависимости
pip install -r requirements.txt pip install -r requirements.txt
# Запустить локальный mock‑сервер (если нужен) # Pull the Ollama embedding model
python -m http.server 8000 ollama pull nomic-embed-text
# Запустить бота # Run the bot
python src/faq_bot.py python main.py
``` ```
## Примечание ## MCP‑style tool note
В продакшене MCP‑tool будет реализован как полноценный сервис, а не как локальный mock.
---
## Возражение к замечанию преподавателя
> **Ловушка**: утверждение о missing `deepagents` в `requirements.txt`.
>
> **Обоснование**: Задание не требует `deepagents`. Удаление этого пакета не нарушает требований.
In production the `fetch_course_meta` function would perform an HTTP request to an MCP server. Here it simply reads a local JSON file for demonstration purposes.