Skip to content

Commit 89a2cee

Browse files
committed
Add instructions to run a local SearxNG instance with docker
1 parent 4014967 commit 89a2cee

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

atomic-examples/web-search-agent/README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ To run the Web Search Agent:
4343
OPENAI_API_KEY=your_openai_api_key
4444
SEARXNG_BASE_URL=your_searxng_instance_url
4545
```
46-
Replace `your_openai_api_key` with your actual OpenAI API key and `your_searxng_instance_url` with the URL of your SearxNG instance.
46+
Replace `your_openai_api_key` with your actual OpenAI API key and `your_searxng_instance_url` with the URL of your SearxNG instance.
47+
If you do not have a SearxNG instance, see the instructions below to set up one locally with docker.
48+
4749

4850
5. Run the Web Search Agent:
4951
```
@@ -58,6 +60,30 @@ To run the Web Search Agent:
5860
4. The Question Answering Agent analyzes the search results and formulates a detailed answer.
5961
5. The main script presents the answer, along with references and follow-up questions.
6062

63+
## SearxNG Setup with docker
64+
65+
From the [official instructions](https://docs.searxng.org/admin/installation-docker.html):
66+
67+
```shell
68+
mkdir my-instance
69+
cd my-instance
70+
export PORT=8080
71+
docker pull searxng/searxng
72+
docker run --rm \
73+
-d -p ${PORT}:8080 \
74+
-v "${PWD}/searxng:/etc/searxng" \
75+
-e "BASE_URL=http://localhost:$PORT/" \
76+
-e "INSTANCE_NAME=my-instance" \
77+
searxng/searxng
78+
```
79+
80+
Set the `SEARXNG_BASE_URL` environment variable to `http://localhost:8080/` in your `.env` file.
81+
82+
83+
Note: for the agent to communicate with SearxNG, the instance must enable the JSON engine, which is disabled by default.
84+
Edit `searxng/settings.yml` and add `- json` in the `search.formats` section, then restart the container.
85+
86+
6187
## Customization
6288

6389
You can customize the Web Search Agent by modifying the following:

0 commit comments

Comments
 (0)