Update README.md
This commit is contained in:
@@ -1,52 +1,46 @@
|
|||||||
# FAQ‑Bot – ChromaDB + MCP Tool
|
# FAQ Bot – ChromaDB + MCP‑style Tool
|
||||||
|
|
||||||
## Overview
|
This repository implements a small FAQ bot that answers questions about a course. The bot uses:
|
||||||
This project implements an FAQ‑bot that answers questions about local course notes stored in Markdown files using **ChromaDB** for retrieval and a single **MCP‑style tool** for metadata queries.
|
|
||||||
|
|
||||||
- **Local knowledge** – 2–3 `.md` files in `data/`.
|
* **ChromaDB** (via `langchain_chroma`) for local semantic search over markdown notes.
|
||||||
- **Vector store** – ChromaDB with Ollama embeddings.
|
* **Ollama** embeddings (`nomic-embed-text`) and a local LLM (`llama3`).
|
||||||
- **Tool** – `fetch_course_meta` that performs a GET request to a local JSON file (mock MCP server).
|
* A **single MCP‑style tool** that mimics a metadata service.
|
||||||
- **Agent** – LangGraph agent that routes the query to the appropriate source and labels the answer with `source: chroma | mcp_meta`.
|
* A **LangChain agent** that routes queries to the correct tool and tags the answer with a source.
|
||||||
- **CLI** – 3 example questions (2 for Chroma, 1 for meta) and an interactive mode.
|
|
||||||
|
The bot is launched from the command line and offers three preset questions (two for the FAQ store, one for metadata) as well as an interactive mode.
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Pull Ollama model
|
# Pull the required Ollama model
|
||||||
ollama pull nomic-embed-text
|
ollama pull nomic-embed-text
|
||||||
|
ollama pull llama3
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
|
||||||
# Start local mock MCP server (JSON file)
|
|
||||||
python -m http.server 8000 --directory mock
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Running the Bot
|
## Running the bot
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python main.py --question "What is the course schedule?"
|
python main.py
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example Questions
|
You will see three preset questions. Type the number or a custom question and press **Enter**. Type `/quit` to exit.
|
||||||
1. **Chroma** – *"What topics are covered in week 3?"*
|
|
||||||
2. **Chroma** – *"How many hours per week are required?"*
|
## Project structure
|
||||||
3. **Meta** – *"What is the course schedule?"*
|
|
||||||
|
|
||||||
## Project Structure
|
|
||||||
```
|
```
|
||||||
├── data/ # Markdown FAQ files
|
├── data/ # Markdown FAQ files and static metadata JSON
|
||||||
├── mock/ # JSON mock MCP server
|
├── config.py # Configuration constants
|
||||||
├── src/
|
├── chunker.py # Text chunking helper
|
||||||
│ ├── agent.py # LangGraph agent definition
|
├── vector_store.py # Chroma store and search tool
|
||||||
│ ├── chunker.py # Chroma loader
|
├── tools.py # LangChain tools (search + MCP‑style)
|
||||||
│ ├── cli.py # CLI interface
|
├── main.py # Entry point & CLI
|
||||||
│ ├── config.py # Config & constants
|
├── requirements.txt
|
||||||
│ ├── init_loader.py # Bulk loader
|
└── README.md
|
||||||
│ ├── qdrant_store.py # Vector store helper
|
|
||||||
│ ├── rag_tools.py # Search & meta tools
|
|
||||||
│ ├── tools.py # MCP wrapper
|
|
||||||
│ └── vector_store.py # Chroma store
|
|
||||||
└── requirements.txt
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT
|
MIT
|
||||||
Reference in New Issue
Block a user