智能代理RAG
HTTP-SSE支持实体提取和查询优化的智能RAG系统
支持实体提取和查询优化的智能RAG系统

Agentic RAG with MCP Server is a powerful project that brings together an MCP (Model Context Protocol) server and client for building Agentic RAG (Retrieval-Augmented Generation) applications.
This setup empowers your RAG system with advanced tools such as:
The server hosts these intelligent tools, while the client shows how to seamlessly connect and utilize them.
server.pyPowered by the FastMCP class from the mcp library, the server exposes these handy tools:
| Tool Name | Description | Icon |
|---|---|---|
get_time_with_prefix | Returns the current date & time | ⏰ |
extract_entities_tool | Uses OpenAI to extract entities from a query — enhancing document retrieval relevance | 🧠 |
refine_query_tool | Improves the quality of user queries with OpenAI-powered refinement | ✨ |
check_relevance | Filters out irrelevant content by checking chunk relevance with an LLM | ✅ |
mcp-client.pyThe client demonstrates how to connect and interact with the MCP server:
ClientSession from the mcp libraryopenai Python packagemcp librarypython-dotenv for environment variable management# Step 1: Clone the repository git clone https://github.com/ashishpatel26/Agentic-RAG-with-MCP-Server.git # Step 2: Navigate into the project directory cd Agentic-RAG-with-MCP-Serve # Step 3: Install dependencies pip install -r requirements.txt
.env file (use .env.sample as a template).env:OPENAI_MODEL_NAME="your-model-name-here" GEMINI_API_KEY="your-model-name-here"
python server.py
python mcp-client.py
This project is licensed under the MIT License.
Thanks for Reading 🙏