Location>code7788 >text

SearXNG and LLM combine forces: to create an intelligent search and answer process that protects user privacy, privacy and search without worries

Popularity:955 ℃/2024-08-21 10:05:55

SearXNG and LLM combine forces: to create an intelligent search and answer process that protects user privacy, privacy and search without worries

SearXNG is a free Internet meta-search engine that integrates results from various search services. Users are not tracked or analyzed.

  • github address./searxng/searxng

  • Project address./

  • Public Example./

  • Functional characteristics

    • Self-hosted, can be privately deployed
    • No user tracking/no analytics
    • Scripts and cookies can be customized
    • Secure and encrypted connections
    • Easily integrated with nearly 200 search engines, users can customize the selection of different engines
    • Multi-language support, about 60, including Chinese, English, etc.
    • Provides nearly 100 well-maintained public query instances
  • security protection
    Regardless of the instance type (private, public), SearXNG protects user privacy in a number of ways. There are three forms of removing private data from search requests:

    • Removing private data from requests sent to the search service

    • Not forwarding any content from third-party services (e.g., advertisements) through the search service

    • Remove private data from requests that go to the results page

    Removing private data means not sending cookies to external search engines and generating a random browser profile for each request. Therefore it does not matter whether the public or private instance handles the request as in both cases it is anonymous. the IP address will be the IP of the instance. but SearXNG can be configured to use a proxy or Tor and also supports a result proxy.

    Unlike most search services, SearXNG does not provide advertising or track content. As a result, private data is not forwarded to third parties who might profit from it. In addition to protecting the user from the search service, both the referring page and the search query are hidden from the visited result pages.

1. docker image installation

  • Say goodbye to the DockerHub image download problem: Master an efficient download strategy and enjoy a seamless development experience!
  • Includes docker installation

2. Installation of SearXNG

2.1 Quick Installation

#cloning project
git clone /searxng/
cd searxng

#Installation of dependencies
make install

#activate (a plan).
make run

Can be accessed via browserhttp://127.0.0.1:8888 to use SearXNG

2.2 docker cli

#New Folder searxng cap (a poem) subdirectories
mkdir -p /www/algorithm/searxng

#go into searxng catalogs
cd /www/algorithm/searxng

#Running containers
docker run -d \
  --name searxng \
  --cap-drop ALL \
  --cap-add CHOWN \
  --cap-add SETGID \
  --cap-add SETUID \
  --log-driver json-file \
  --log-opt max-size=1m \
  --log-opt max-file=1 \
  -p 9380:8080 \
  -v $(pwd)/data:/etc/searxng:rw \
  searxng/searxng:latest

Refer to the official website for more settings:

  • /admin/#installation-docker

  • modifications
    When SearXNG is installed, the default output format is HTML. You need to activate the JSON format. Please add the following line to the file. As shown in the previous example, the file is located in ${PWD}/searxng/
  #remove format to deny access, use lower case.
  #formats: [html, csv, json, rss]
  formats:
    - html
    - json # <-- Add this line

2.3 docker compose installation

You can install it with docker-compose, save the following as a file, and use a conversion tool to easily generate a configuration file

  • Composerize: automate the conversion of Docker runtime commands to Compose configurations to simplify container deployment process

version: '3.7'

services:
  searxng:
    image: searxng/searxng:latest
    container_name: searxng
    ports:
      - 9380:8080
    volumes:
      - ./data:/etc/searxng:rw
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
    logging:
      driver: 'json-file'
      options:
        max-size: '1m'
        max-file: '1'

Then execute the following command

# Create a new folder searxng and subdirectories
mkdir searxng

#Enter the searxng directory
cd searxng

# Put into the current directory

#Start with one click
docker compose up -d

  • (of a computer) run
    In your browser, typehttp://IP:9380 You'll see the search screen

advanced (technology)preferences Make settings, any changes will need to be saved to take effect.

  • Shut down docker
docker ps
# In the host's terminal, run the following command to stop the container:
docker stop [container name/container id]
#If the docker stop command does not work, you can use the docker kill command to forcefully exit the container
docker kill [container name/container id]
  • Change the port number.
version: '3.7'

services:
    searxng:
        ports:
            - 9380:9380
        volumes:
            - ${PWD}/searxng:/etc/searxng
        environment:
            - BASE_URL=http://0.0.0.0:9380/
            - INSTANCE_NAME=searxng
        image: searxng/searxng

3. Used in conjunction with LLM

  • normal use

Average results, need to add some other search engine sources, the good thing is that there are no more ads

3.1 FreeAskInternet

Step 1: Users ask questions
Step 2: Search on multiple search engines with SearXNG (running locally)
Step 3: Pass search results into LLM to generate answers

Related item reference:

  • FreeAskInternet:/nashsu/FreeAskInternet?tab=readme-ov-file

  • Privatized AI search engine FreeAskInternet:/wbsu2004/article/details/139570903

3.2 Combining dedify

Currently using tavily, same with searxng.