49 lines
1.4 KiB
Markdown
49 lines
1.4 KiB
Markdown
# FAQ Bot with ChromaDB and MCP-style Tool
|
||
|
||
## Overview
|
||
|
||
This repository implements a FAQ bot that answers questions about course materials using a local **ChromaDB** vector store and, when needed, a single **MCP-style tool** that fetches course metadata.
|
||
|
||
## Features
|
||
|
||
* **ChromaDB** for semantic search over lecture markdown files.
|
||
* **MCP-style tool** (`fetch_course_meta`) that simulates an external MCP service.
|
||
* **LangGraph**‑based agent that routes queries to the appropriate tool and prefixes the answer with the source.
|
||
* CLI with preset questions and an interactive mode.
|
||
|
||
## Setup
|
||
|
||
```bash
|
||
# Pull embeddings model
|
||
ollama pull nomic-embed-text
|
||
|
||
# Install dependencies
|
||
pip install -r requirements.txt
|
||
|
||
# Run a simple HTTP server to serve meta.json (for the MCP tool)
|
||
# In a separate terminal:
|
||
# python -m http.server 8000
|
||
```
|
||
|
||
## Running the Bot
|
||
|
||
```bash
|
||
python main.py
|
||
```
|
||
|
||
The script will load the FAQ data, build the ChromaDB index, and then run the demo questions followed by an interactive prompt.
|
||
|
||
## Project Structure
|
||
|
||
```
|
||
├── data/ # Markdown files with lecture notes
|
||
├── main.py # Entry point
|
||
├── requirements.txt
|
||
└── README.md
|
||
```
|
||
|
||
## Notes
|
||
|
||
* The MCP tool currently points to `http://localhost:8000/meta.json`. Replace with your actual endpoint if needed.
|
||
* The agent uses `ChatOpenAI` via OpenRouter; set `OPENAI_API_KEY` in your environment.
|