Origem: D:/Documents/Github/LocalAiApp Arquivos omitidos (segredos, bancos de dados, logs, >50 MB): 0
1.3 KiB
1.3 KiB
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
- Receives a search query from the LocalAiApp via
POST /search-and-extract. - Asks your local
SearXNGinstance for the top results. - Fetches the HTML of the resulting pages.
- Uses
linkedomandReadabilityto strip out all menus, footers, scripts, and clutter. - Converts the clean article payload into
Markdownusingnode-html-markdown. - 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:8888by default).
Running
-
Install dependencies:
npm install -
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!