Back to MCP directory
publicPublicdnsLocal runtime

mcp_rag_llm

基于RAG和智能路由的多代理AI对话系统,通过分层架构实现用户查询分类与专业化处理。

article

README

🚀 项目结构说明

本项目采用分层架构设计,各层分工明确,便于开发和维护。以下为你详细介绍项目的具体结构:

项目根目录

project-root/

配置层(SYSTEM CONFIGURATION)

├── config/                 # 系统配置
│   └── settings.py         # API密钥、模型设置、环境变量

模板层(Prompt Management)

├── prompts/                # 第一层:模板层
│   ├── __init__.py
│   ├── router_prompts.yaml # 分类逻辑提示
│   └── agent_prompts.yaml  # 专业代理(技术、销售等)提示

RAG层

├── infrastructure/         # 第二层:RAG层
│   ├── __init__.py
│   └── database.py         # RAG的向量数据库与数据索引

路由与执行层

├── core/                   # 第三层和第四层:路由与执行层
│   ├── __init__.py
│   ├── llm_client.py       # OpenAI/Anthropic/Gemini/Ollama的包装器
│   ├── router.py           # 分类/识别用户查询的逻辑
│   └── executor.py         # 获取提示并执行推理的逻辑

服务层(MCP & Utilities)

├── services/               # 服务层
│   ├── __init__.py
│   └── logger.py           # 日志记录、搜索和数据库服务连接器

接口层(Entry point)

├── main.py                 # 第五层:接口层(入口点)

项目依赖

└── requirements.txt        # 项目依赖
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client