MCPcopy
hub / github.com/InternLM/MindSearch

github.com/InternLM/MindSearch @v0.1.0 sqlite

repository ↗ · DeepWiki ↗ · release v0.1.0 ↗
114 symbols 432 edges 31 files 3 documented · 3%
README

🌐 Project Page | 📃 Paper | 🤗 Hugging Face Space| 💻 ModelScope

English | 简体中文

https://github.com/user-attachments/assets/b4312e9c-5b40-43e5-8c69-929c373e4965

✨ MindSearch: Mimicking Human Minds Elicits Deep AI Searcher

MindSearch 是一个开源的 AI 搜索引擎框架,具有与 Perplexity.ai Pro 相同的性能。您可以轻松部署它来构建您自己的搜索引擎,可以使用闭源 LLM(如 GPT、Claude)或开源 LLM(InternLM2.5 系列模型经过专门优化,能够在 MindSearch 框架中提供卓越的性能;其他开源模型没做过具体测试)。其拥有以下特性:

  • 🤔 任何想知道的问题:MindSearch 通过搜索解决你在生活中遇到的各种问题
  • 📚 深度知识探索:MindSearch 通过数百网页的浏览,提供更广泛、深层次的答案
  • 🔍 透明的解决方案路径:MindSearch 提供了思考路径、搜索关键词等完整的内容,提高回复的可信度和可用性。
  • 💻 多种用户界面:为用户提供各种接口,包括 React、Gradio、Streamlit 和本地调试。根据需要选择任意类型。
  • 🧠 动态图构建过程:MindSearch 将用户查询分解为图中的子问题节点,并根据 WebSearcher 的搜索结果逐步扩展图。

⚡️ MindSearch VS 其他 AI 搜索引擎

在深度、广度和生成响应的准确性三个方面,对 ChatGPT-Web、Perplexity.ai(Pro)和 MindSearch 的表现进行比较。评估结果基于 100 个由人类专家精心设计的现实问题,并由 5 位专家进行评分*。

  • 所有实验均在 2024 年 7 月 7 日之前完成。

⚽️ 构建您自己的 MindSearch

步骤1: 依赖安装

pip install -r requirements.txt

步骤2: 启动 MindSearch API

启动 FastAPI 服务器

python -m mindsearch.app --lang en --model_format internlm_server --search_engine DuckDuckGoSearch
  • --lang: 模型的语言,en 为英语,cn 为中文。
  • --model_format: 模型的格式。
  • internlm_server 为 InternLM2.5-7b-chat 本地服务器。
  • gpt4 为 GPT4。 如果您想使用其他模型,请修改 models
  • --search_engine: 搜索引擎。
  • DuckDuckGoSearch 为 DuckDuckGo 搜索引擎。
  • BingSearch 为 Bing 搜索引擎。
  • BraveSearch 为 Brave 搜索引擎。
  • GoogleSearch 为 Google Serper 搜索引擎。

请将网页搜索引擎 API 密钥设置为 WEB_SEARCH_API_KEY 环境变量,如果使用的是 DuckDuckGo,则无需设置。

步骤3: 启动 MindSearch 前端

提供以下几种前端界面:

  • React
# 安装 Node.js 和 npm
# 对于 Ubuntu
sudo apt install nodejs npm
# 对于 Windows
# 从 https://nodejs.org/zh-cn/download/prebuilt-installer 下载

cd frontend/React
npm install
npm start

更多细节请参考 React

  • Gradio
python frontend/mindsearch_gradio.py
  • Streamlit
streamlit run frontend/mindsearch_streamlit.py

🐞 本地调试

python mindsearch/terminal.py

📝 许可证

该项目按照 Apache 2.0 许可证 发行。

学术引用

如果此项目对您的研究有帮助,请参考如下方式进行引用:

@article{chen2024mindsearch,
  title={MindSearch: Mimicking Human Minds Elicits Deep AI Searcher},
  author={Chen, Zehui and Liu, Kuikun and Wang, Qiuchen and Liu, Jiangning and Zhang, Wenwei and Chen, Kai and Zhao, Feng},
  journal={arXiv preprint arXiv:2407.20183},
  year={2024}
}

相关项目

关注我们其他在大语言模型上的一些探索,主要为LLM智能体方向。

  • Lagent: 一个轻便简洁的大语言模型智能体框架
  • AgentFLAN: 一套构建高质量智能体语料和训练模型的方法 (ACL 2024 Findings)
  • T-Eval: 一个细粒度评估LLM调用工具能力的评测及 (ACL 2024)

Extension points exported contracts — how you extend this code

ImportMetaEnv (Interface)
(no doc)
frontend/React/src/vite-env.d.ts
ImportMeta (Interface)
(no doc)
frontend/React/src/vite-env.d.ts
IProps (Interface)
(no doc)
frontend/React/src/components/chat-right/index.tsx
IProps (Interface)
(no doc)
frontend/React/src/components/answer/index.tsx
RouteItem (Interface)
(no doc)
frontend/React/src/routes/routes.tsx

Core symbols most depended-on inside this repo

t
called by 52
docker/msdl/i18n.py
replaceStr
called by 5
frontend/React/src/utils/tools.ts
stream_chat
called by 4
mindsearch/agent/mindsearch_agent.py
format
called by 3
mindsearch/agent/mindsearch_agent.py
ensure_dir
called by 3
docker/msdl/config.py
get_docker_command
called by 3
docker/msdl/docker_manager.py
stop_and_remove_containers
called by 3
docker/msdl/docker_manager.py
format_response
called by 2
frontend/mindsearch_gradio.py

Shape

Function 80
Method 22
Class 6
Interface 5
Route 1

Languages

Python68%
TypeScript32%

Modules by API surface

mindsearch/agent/mindsearch_agent.py24 symbols
frontend/React/src/pages/render/index.tsx13 symbols
docker/msdl/utils.py10 symbols
mindsearch/app.py9 symbols
frontend/mindsearch_streamlit.py7 symbols
frontend/React/src/components/chat-right/index.tsx7 symbols
frontend/mindsearch_gradio.py6 symbols
docker/msdl/docker_manager.py6 symbols
docker/msdl/i18n.py5 symbols
docker/msdl/__main__.py5 symbols
frontend/React/src/utils/tools.ts3 symbols
frontend/React/src/components/mind-map/index.tsx3 symbols

Dependencies from manifests, versioned

@antv/x62.18.1 · 1×
@babel/plugin-proposal-optional-chaining7.21.0 · 1×
@types/classnames2.3.1 · 1×
@types/js-cookie3.0.3 · 1×
@types/node18.15.11 · 1×
@types/react18.0.28 · 1×
@types/react-dom18.0.11 · 1×
@vitejs/plugin-legacy4.0.2 · 1×
@vitejs/plugin-react3.1.0 · 1×
antd5.18.3 · 1×
axios1.3.5 · 1×

For agents

$ claude mcp add MindSearch \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact