Files
LocalMind/local-search-service
evandro e08189f640 wip: snapshot das alterações não commitadas (2026-10-20)
Origem: D:/Documents/Github/LocalAiApp
Arquivos omitidos (segredos, bancos de dados, logs, >50 MB): 0
2026-10-20 00:48:09 -03:00
..

Local Search Service

This is the background Web Search extraction service for the LocalAiApp. It acts as a lightweight proxy and DOM parser that connects your mobile app (React Native) to SearXNG, ensuring the Local AI context is pristine Markdown.

How it Works

  1. Receives a search query from the LocalAiApp via POST /search-and-extract.
  2. Asks your local SearXNG instance for the top results.
  3. Fetches the HTML of the resulting pages.
  4. Uses linkedom and Readability to strip out all menus, footers, scripts, and clutter.
  5. Converts the clean article payload into Markdown using node-html-markdown.
  6. Returns the pure Markdown text to the LocalAiApp to inject into the AI's prompt.

Setup

Requirements

  • Node.js v18+
  • A running instance of SearXNG (running locally at http://127.0.0.1:8888 by default).

Running

  1. Install dependencies:

    npm install
    
  2. Start the service (runs on port 3030):

    npm start
    

Integrations

Inside the main LocalAiApp, the chat input now has a Web Search toggle (the Globe icon). When activated, every prompt sent will first trigger the search service. The service fetches context online and feeds the result as an invisible pre-system-prompt to LM Studio!