[GH-ISSUE #2257] [DOCS]: Could you add an example or instructions for web search with SearXNG ? #1474

Closed
opened 2026-02-22 18:24:59 -05:00 by yindo · 6 comments
Owner

Originally created by @Richter03 on GitHub (Sep 10, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2257

Description

I try to set "SearXNG API base URL" like "http://127.0.0.1:1234/?format=json&q=%s" but it not work, I don't know what's should I looking for, I try to search but still have no clue that SearXNG API base URL I use is correct. I dock SearXNG via Docker WSL and set it able to return as JSON but still no clue what's wrong.

Originally created by @Richter03 on GitHub (Sep 10, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2257 ### Description I try to set "SearXNG API base URL" like "http://127.0.0.1:1234/?format=json&q=%s" but it not work, I don't know what's should I looking for, I try to search but still have no clue that SearXNG API base URL I use is correct. I dock SearXNG via Docker WSL and set it able to return as JSON but still no clue what's wrong.
yindo added the documentation label 2026-02-22 18:24:59 -05:00
yindo closed this issue 2026-02-22 18:24:59 -05:00
Author
Owner

@timothycarambat commented on GitHub (Sep 10, 2024):

Just http://127.0.0.1:1234 - we append everything else. Additionally if you are connecting docker<>docker in order for the anythingllm container to reach -> out to host layer -> into SearXNG container you cannot use localhost/127.0.0.1 because these are resolving inside of the AnythingLLM container.

use host.docker.internal https://docs.docker.com/desktop/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host

If on linux there are alternatives to that special hostname

@timothycarambat commented on GitHub (Sep 10, 2024): Just `http://127.0.0.1:1234` - we append everything else. Additionally if you are connecting docker<>docker in order for the anythingllm container to reach -> out to host layer -> into SearXNG container you cannot use localhost/127.0.0.1 because _these are resolving inside of the AnythingLLM container_. use `host.docker.internal` https://docs.docker.com/desktop/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host [If on linux there are alternatives to that special hostname](https://stackoverflow.com/a/48547074)
Author
Owner

@Richter03 commented on GitHub (Sep 11, 2024):

Thanks, however it' doesn't work on Windows desktop version, I try http://host.docker.internal:1234/ , http://host.docker.internal:1234/search?q=<query> and http://host.docker.internal:1234/search?q=%s , non of them work, I try it on Open WebUI, http://host.docker.internal:1234/ could connect to AI and use web search normally so do I need to set or change anything other from set AI agent and turn on web search on Windows desktop version ?

@Richter03 commented on GitHub (Sep 11, 2024): Thanks, however it' doesn't work on Windows desktop version, I try `http://host.docker.internal:1234/` , `http://host.docker.internal:1234/search?q=<query>` and `http://host.docker.internal:1234/search?q=%s` , non of them work, I try it on Open WebUI, `http://host.docker.internal:1234/` could connect to AI and use web search normally so do I need to set or change anything other from set AI agent and turn on web search on Windows desktop version ?
Author
Owner

@timothycarambat commented on GitHub (Sep 11, 2024):

Are you sure the agent is not just refusing to call the tool and that tool is setup up fine?

The correct value is indeed just http://host.docker.internal:1234. And doing a query like @agent search the web for <xyz> should then invoke SearXNG endpoint calls.

@timothycarambat commented on GitHub (Sep 11, 2024): Are you sure the agent is not just _refusing_ to call the tool and that tool is setup up fine? The correct value is indeed just `http://host.docker.internal:1234`. And doing a query like `@agent search the web for <xyz>` should then invoke SearXNG endpoint calls.
Author
Owner

@stanribilir commented on GitHub (Sep 15, 2024):

can we use searx online instances in anythingLLM, have you tested these and if there is a compatible one can you please tell. it is complicated for me to install my own searxng on my own, even with docker.

@stanribilir commented on GitHub (Sep 15, 2024): can we use searx online instances in anythingLLM, have you tested these and if there is a compatible one can you please tell. it is complicated for me to install my own searxng on my own, even with docker.
Author
Owner

@joaovl5 commented on GitHub (Sep 16, 2024):

It's a bummer that it only allows for local-only searxng instances. I run my own on a vps and would it would be awesome to connect to it locally.

@joaovl5 commented on GitHub (Sep 16, 2024): It's a bummer that it only allows for local-only searxng instances. I run my own on a vps and would it would be awesome to connect to it locally.
Author
Owner

@timothycarambat commented on GitHub (Sep 16, 2024):

You can absolutely use an external connection @joaovl5. its just a URL - if the client can reach it you can run it. AnythingLLM's connection to SearXNG can be any valid IP - it just need to resolve. There is no restriction on localhost, we couldn't even control that if we wanted to...

For everyone who keeps having issues with this - make sure - json is enabled as an engine in your settings.yaml for searXNG, otherwise all you can get is HTML back which would be wasteful for the LLM over just JSON response bodies.

@timothycarambat commented on GitHub (Sep 16, 2024): You can absolutely use an external connection @joaovl5. its just a URL - if the client can reach it you can run it. AnythingLLM's connection to SearXNG can be any valid IP - it just need to resolve. There is no restriction on localhost, we couldn't even control that if we wanted to... For everyone who keeps having issues with this - make sure `- json` is enabled as an engine in your `settings.yaml` for searXNG, otherwise all you can get is HTML back which would be wasteful for the LLM over just JSON response bodies.
yindo changed title from [DOCS]: Could you add an example or instructions for web search with SearXNG ? to [GH-ISSUE #2257] [DOCS]: Could you add an example or instructions for web search with SearXNG ? 2026-06-05 14:40:58 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1474