[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-langchain-ai--deep_research_from_scratch":3,"tool-langchain-ai--deep_research_from_scratch":61},[4,18,26,36,44,52],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",144730,2,"2026-04-07T23:26:32",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,"2026-04-06T11:32:50",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":53,"name":54,"github_repo":55,"description_zh":56,"stars":57,"difficulty_score":10,"last_commit_at":58,"category_tags":59,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,60],"视频",{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":65,"owner_location":65,"owner_email":77,"owner_twitter":74,"owner_website":78,"owner_url":79,"languages":80,"stars":89,"forks":90,"last_commit_at":91,"license":65,"difficulty_score":32,"env_os":92,"env_gpu":93,"env_ram":93,"env_deps":94,"category_tags":105,"github_topics":65,"view_count":32,"oss_zip_url":65,"oss_zip_packed_at":65,"status":17,"created_at":106,"updated_at":107,"faqs":108,"releases":109},5278,"langchain-ai\u002Fdeep_research_from_scratch","deep_research_from_scratch",null,"deep_research_from_scratch 是一个由 LangChain 团队打造的开源项目，旨在手把手教你从零构建一个具备“深度研究”能力的 AI 智能体系统。面对 OpenAI、Anthropic 等巨头推出的深度研究产品，该项目通过透明的代码实现，让用户能够自主搭建类似的分析引擎。\n\n它主要解决了复杂调研任务中策略不确定的难题。传统的自动化脚本难以应对开放式的探索需求，而 deep_research_from_scratch 利用智能体（Agent）技术，将研究过程拆解为“明确范围、执行调研、撰写报告”三个灵活阶段。系统能根据中间搜索结果动态调整后续策略，从而生成内容详实、来源可靠的综合研究报告。\n\n这款工具特别适合开发者、AI 研究人员以及希望深入理解大模型应用架构的技术爱好者使用。它不仅是一个可运行的原型，更是一套完整的教学教程，包含五个逐步深入的笔记本，引导用户亲手实现从用户意图澄清到最终报告生成的全流程。\n\n其核心技术亮点在于高度的可配置性与模块化设计。用户可以自由替换底层大模型（支持 OpenAI、Anthropic 等）、集成自定义搜索工具（如 Tavily","deep_research_from_scratch 是一个由 LangChain 团队打造的开源项目，旨在手把手教你从零构建一个具备“深度研究”能力的 AI 智能体系统。面对 OpenAI、Anthropic 等巨头推出的深度研究产品，该项目通过透明的代码实现，让用户能够自主搭建类似的分析引擎。\n\n它主要解决了复杂调研任务中策略不确定的难题。传统的自动化脚本难以应对开放式的探索需求，而 deep_research_from_scratch 利用智能体（Agent）技术，将研究过程拆解为“明确范围、执行调研、撰写报告”三个灵活阶段。系统能根据中间搜索结果动态调整后续策略，从而生成内容详实、来源可靠的综合研究报告。\n\n这款工具特别适合开发者、AI 研究人员以及希望深入理解大模型应用架构的技术爱好者使用。它不仅是一个可运行的原型，更是一套完整的教学教程，包含五个逐步深入的笔记本，引导用户亲手实现从用户意图澄清到最终报告生成的全流程。\n\n其核心技术亮点在于高度的可配置性与模块化设计。用户可以自由替换底层大模型（支持 OpenAI、Anthropic 等）、集成自定义搜索工具（如 Tavily），甚至接入 MCP 服务器。此外，项目基于 LangGraph 构建，充分利用了 Python 3.11+ 的特性，为构建复杂的多智能体工作流提供了清晰、可扩展的代码范本。","# 🧱 Deep Research From Scratch \n\nDeep research has broken out as one of the most popular agent applications. [OpenAI](https:\u002F\u002Fopenai.com\u002Findex\u002Fintroducing-deep-research\u002F), [Anthropic](https:\u002F\u002Fwww.anthropic.com\u002Fengineering\u002Fbuilt-multi-agent-research-system), [Perplexity](https:\u002F\u002Fwww.perplexity.ai\u002Fhub\u002Fblog\u002Fintroducing-perplexity-deep-research), and [Google](https:\u002F\u002Fgemini.google\u002Foverview\u002Fdeep-research\u002F?hl=en) all have deep research products that produce comprehensive reports using [various sources](https:\u002F\u002Fwww.anthropic.com\u002Fnews\u002Fresearch) of context. There are also many [open](https:\u002F\u002Fhuggingface.co\u002Fblog\u002Fopen-deep-research) [source](https:\u002F\u002Fgithub.com\u002Fgoogle-gemini\u002Fgemini-fullstack-langgraph-quickstart) implementations. We built an [open deep researcher](https:\u002F\u002Fgithub.com\u002Flangchain-ai\u002Fopen_deep_research) that is simple and configurable, allowing users to bring their own models, search tools, and MCP servers. In this repo, we'll build a deep researcher from scratch! Here is a map of the major pieces that we will build:\n\n![overview](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Flangchain-ai_deep_research_from_scratch_readme_45354578b965.png)\n\n## 🚀 Quickstart \n\n### Prerequisites\n\n- **Node.js and npx** (required for MCP server in notebook 3):\n```bash\n# Install Node.js (includes npx)\n# On macOS with Homebrew:\nbrew install node\n\n# On Ubuntu\u002FDebian:\ncurl -fsSL https:\u002F\u002Fdeb.nodesource.com\u002Fsetup_lts.x | sudo -E bash -\nsudo apt-get install -y nodejs\n\n# Verify installation:\nnode --version\nnpx --version\n```\n\n- Ensure you're using Python 3.11 or later.\n- This version is required for optimal compatibility with LangGraph.\n```bash\npython3 --version\n```\n- [uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F) package manager\n```bash\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh\n# Update PATH to use the new uv version\nexport PATH=\"\u002FUsers\u002F$USER\u002F.local\u002Fbin:$PATH\"\n```\n\n### Installation\n\n1. Clone the repository:\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Flangchain-ai\u002Fdeep_research_from_scratch\ncd deep_research_from_scratch\n```\n\n2. Install the package and dependencies (this automatically creates and manages the virtual environment):\n```bash\nuv sync\n```\n\n3. Create a `.env` file in the project root with your API keys:\n```bash\n# Create .env file\ntouch .env\n```\n\nAdd your API keys to the `.env` file:\n```env\n# Required for research agents with external search\nTAVILY_API_KEY=your_tavily_api_key_here\n\n# Required for model usage\nOPENAI_API_KEY=your_openai_api_key_here\nANTHROPIC_API_KEY=your_anthropic_api_key_here\n\n# Optional: For evaluation and tracing\nLANGSMITH_API_KEY=your_langsmith_api_key_here\nLANGSMITH_TRACING=true\nLANGSMITH_PROJECT=deep_research_from_scratch\n```\n\n4. Run notebooks or code using uv:\n```bash\n# Run Jupyter notebooks directly\nuv run jupyter notebook\n\n# Or activate the virtual environment if preferred\nsource .venv\u002Fbin\u002Factivate  # On Windows: .venv\\Scripts\\activate\njupyter notebook\n```\n\n## Background \n\nResearch is an open‑ended task; the best strategy to answer a user request can’t be easily known in advance. Requests can require different research strategies and varying levels of search depth. Consider this request. \n\n[Agents](https:\u002F\u002Flangchain-ai.github.io\u002Flanggraph\u002Ftutorials\u002Fworkflows\u002F#agent) are well suited to research because they can flexibly apply different strategies, using intermediate results to guide their exploration. Open deep research uses an agent to conduct research as part of a three step process:\n\n1. **Scope** – clarify research scope\n2. **Research** – perform research\n3. **Write** – produce the final report\n\n## 📝 Organization \n\nThis repo contains 5 tutorial notebooks that build a deep research system from scratch:\n\n### 📚 Tutorial Notebooks\n\n#### 1. User Clarification and Brief Generation (`notebooks\u002F1_scoping.ipynb`)\n**Purpose**: Clarify research scope and transform user input into structured research briefs\n\n**Key Concepts**:\n- **User Clarification**: Determines if additional context is needed from the user using structured output\n- **Brief Generation**: Transforms conversations into detailed research questions\n- **LangGraph Commands**: Using Command system for flow control and state updates\n- **Structured Output**: Pydantic schemas for reliable decision making\n\n**Implementation Highlights**:\n- Two-step workflow: clarification → brief generation\n- Structured output models (`ClarifyWithUser`, `ResearchQuestion`) to prevent hallucination\n- Conditional routing based on clarification needs\n- Date-aware prompts for context-sensitive research\n\n**What You'll Learn**: State management, structured output patterns, conditional routing\n\n---\n\n#### 2. Research Agent with Custom Tools (`notebooks\u002F2_research_agent.ipynb`)\n**Purpose**: Build an iterative research agent using external search tools\n\n**Key Concepts**:\n- **Agent Architecture**: LLM decision node + tool execution node pattern\n- **Sequential Tool Execution**: Reliable synchronous tool execution\n- **Search Integration**: Tavily search with content summarization\n- **Tool Execution**: ReAct-style agent loop with tool calling\n\n**Implementation Highlights**:\n- Synchronous tool execution for reliability and simplicity\n- Content summarization to compress search results\n- Iterative research loop with conditional routing\n- Rich prompt engineering for comprehensive research\n\n**What You'll Learn**: Agent patterns, tool integration, search optimization, research workflow design\n\n---\n\n#### 3. Research Agent with MCP (`notebooks\u002F3_research_agent_mcp.ipynb`)\n**Purpose**: Integrate Model Context Protocol (MCP) servers as research tools\n\n**Key Concepts**:\n- **Model Context Protocol**: Standardized protocol for AI tool access\n- **MCP Architecture**: Client-server communication via stdio\u002FHTTP\n- **LangChain MCP Adapters**: Seamless integration of MCP servers as LangChain tools\n- **Local vs Remote MCP**: Understanding transport mechanisms\n\n**Implementation Highlights**:\n- `MultiServerMCPClient` for managing MCP servers\n- Configuration-driven server setup (filesystem example)\n- Rich formatting for tool output display\n- Async tool execution required by MCP protocol (no nested event loops needed)\n\n**What You'll Learn**: MCP integration, client-server architecture, protocol-based tool access\n\n---\n\n#### 4. Research Supervisor (`notebooks\u002F4_research_supervisor.ipynb`)\n**Purpose**: Multi-agent coordination for complex research tasks\n\n**Key Concepts**:\n- **Supervisor Pattern**: Coordination agent + worker agents\n- **Parallel Research**: Concurrent research agents for independent topics using parallel tool calls\n- **Research Delegation**: Structured tools for task assignment\n- **Context Isolation**: Separate context windows for different research topics\n\n**Implementation Highlights**:\n- Two-node supervisor pattern (`supervisor` + `supervisor_tools`)\n- Parallel research execution using `asyncio.gather()` for true concurrency\n- Structured tools (`ConductResearch`, `ResearchComplete`) for delegation\n- Enhanced prompts with parallel research instructions\n- Comprehensive documentation of research aggregation patterns\n\n**What You'll Learn**: Multi-agent patterns, parallel processing, research coordination, async orchestration\n\n---\n\n#### 5. Full Multi-Agent Research System (`notebooks\u002F5_full_agent.ipynb`)\n**Purpose**: Complete end-to-end research system integrating all components\n\n**Key Concepts**:\n- **Three-Phase Architecture**: Scope → Research → Write\n- **System Integration**: Combining scoping, multi-agent research, and report generation\n- **State Management**: Complex state flow across subgraphs\n- **End-to-End Workflow**: From user input to final research report\n\n**Implementation Highlights**:\n- Complete workflow integration with proper state transitions\n- Supervisor and researcher subgraphs with output schemas\n- Final report generation with research synthesis\n- Thread-based conversation management for clarification\n\n**What You'll Learn**: System architecture, subgraph composition, end-to-end workflows\n\n---\n\n### 🎯 Key Learning Outcomes\n\n- **Structured Output**: Using Pydantic schemas for reliable AI decision making\n- **Async Orchestration**: Strategic use of async patterns for parallel coordination vs synchronous simplicity\n- **Agent Patterns**: ReAct loops, supervisor patterns, multi-agent coordination\n- **Search Integration**: External APIs, MCP servers, content processing\n- **Workflow Design**: LangGraph patterns for complex multi-step processes\n- **State Management**: Complex state flows across subgraphs and nodes\n- **Protocol Integration**: MCP servers and tool ecosystems\n\nEach notebook builds on the previous concepts, culminating in a production-ready deep research system that can handle complex, multi-faceted research queries with intelligent scoping and coordinated execution. \n","# 🧱 从零开始的深度研究\n\n深度研究已成为最受欢迎的智能体应用之一。[OpenAI](https:\u002F\u002Fopenai.com\u002Findex\u002Fintroducing-deep-research\u002F)、[Anthropic](https:\u002F\u002Fwww.anthropic.com\u002Fengineering\u002Fbuilt-multi-agent-research-system)、[Perplexity](https:\u002F\u002Fwww.perplexity.ai\u002Fhub\u002Fblog\u002Fintroducing-perplexity-deep-research) 和 [Google](https:\u002F\u002Fgemini.google\u002Foverview\u002Fdeep-research\u002F?hl=en) 都推出了深度研究产品，这些产品能够利用[多种来源](https:\u002F\u002Fwww.anthropic.com\u002Fnews\u002Fresearch)的上下文信息生成全面的报告。此外，还有许多[开源](https:\u002F\u002Fhuggingface.co\u002Fblog\u002Fopen-deep-research)的[实现](https:\u002F\u002Fgithub.com\u002Fgoogle-gemini\u002Fgemini-fullstack-langgraph-quickstart)可供使用。我们构建了一个简单且可配置的[开源深度研究员](https:\u002F\u002Fgithub.com\u002Flangchain-ai\u002Fopen_deep_research)，允许用户引入自己的模型、搜索工具和 MCP 服务器。在本仓库中，我们将从头开始构建一个深度研究员！以下是我们将要构建的主要模块图：\n\n![overview](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Flangchain-ai_deep_research_from_scratch_readme_45354578b965.png)\n\n## 🚀 快速入门 \n\n### 前置条件\n\n- **Node.js 和 npx**（第 3 个笔记本中的 MCP 服务器需要）：\n```bash\n# 安装 Node.js（包含 npx）\n# 在 macOS 上使用 Homebrew：\nbrew install node\n\n# 在 Ubuntu\u002FDebian 上：\ncurl -fsSL https:\u002F\u002Fdeb.nodesource.com\u002Fsetup_lts.x | sudo -E bash -\nsudo apt-get install -y nodejs\n\n# 验证安装：\nnode --version\nnpx --version\n```\n\n- 确保您使用的是 Python 3.11 或更高版本。\n- 此版本是与 LangGraph 最佳兼容所必需的。\n```bash\npython3 --version\n```\n- [uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F) 包管理器\n```bash\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh\n# 更新 PATH 以使用新的 uv 版本\nexport PATH=\"\u002FUsers\u002F$USER\u002F.local\u002Fbin:$PATH\"\n```\n\n### 安装\n\n1. 克隆仓库：\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Flangchain-ai\u002Fdeep_research_from_scratch\ncd deep_research_from_scratch\n```\n\n2. 安装软件包及依赖项（此操作会自动创建并管理虚拟环境）：\n```bash\nuv sync\n```\n\n3. 在项目根目录下创建 `.env` 文件，并填入您的 API 密钥：\n```bash\n# 创建 .env 文件\ntouch .env\n```\n\n将您的 API 密钥添加到 `.env` 文件中：\n```env\n# 用于具有外部搜索功能的研究智能体\nTAVILY_API_KEY=your_tavily_api_key_here\n\n# 用于模型调用\nOPENAI_API_KEY=your_openai_api_key_here\nANTHROPIC_API_KEY=your_anthropic_api_key_here\n\n# 可选：用于评估和追踪\nLANGSMITH_API_KEY=your_langsmith_api_key_here\nLANGSMITH_TRACING=true\nLANGSMITH_PROJECT=deep_research_from_scratch\n```\n\n4. 使用 uv 运行笔记本或代码：\n```bash\n# 直接运行 Jupyter 笔记本\nuv run jupyter notebook\n\n# 或者如果您更喜欢激活虚拟环境\nsource .venv\u002Fbin\u002Factivate  # Windows 上：.venv\\Scripts\\activate\njupyter notebook\n```\n\n## 背景 \n\n研究是一项开放性的任务；很难提前确定回答用户请求的最佳策略。不同的请求可能需要不同的研究策略以及不同程度的搜索深度。请考虑以下请求。\n\n[智能体](https:\u002F\u002Flangchain-ai.github.io\u002Flanggraph\u002Ftutorials\u002Fworkflows\u002F#agent)非常适合进行研究，因为它们能够灵活地应用不同的策略，并利用中间结果来指导探索过程。开源深度研究系统采用智能体，通过三步流程来进行研究：\n\n1. **界定范围** – 明确研究范围\n2. **研究** – 执行研究\n3. **撰写** – 生成最终报告\n\n## 📝 组织结构 \n\n本仓库包含 5 个教程笔记本，将从零开始构建一个深度研究系统：\n\n### 📚 教程笔记本\n\n#### 1. 用户澄清与简报生成（`notebooks\u002F1_scoping.ipynb`）\n**目的**：明确研究范围，并将用户输入转化为结构化的研究简报。\n\n**关键概念**：\n- **用户澄清**：通过结构化输出判断是否需要用户补充更多上下文。\n- **简报生成**：将对话内容转化为详细的研究问题。\n- **LangGraph 命令**：利用命令系统进行流程控制和状态更新。\n- **结构化输出**：使用 Pydantic 模型实现可靠决策。\n\n**实现亮点**：\n- 两步工作流：澄清 → 简报生成。\n- 使用结构化输出模型（`ClarifyWithUser`、`ResearchQuestion`）以防止幻觉。\n- 根据澄清需求进行条件路由。\n- 基于日期的提示词，支持上下文敏感的研究。\n\n**学习要点**：状态管理、结构化输出模式、条件路由。\n\n---\n\n#### 2. 带有自定义工具的研究代理（`notebooks\u002F2_research_agent.ipynb`）\n**目的**：构建一个使用外部搜索工具的迭代式研究代理。\n\n**关键概念**：\n- **代理架构**：LLM 决策节点 + 工具执行节点模式。\n- **顺序工具执行**：可靠且同步的工具执行机制。\n- **搜索集成**：Tavily 搜索结合内容摘要。\n- **工具执行**：基于 ReAct 风格的代理循环，支持工具调用。\n\n**实现亮点**：\n- 同步工具执行，确保可靠性和简洁性。\n- 内容摘要用于压缩搜索结果。\n- 迭代式研究循环，配合条件路由。\n- 丰富的提示工程设计，支持全面的研究任务。\n\n**学习要点**：代理模式、工具集成、搜索优化、研究工作流设计。\n\n---\n\n#### 3. 带有 MCP 的研究代理（`notebooks\u002F3_research_agent_mcp.ipynb`）\n**目的**：将模型上下文协议（MCP）服务器作为研究工具集成进来。\n\n**关键概念**：\n- **模型上下文协议**：AI 工具访问的标准化协议。\n- **MCP 架构**：通过 stdio\u002FHTTP 实现客户端-服务器通信。\n- **LangChain MCP 适配器**：无缝将 MCP 服务器集成为 LangChain 工具。\n- **本地与远程 MCP**：理解不同的传输机制。\n\n**实现亮点**：\n- 使用 `MultiServerMCPClient` 管理 MCP 服务器。\n- 基于配置的服务器设置（如文件系统示例）。\n- 丰富的格式化设计，用于展示工具输出。\n- 符合 MCP 协议要求的异步工具执行（无需嵌套事件循环）。\n\n**学习要点**：MCP 集成、客户端-服务器架构、基于协议的工具接入。\n\n---\n\n#### 4. 研究主管（`notebooks\u002F4_research_supervisor.ipynb`）\n**目的**：通过多智能体协作完成复杂的研究任务。\n\n**关键概念**：\n- **主管模式**：协调代理 + 工作代理。\n- **并行研究**：利用并行工具调用，同时开展多个独立主题的研究。\n- **研究委托**：通过结构化工具进行任务分配。\n- **上下文隔离**：为不同研究主题维护独立的上下文窗口。\n\n**实现亮点**：\n- 采用双节点主管模式（`supervisor` + `supervisor_tools`）。\n- 使用 `asyncio.gather()` 实现真正的并行执行。\n- 通过结构化工具（`ConductResearch`、`ResearchComplete`）进行任务委派。\n- 增强型提示词，包含并行研究指令。\n- 详尽记录研究结果的聚合模式。\n\n**学习要点**：多智能体模式、并行处理、研究协调、异步编排。\n\n---\n\n#### 5. 完整的多智能体研究系统（`notebooks\u002F5_full_agent.ipynb`）\n**目的**：构建一个整合所有组件的端到端研究系统。\n\n**关键概念**：\n- **三阶段架构**：范围界定 → 研究执行 → 报告撰写。\n- **系统集成**：将范围界定、多智能体研究和报告生成有机结合。\n- **状态管理**：跨子图的复杂状态流转。\n- **端到端工作流**：从用户输入到最终研究报告。\n\n**实现亮点**：\n- 完整的工作流集成，确保状态的正确过渡。\n- 包含输出模式的主管与研究人员子图。\n- 最终报告生成及研究结果综合。\n- 基于线程的对话管理，用于澄清环节。\n\n**学习要点**：系统架构、子图组合、端到端工作流。\n\n---\n\n### 🎯 主要学习成果\n\n- **结构化输出**：利用 Pydantic 模型实现可靠的 AI 决策。\n- **异步编排**：合理运用异步模式，在并行协调与同步简洁之间取得平衡。\n- **代理模式**：ReAct 循环、主管模式、多智能体协作。\n- **搜索集成**：外部 API、MCP 服务器、内容处理。\n- **工作流设计**：LangGraph 模式适用于复杂的多步骤流程。\n- **状态管理**：跨子图和节点的复杂状态流转。\n- **协议集成**：MCP 服务器及其他工具生态系统的接入。\n\n每个笔记本都在前一节的基础上逐步深入，最终形成一套可投入生产的深度研究系统，能够智能地界定范围并协调执行，从而高效应对复杂、多维度的研究需求。","# Deep Research From Scratch 快速上手指南\n\n本指南帮助开发者从零开始构建一个可配置的深度研究智能体系统。该系统支持自定义模型、搜索工具及 MCP 服务器，能够自动完成“明确范围 -> 执行研究 -> 撰写报告”的全流程。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n### 系统要求\n- **Python**: 版本 3.11 或更高（LangGraph 最佳兼容性要求）。\n- **Node.js**: 必须安装（包含 `npx`），用于运行笔记本 3 中的 MCP 服务器。\n\n### 前置依赖安装\n\n**1. 安装 Node.js**\n*   **macOS (使用 Homebrew):**\n    ```bash\n    brew install node\n    ```\n*   **Ubuntu\u002FDebian:**\n    ```bash\n    curl -fsSL https:\u002F\u002Fdeb.nodesource.com\u002Fsetup_lts.x | sudo -E bash -\n    sudo apt-get install -y nodejs\n    ```\n*   **验证安装:**\n    ```bash\n    node --version\n    npx --version\n    ```\n\n**2. 安装 uv 包管理器**\n本项目推荐使用 `uv` 进行依赖管理和虚拟环境创建。\n```bash\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh\n# 更新 PATH 以使用新安装的 uv (根据实际输出调整路径，通常为 ~\u002F.local\u002Fbin)\nexport PATH=\"\u002FUsers\u002F$USER\u002F.local\u002Fbin:$PATH\"\n```\n\n**3. 验证 Python 版本**\n```bash\npython3 --version\n# 确保输出为 Python 3.11.x 或更高\n```\n\n## 安装步骤\n\n**1. 克隆仓库**\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Flangchain-ai\u002Fdeep_research_from_scratch\ncd deep_research_from_scratch\n```\n\n**2. 同步依赖**\n使用 `uv` 自动创建并激活虚拟环境，同时安装所有必要依赖：\n```bash\nuv sync\n```\n\n**3. 配置 API 密钥**\n在项目根目录创建 `.env` 文件：\n```bash\ntouch .env\n```\n\n编辑 `.env` 文件，填入您的 API 密钥：\n```env\n# 必需：用于外部搜索代理\nTAVILY_API_KEY=your_tavily_api_key_here\n\n# 必需：用于模型调用 (任选其一或全部配置)\nOPENAI_API_KEY=your_openai_api_key_here\nANTHROPIC_API_KEY=your_anthropic_api_key_here\n\n# 可选：用于评估和追踪 (LangSmith)\nLANGSMITH_API_KEY=your_langsmith_api_key_here\nLANGSMITH_TRACING=true\nLANGSMITH_PROJECT=deep_research_from_scratch\n```\n\n## 基本使用\n\n本项目通过一系列 Jupyter Notebook 教程逐步构建系统。最简单的启动方式是直接运行交互式笔记本环境。\n\n**1. 启动 Jupyter Notebook**\n使用 `uv run` 直接在配置好的环境中启动：\n```bash\nuv run jupyter notebook\n```\n\n或者手动激活虚拟环境后启动：\n```bash\n# Linux\u002FmacOS\nsource .venv\u002Fbin\u002Factivate\n\n# Windows\n.venv\\Scripts\\activate\n\njupyter notebook\n```\n\n**2. 开始第一个教程**\n在浏览器打开的 Jupyter 界面中，依次进入 `notebooks\u002F` 目录，从 **`1_scoping.ipynb`** 开始执行。\n*   **步骤 1 (`1_scoping.ipynb`)**: 学习如何将用户模糊的请求转化为结构化的研究简报。\n*   **步骤 2 (`2_research_agent.ipynb`)**: 构建带有搜索工具的研究代理。\n*   **后续步骤**: 逐步集成 MCP 服务器、多代理协作，最终在 `5_full_agent.ipynb` 中运行完整的端到端研究系统。\n\n> **提示**: 每个笔记本都包含详细的代码单元格和解释，按顺序执行即可体验完整的深度研究工作流。","某科技咨询公司的分析师需要在 24 小时内为一家初创企业输出一份关于“全球固态电池供应链最新格局”的深度调研报告，以支持其下一轮融资决策。\n\n### 没有 deep_research_from_scratch 时\n- **信息搜集碎片化**：分析师需手动在多个搜索引擎和数据库中反复切换，难以系统性地覆盖学术论文、行业新闻及专利数据，极易遗漏关键隐性信息。\n- **策略调整滞后**：面对模糊的初始需求，无法动态调整搜索深度或方向，往往等到撰写阶段才发现核心数据缺失，导致返工重来。\n- **报告产出低效**：从整理零散笔记到构建逻辑严密的最终报告，大量时间耗费在格式调整和人工综述上，难以在短时间内交付高质量成果。\n- **模型依赖固化**：若想更换更擅长推理的大模型或定制专属搜索工具，需要重构整套代码流程，技术门槛高且灵活性差。\n\n### 使用 deep_research_from_scratch 后\n- **全源自动聚合**：deep_research_from_scratch 自主调用 Tavily 等搜索工具，并行抓取多源上下文，自动构建包含技术细节与市场数据的完整知识图谱。\n- **动态研究闭环**：内置的智能体遵循“明确范围 - 执行研究 - 撰写报告”三步法，能根据中间结果实时修正搜索策略，确保研究方向始终精准对齐目标。\n- **一键生成研报**：系统自动将结构化简报转化为逻辑连贯的深度文章，分析师仅需专注于最终观点的校验，交付效率提升数倍。\n- **架构灵活可控**：支持通过配置文件无缝切换 OpenAI 或 Anthropic 等不同大模型，并可轻松接入自定义 MCP 服务器，完美适配公司私有数据源。\n\ndeep_research_from_scratch 将原本耗时数天的手工调研压缩为自动化智能流程，让专业团队能专注于高价值的战略洞察而非繁琐的信息搬运。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Flangchain-ai_deep_research_from_scratch_996a3c74.png","langchain-ai","LangChain","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Flangchain-ai_8e6aaeef.png","","support@langchain.dev","https:\u002F\u002Fwww.langchain.com","https:\u002F\u002Fgithub.com\u002Flangchain-ai",[81,85],{"name":82,"color":83,"percentage":84},"Jupyter Notebook","#DA5B0B",96.7,{"name":86,"color":87,"percentage":88},"Python","#3572A5",3.3,698,229,"2026-04-07T03:05:47","macOS, Linux, Windows","未说明",{"notes":95,"python":96,"dependencies":97},"1. 必须安装 Node.js (包含 npx)，特别是运行第 3 个笔记本中的 MCP 服务器时必需。\n2. 推荐使用 uv 作为包管理器来创建和管理虚拟环境。\n3. 需要配置 .env 文件，填入 Tavily (搜索)、OpenAI 或 Anthropic (模型) 的 API Key，可选配置 LangSmith 用于追踪。\n4. 项目主要通过 Jupyter Notebook 运行，需使用 'uv run jupyter notebook' 启动。","3.11+",[98,99,100,101,102,103,104],"uv","langgraph","jupyter","pydantic","tavily-python","openai","anthropic",[35,13],"2026-03-27T02:49:30.150509","2026-04-08T07:44:01.177148",[],[]]