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