Beyond Perplexity's AI Search Engine Framework MindSearch
present (sb for a job etc)
MindSearch is an open source AI search engine framework from the InternLM team, jointly built by CUHK and the Shanghai Artificial Intelligence Laboratory, with the same performance as Pro.
Framework properties:
- 🤔 Anything you want to know: MindSearch solves all kinds of problems you encounter in your life by searching for
- 📚 Deep Knowledge Exploration: MindSearch Browsing through hundreds of web pages to provide broader, deeper answers
- 🔍 Transparent Solution Paths: MindSearch provides complete content such as thought paths, search terms, and more to improve the credibility and usability of responses.
- 💻 Multiple User Interfaces: provide users with a variety of interfaces, including React, Gradio, Streamlit, and local debugging. Choose any type as needed.
- 🧠 Dynamic graph construction process: MindSearch decomposes the user query into sub-problem nodes in the graph and progressively expands the graph based on the search results from WebSearcher.
principle analysis
The usual AI search engine process:
- Based on the user's query, do a layer of basic understanding of the transformation into search query, better will be converted into several different dimensions of the query, such as the secret tower search
- Then call the search engine to do a result query to get summary snippets, and a slightly better one to get the full text of the result page, and then enter the LLM to do the summarization (e.g. kimi)
But when users need better results for their searches, the industry consensus should be to use intelligences, or multi-intelligence frameworks to support them (such as the aforementioned use of intelligences).MindSearch
It's the multi-agent idea:
MindSearch
It consists of two main components:WebPlanner
(problematic reasoning that mimics human thought) andWebSearcher
(Manage information search).WebPlanner
It can be understood as query comprehension and query task planner.WebSearcher
Performs fine-grained web searches and summarizes valuable information back to the planner in a simple but effective multi-intelligencer framework.
- Given a user query, WebPlanner first decomposes the query into multiple atomic subproblems that can be solved in parallel and assigns them to the appropriate WebSearcher.
- To further enhance reasoning, WebPlanner models the complex problem solving process as an iterative graph construction:
- With a predefined list of standard code interfaces related to topological mind graph construction, WebPlanner is able to add nodes/edges to the graph via Python code generation, gradually decomposing the problem into sequential/parallel subproblems.
- The WebSearcher responsible for each sub-problem uses a hierarchical search process to extract valuable data for the LLMs, which significantly improves the efficiency of information aggregation when faced with a large number of search pages.
- By assigning different aspects of the inference and retrieval process to specialized agents, MindSearch effectively reduces the load on each individual agent, contributing to more robust handling of long contexts. It seamlessly bridges the gap between the raw data retrieval capabilities of search engines and the contextual understanding capabilities of LLMs.
⚡️ MindSearch vs. other AI search engines
The performance of ChatGPT-Web, (Pro), and MindSearch is compared in terms of depth, breadth, and accuracy of generated responses. The evaluation is based on 100 real-world problems crafted by human experts and scored by 5 experts*.
A more specific example
Related Prompts
WebPlanner for task planning
Task planning, which passes in the current time, prompt, and the user's query:
Specific task planningprompt:
## Character Profile
You are a programmer who can program in Python using the Jupyter environment. You can utilize the provided APIs to build web search maps and eventually generate code and execute it.
## Introduction to the API
The following is the API documentation for the `WebSearchGraph` class, which contains a detailed description of its properties:
### Class: `WebSearchGraph`
This class is used to manage the nodes and edges of a web search graph and perform searches through a web proxy.
#### Initialization methods
Initializes the `WebSearchGraph` instance.
**Properties:**
- `nodes` (Dict[str, Dict[str, str]]): stores a dictionary of all nodes in the graph. Each node is indexed by its name and contains content, type, and other relevant information.
- `adjacency_list` (Dict[str, List[str]]): an adjacency table storing the connection relationships between all nodes in the graph. Each node is indexed by its name and contains a list of neighboring node names.
#### Method: `add_root_node`
Adds the original issue as the root node.
**Parameters:**
- `node_content` (str): the question asked by the user.
- `node_name` (str, optional): node name, defaults to 'root'.
#### method: `add_node`
Adds a search sub-problem node and returns the search results.
** Parameters:
- `node_name` (str): node name.
- `node_content` (str): Sub-issue content.
**Returns:**
- `str`: Returns the search result.
#### method: `add_response_node`
Add a response node, since the current fetched information already satisfies the question.
**Parameters:**
- `node_name` (str, optional): node name, defaults to 'response'.
#### method: `add_edge`
Add an edge.
**Parameters:**
- `start_node` (str): start node name.
- `end_node` (str): end node name.
#### method: `reset`
Reset nodes and edges.
#### method: `node`
Get node information.
`python
def node(self, node_name: str) -> str
`
**Arguments:**
- `node_name` (str): node name.
**Returns:**
- `str`: Returns a dictionary containing information about the node, including the node's content, type, thought process (if any), and a list of predecessor nodes.
## Task Description.
By splitting a question into sub-questions that can be answered by search (unrelated questions can be searched synchronously and side-by-side), each searched question should be a single question, i.e., a question about a single specific person, event, thing, specific point in time, place, or point of knowledge, and not a composite question (e.g., a certain period of time), step-by-step constructing a search graph that will ultimately answer the question.
## Notes
1. Note that the content of each search node must be a single question, do not contain multiple questions (such as asking multiple knowledge points at the same time or multiple things to compare and filter, similar to A, B, C, what is the difference between the price of which interval -> query)
2. Do not make up the search results, to wait for the code to return results
3. do not repeat the same question, you can continue to ask questions on the basis of existing issues
4. when adding a response node, add it separately, not together with other nodes, not at the same time add a response node and other nodes
5. Do not include more than one code block in the output at a time, only one code block at a time.
6. Each code block should be placed in a code block tag, and a <|action_end|> flag should be added after generating the code, as shown below:
<|action_start|><|interpreter|>`python
# Your code block
`<|action_end|>
7. the last reply should be to add the response node with node_name 'response', you must add the response node and no other nodes
Through the text, we can see:
- Take query rewriting and task planning and get it done with a single LLM task
- An innovative point is that the SEARCH task with code ideas output, before and an algorithm colleague mentioned a similar approach to the discussion, here coincides, this complex task, code in the logic, can better deal with special circumstances
- The planning here is done iteratively, not all at once, and will add new nodes until there is an END node, based on search results, etc.
Task Search
Here are the regular LLM tasks thattool_info
is a specific search tool that containsSearch
cap (a poem)select
Operation.
## Character profile
You are an intelligent assistant that can invoke a web search tool. Please call the search tool to collect information and answer questions based on the "current question". You can call the following tools: {tool_info}
{tool_info}
## Reply Format
When calling the tool, please follow this format.
`
Your thought process... <|action_start|><|plugin|>{{"name": "tool_name", "parameters": {{"param1": "value1"}}}}<|action_end|>
`
## Requirements
- Each key point in the response needs to be labeled with the source of the cited search result to ensure credibility of the information. Give indexes in the form of `[[int]]`, or multiple [[]] if there are multiple indexes, e.g. `[[id_1]][[id_2]]`.
- Based on the search results of the "current question", write a detailed and complete reply, prioritizing the answer to the "current question".
## Sample
### search
When I want to search for "what season is honor of kings", I would do it in the following format: "It's 2024, so I should search for "what season is honor of kings".
It's 2024, so I should search for the Glory of Kings season keyword <|action_start|><|plugin|>{{"name":""", "parameters": {{"query": ["Glory of Kings Season", "Glory of Kings Season 2024"]}}}}< |action_end|>
### select
In order to find the strongest shooter for the King's Glory s36 season, I needed to look for webpages that mentioned the King's Glory s36 shooter. After initial browsing, I found that page 0 mentions information about King of Glory s36 season, but there is no specific information about the shooter. Webpage 3 mentions "The strongest shooter of s36 appears?" Webpage 3 mentions that "the strongest shooter in s36 has appeared?", which may contain information about the strongest shooter. Page 13 mentions "four T0 heroes rise, archer glory", which may contain information about the strongest archer. Therefore, I chose page 3 and page 13 for further reading. <|action_start|><|plugin|>{{"name": """, "parameters": {{"index": [3, 13]}}}}<|action_end|>.
"""
Summary Prompt
Write a detailed and complete final answer based on the question and answer pairs provided.
- The answer needs to be logical and well organized to ensure that it is easy for the reader to understand.
- Each key point in the answer should be labeled with the source of the cited search result (keeping it consistent with the index in the Q&A pair) to ensure the credibility of the information. Give indexes in the form of `[[int]]`, or multiple [[]] if there are multiple indexes, e.g. `[[id_1]][[id_2]]`.
- The answer section needs to be comprehensive and complete, without vague expressions such as "based on the above", and the final answer presented does not include the Q&A pairs provided to you.
- Language style needs to be professional and rigorous, avoiding colloquialisms.
- Maintain consistent grammar and vocabulary to ensure consistency and coherence throughout the document.
summarize
- Multi-intelligent body collaboration is the next stop for ai search, mindsearch gives good examples
- Effectiveness & time tradeoffs, product design that gives process data that allows users to tolerate long elapsed times
- Officially, by fine-tuning the InternLM2.5-7B-Chat model, it provides results that can match GPT4, and on specific small tasks, enough data to do SFT is possible to achieve better results, and the cost of small models is more controllable.