Token导航 LogoToken导航TokenDH.com
Agent Langchain Rag MCP Tools Boilerplate logo
AI代理stdio官方级别未说明来源级核验

Agent Langchain Rag MCP Tools Boilerplate

MCP Server

AgentForge是一个生产级全栈AI代理开发框架,集成了LangGraph任务编排、RAG知识检索和MCP工具协议,提供FastAPI后端与React前端支持。

工具数

0

提示词数

0

GitHub Stars

11

资源数

0
AI代理Python全栈开发

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

jadenitishraj

提供方

jadenitishraj

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv venv

详细介绍

试剂忘记煮沸板🚀

终极全栈AI代理入门套件

AgentForge是用于构建高级AI代理的生产就绪样板。它结合了 LangGraph 对于编排, 检索增强生成 用于知识检索,以及 MCP(模型上下文协议) 用于标准化工具集成——所有这些都包含在现代 快速API 后端和 反应 前端。.

License Python React FastAPI

✨ 主要特点

  • 🤖 多代理编排器:高级V2架构,具有专门的并行代理(历史、RAG、内存、Web)和验证器循环。
  • ⚡ 语义缓存:基于Qdrant的缓存,可立即为重复查询提供服务,减少延迟和成本。
  • 🔄 RLHF反馈回路:内置机制,用于收集用户反馈(拇指向上/向下),以便将来对模型进行微调。
  • 📚 RAG管道v2:具有语义分块、重新排名和混合搜索的高级检索。
  • 🔌 MCP集成:完全支持Anthropic的模型上下文协议(客户端和服务器端)。
  • 🛡️ 护栏:安全、隐私(PII编辑)和质量的输入/输出验证。
  • ⚡ 全栈:

- 后端:具有异步支持和流式响应的FastAPI。 - 前端:使用TailwindCSS和markdown渲染的现代React(Vite)。

  • 🧠 记忆:使用SQLite持久化用户记忆。
  • 🔍 网页搜索:通过DuckDuckGo和Brave集成免费网络搜索。

🏗️ 架构概述

graph TD
    User[User / Frontend] |Rest API / SSE| API[FastAPI Backend]
    API |Orchestration| Agent[LangGraph Agent]

    subgraph "Agent Brain"
        Agent |Safety| Guard[Guardrails]
        Agent |Context| RAG[RAG Pipeline]
        Agent |Tools| MCP[MCP Client]
        Agent |State| Memory[SQLite Memory]
    end

    subgraph "External"
        MCP |Protocol| Tools[External Tools]
        RAG |Embeddings| VectorDB[Vector Store]
        Agent |Inference| LLM[OpenAI GPT-4o]
    end

🚀 入门指南

先决条件

  • Python 3.10+
  • Node.js 18+
  • OpenAI API密钥

1.克隆和设置

git clone https://github.com/yourusername/agentforge.git](https://github.com/jadenitishraj/Agent-langchain-rag-mcp-tools-boilerplate.git
cd agentforge

2.后端设置

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Configure environment
cp .env.example .env
# Edit .env and add your OPENAI_API_KEY

3.前端设置

cd frontend
npm install

4.为代码库(RAG)编制索引

通过索引代码库使代理具有自我意识:

# From root directory
source venv/bin/activate
python scripts/index_codebase.py

5.运行一切

您可以单独运行组件:

后端:

uvicorn main:app --reload --port 8000

前端:

cd frontend
npm run dev

访问 http://localhost:5173 与您的经纪人聊天!

📂 项目结构

  • langraph/:核心代理逻辑,包括V2多代理编排器(agent_v2.py).
  • rag_v2/:先进的RAG管道和 语义缓存管理器.
  • routers/:FastAPI路由,包括新的 RLHF反馈API.
  • mcp_servers/:模型上下文协议服务器(搜索、SQLite)。
  • guardrails/:输入/输出安全检查(PII、毒性、幻觉)。
  • frontend/:使用TailwindCSS进行反应应用程序。
  • tools/:自定义工具(内存、联系人)。

🛠️ 定制

添加新工具

  1. 在中定义您的工具 tools/my_tool.py 使用 @tool 装饰师。
  2. 添加到 ALL_TOOLStools/__init__.py.
  3. 代理将自动检测并使用它!

修改系统提示

编辑 langraph/agent.py 并更新 SYSTEM_PROMPT 变量来改变代理的个性和指示。

🤝 贡献

欢迎投稿!请阅读 CONTRIBUTING.md 了解详情。

📄 许可证

麻省理工学院许可证-请随时将此样板用于您自己的项目!

🚀 Agent V2:多代理编排器

该系统现在包括一个高级 多代理架构 (agent_v2.py)它用一组专门的人工智能工作人员取代了单节点代理。

🏗️ 建筑

编排器 计划执行并将任务委托给并行代理。这 合并器 综合他们的报告,以及 验证器 质量检查结果。

VerifierAgent -- Rejected --> CombinerAgent

OutputGuardrails --> FinalOutput

### ⚡ Key Features

1.  **Orchestrator**: The "Mastermind" that coordinates the workflow.
2.  **True Parallel Execution**:
    - **History Agent**: Summarizes conversation context.
    - **RAG Agent**: Retrieves code/docs from the vector database.
    - **Memory Agent**: Fetches user preferences and facts.
    - **Web Agent**: Searches the internet for real-time info.
    - _All these run simultaneously for maximum speed._
3.  **Combiner Agent**: Synthesizes conflicting or distributed information into a single, cohesive answer.
4.  **Verifier Agent**: Acts as a QA Lead, critiquing the draft and requesting improvements if needed.
5.  **Streaming**: Manual orchestration allows real-time token streaming from the Combiner Agent to the UI.

## 🧠 Gen AI Best Practices

### ⚡ Semantic Caching (Latent Optimization)
To reduce costs and latency, the system implements **Semantic Caching** using Qdrant.
- **How it works**: Before querying the LLM, the system embeds the user's question and searches for similar past queries (Threshold: `0.70`).
- **Benefit**: If a similar question was asked before, the cached response is returned **instantly** (< 0.5s), avoiding expensive LLM calls.

### 🔄 RLHF Feedback Loop (Data Flywheel)
The system now supports **Reinforcement Learning from Human Feedback (RLHF)** data collection.
- **Feedback API**: `/feedback` endpoint allows users to rate responses (Thumbs Up/Down).
- **Storage**: Feedback is stored in the database (`Feedback` table) to be used for future fine-tuning or RAG evaluation.

目录标签

目录标签

AI代理Python全栈开发多代理系统本地部署语义缓存强化学习反馈知识检索

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP