How Cursor uses local search to obtain massive information

Using local search technology, Cursor can bring revolutionary changes to your massive information retrieval.
Core content:
1. How to open Cursor local search and the effect display
2. How to combine ChatWise's Local Search capabilities to improve search efficiency
3. Detailed steps and guidelines for configuring Local Web Search in Cursor
How to use local search in Cursor to get better results
First look at the effect:
Here, the browser is opened directly to search, and then tabs are opened in batches to obtain information.
Cursor has built-in search capabilities, which is also good. If it does not achieve the desired effect, we can also use the Local Search capability similar to ChatWise. That is, open the browser to search, then open the tab page of the search results, and then crawl the content and give it to the big model. It is not realistic for us to handle this process manually. The good news is that the author of ChatWise has open-sourced Local Web Search, so that we can run it locally. Then we use Cursor's Agent to perform this process. Here is a reference to the idea of the big guy [1]
First download local-web-search
Install bun
You need to install bun before downloading, for details, please refer to:
https://www.bunjs.cn/docs/installation
Download local-web-search
git clone https://github.com/egoist/ local -web-search
Install Dependencies
cd local -web-search && bun install
Configuring Cursorrules in Cursor
I just configured it here. .cursor/rules/local-web-search.mdc
You can directly create a new one in the settings, and it will automatically .cursor/rules
The mdc file is generated in the directory (maybe it means MarkDownCursor?) The relevant configuration is as follows: The specific path can be changed, or the project can be directly thrown to Cursor after downloading to correct the path.
< local -web-search >
# Instructions
Use the following commands to get AI assistant:
##
** Deep Search Network: **
` cd ~/Documents/code/cursors/ local -web-search && bun ~/Documents/code/cursors/ local -web-search/src/cli.ts search --max-results 150 --show -q "<your question>" ` - Get answers from the web using ` local -web-search` (eg, ` cd ~/Documents/code/cursors/ local -web-search && bun ~/Documents/code/cursors/ local -web-search/src/cli.ts search -q "latest weather in London" `)
</local-web-search>
There is still room for improvement here, for example, after the Cursor Agent performs a deep search on the Internet, it can automatically continue searching the code base and automatically write out the best practices. You can try this step.
local-web-search related parameter configuration:
The parameters I mentioned above are exaggerated. In actual use, you can set another search command, then the search quantity will be reduced and the browser will not be displayed.
-q, --query <query> - Search for keyword (required)
-c, --concurrency <num> - Set the concurrency number
--show - Show the browser interface
--max-results <num> - Limit the maximum number of results
--browser <browser> - select browser
--exclude-domain <domain> - exclude specific domains
--topic <topic> - Set the search topic
--fake - Use a simulated browser. The principle here is to await fetch and then return the result, which may trigger Google's blocker