1.3 KiB
1.3 KiB
FAQ Bot (ChromaDB + MCP-style tool)
Overview
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+
- ChromaDB (
langchain-chroma) with Ollama embeddings (langchain-ollama, modelnomic-embed-text) - LangChain agent (
langchain) - httpx for the mock MCP tool
- python-dotenv for environment variables
How it works
- Data loading – Markdown files in
data/are loaded into a Chroma collection. - Tools –
search_course_docs– searches the local FAQ.fetch_course_meta– reads a local JSON file (course_meta.json) simulating an MCP call.
- Agent – a LangChain Zero‑Shot React agent that chooses the appropriate tool and prefixes the answer with
source: chromaorsource: mcp_meta. - CLI – pre‑defined questions and an interactive mode.
Running
# Install dependencies
pip install -r requirements.txt
# Pull the Ollama embedding model
ollama pull nomic-embed-text
# Run the bot
python main.py
MCP‑style tool note
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.