explaingit

internlm/mindsearch

6,854JavaScriptAudience · developerComplexity · 4/5LicenseSetup · hard

TLDR

A self-hosted AI search system that breaks your question into sub-queries, searches the web with a real search engine, and synthesizes the results into a sourced answer, open-source alternative to Perplexity.

Mindmap

mindmap
  root((MindSearch))
    What it does
      AI-powered search
      Multi-source synthesis
      Sub-question planning
    Architecture
      Planner agent
      Searcher agents
      Parallel processing
    Search engines
      DuckDuckGo free
      Google Bing Brave
    Front ends
      React web app
      Gradio Streamlit
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Self-host a Perplexity-style search assistant that uses DuckDuckGo for free without an API key.

USE CASE 2

Build a research tool that automatically decomposes a complex question and synthesizes answers from multiple web sources.

USE CASE 3

Connect MindSearch to GPT-4 or InternLM and choose your preferred front end, React, Gradio, or Streamlit.

Tech stack

JavaScriptPythonReactGradioStreamlit

Getting it running

Difficulty · hard Time to first run · 1h+

Requires API keys for the language model and optionally the search engine, multiple backend services must be configured and started.

Use freely in any project, including commercial ones, as long as you include the Apache 2.0 license notice.

In plain English

MindSearch is an open-source AI-powered search system that you can run yourself. Instead of typing a query into a search engine and getting a list of links, MindSearch takes your question, breaks it into multiple sub-questions, searches the web for each one using a real search engine, and then synthesizes the results into a coherent answer. The goal is to give answers that draw on many sources and reflect deeper reasoning about a question rather than just matching keywords. The system uses a multi-agent approach, meaning it runs several AI processes in parallel. One agent acts as a planner, deciding what to look up and in what order. Others act as searchers, fetching results from the web. This is similar in concept to services like Perplexity, which also answer questions by combining web search with a language model, but MindSearch is designed to be self-hosted and configurable. To set it up, you install the Python dependencies, configure environment variables including your API keys, and start a backend server. For the search step, MindSearch supports several search engines: DuckDuckGo (no API key required), Google, Bing, Brave, and Tencent. For the language model step, it can use InternLM's own models or GPT-4. The front end can be a React web app, a Gradio interface, or a Streamlit interface. The project comes with a research paper (arxiv.org/abs/2407.20183) describing the approach. It is developed by the InternLM team at the Shanghai AI Laboratory and is open source under the Apache 2.0 license. A live demo is available through the InternLM platform. The codebase also links to companion projects including Lagent, a framework for building other AI agent applications.

Copy-paste prompts

Prompt 1
How do I set up MindSearch locally with DuckDuckGo as the search backend and GPT-4 as the language model?
Prompt 2
I want to run MindSearch with the React front end. What steps start the backend server and connect it to the UI?
Prompt 3
How does MindSearch split a question into sub-queries, and can I control the number of search steps it takes?
Prompt 4
How do I switch MindSearch from GPT-4 to InternLM own model, and which environment variables do I need to set?
Open on GitHub → Explain another repo

← internlm on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.