[GH-ISSUE #47] [Question]: How to Specify the Search Engine Used by the AI Agent? #25

Closed
opened 2026-06-06 22:08:05 -04:00 by yindo · 3 comments
Owner

Originally created by @VictoryLN on GitHub (Jun 26, 2025).
Original GitHub issue: https://github.com/vxcontrol/pentagi/issues/47

Originally assigned to: @asdek on GitHub.

Background

I am using the Pentagi system and have encountered issues regarding search engine selection. My network environment requires accessing the internet via a proxy, but DuckDuckGo always fail to return valid results.

Actions I Have Tried

I explicitly asked the AI in my input to use Google as the search engine. However, during actual execution, the AI still called DuckDuckGo for searches. Due to network issues, DuckDuckGo always returns a 202 status code and does not provide valid results. After running multiple tasks, I found that the searchlogs table in the pentagidb database remains empty, indicating that no search operations were successfully executed.
Image
Here's a specific error log showing the DuckDuckGo search failure:

2025-06-26 20:39:12 pentagi | time="2025-06-26T12:39:12Z" level=error msg="failed to search in DuckDuckGo"
args="{"query":"host.docker.internal:7860 open source software name version technology stack","max_results":5,"message":"open source software name version technology stack"}"
error="unexpected status code: 202"
num_results=5
query="host.docker.internal:7860 open source software name version technology stack"
region=
tool=duckduckgo

My Questions

  • Is there a way for users to specify which search engine should be used in their input?
  • For example, is there a syntax or keyword to force the AI to use Google instead of DuckDuckGo?
  • Is there a configuration option to set the default search engine?
  • If this is not currently supported, what is the recommended workaround?
  • For example, can this be achieved by modifying the prompt, adjusting template variables, etc.?

Current Workaround Consideration

If modifying the template is the only solution, I understand that I would need to:

  1. Modify backend/pkg/templates/prompts/searcher.tmpl
  2. Rebuild the Docker image with docker-compose build pentagi
  3. Restart the services with docker-compose up -d

However, I'm hoping there might be a more user-friendly configuration approach that doesn't require rebuilding.
Thank you for building such a great project!

Originally created by @VictoryLN on GitHub (Jun 26, 2025). Original GitHub issue: https://github.com/vxcontrol/pentagi/issues/47 Originally assigned to: @asdek on GitHub. ### Background I am using the Pentagi system and have encountered issues regarding search engine selection. My network environment requires accessing the internet via a proxy, but DuckDuckGo always fail to return valid results. ### Actions I Have Tried I explicitly asked the AI in my input to use Google as the search engine. However, during actual execution, the AI still called DuckDuckGo for searches. Due to network issues, DuckDuckGo always returns a 202 status code and does not provide valid results. After running multiple tasks, I found that the `searchlogs` table in the `pentagidb` database remains empty, indicating that no search operations were successfully executed. ![Image](https://github.com/user-attachments/assets/9a4e831f-651c-40c8-a62e-dc3ee02a789c) Here's a specific error log showing the DuckDuckGo search failure: > 2025-06-26 20:39:12 pentagi | time="2025-06-26T12:39:12Z" level=error msg="failed to search in DuckDuckGo" args="{\"query\":\"host.docker.internal:7860 open source software name version technology stack\",\"max_results\":5,\"message\":\"open source software name version technology stack\"}" error="unexpected status code: 202" num_results=5 query="host.docker.internal:7860 open source software name version technology stack" region= tool=duckduckgo ### My Questions - Is there a way for users to specify which search engine should be used in their input? - For example, is there a syntax or keyword to force the AI to use Google instead of DuckDuckGo? - Is there a configuration option to set the default search engine? - If this is not currently supported, what is the recommended workaround? - For example, can this be achieved by modifying the prompt, adjusting template variables, etc.? ### Current Workaround Consideration If modifying the template is the only solution, I understand that I would need to: 1. Modify `backend/pkg/templates/prompts/searcher.tmpl` 2. Rebuild the Docker image with `docker-compose build pentagi` 3. Restart the services with `docker-compose up -d` However, I'm hoping there might be a more user-friendly configuration approach that doesn't require rebuilding. Thank you for building such a great project!
yindo added the enhancement label 2026-06-06 22:08:05 -04:00
yindo closed this issue 2026-06-06 22:08:05 -04:00
Author
Owner

@asdek commented on GitHub (Jun 26, 2025):

Hey @VictoryLN

Thanks for the detailed description - it's immediately clear what the issue is 😉

Almost all tools are enabled for AI agents by adding API keys to environment variables and disabled by removing those variables. The exception is DuckDuckGo since it doesn't require an API key and is always enabled by default.

In the latest commit, I added the ability to explicitly disable this tool via the DUCKDUCKGO_ENABLED env variable. You can set it to false in your .env file to disable this function's logic, but don't forget to add this line to your docker-compose.yml:

- DUCKDUCKGO_ENABLED=${DUCKDUCKGO_ENABLED:-true}

so this value gets passed to the pentagi container. You can check out the changes here.

Please run docker compose pull to get the new pentagi image.

Speaking generally, there's currently no way to prohibit the use of specific enabled functions, but as a workaround, you can explicitly forbid using a function by name in your task prompt from this list.

Since almost all agents receive your initial task at practically every step, this information should be used by them as a strict rule. However, due to long context length, they might not follow this rule during execution.

That's why we're currently working on a settings page that will appear in the next update, where you'll be able to manage prompts and change them directly from the UI, enable/disable functions, test them, manage accumulated knowledge, edit or delete saved guides.

If you have more suggestions for improvements - we're always open to such ideas!

<!-- gh-comment-id:3009245199 --> @asdek commented on GitHub (Jun 26, 2025): Hey @VictoryLN Thanks for the detailed description - it's immediately clear what the issue is 😉 Almost all tools are enabled for AI agents by adding API keys to environment variables and disabled by removing those variables. The exception is DuckDuckGo since it doesn't require an API key and is always enabled by default. In the latest commit, I added the ability to explicitly disable this tool via the `DUCKDUCKGO_ENABLED` env variable. You can set it to `false` in your `.env` file to disable this function's logic, but don't forget to add this line to your docker-compose.yml: ```yaml - DUCKDUCKGO_ENABLED=${DUCKDUCKGO_ENABLED:-true} ``` so this value gets passed to the pentagi container. You can check out the changes [here](https://github.com/vxcontrol/pentagi/commit/c002938bd4c443890b4a08f9eecc675433ea8e2f). Please run `docker compose pull` to get the new pentagi image. Speaking generally, there's currently no way to prohibit the use of specific enabled functions, but as a workaround, you can explicitly forbid using a function by name in your task prompt from [this list](https://github.com/vxcontrol/pentagi/blob/master/backend/pkg/tools/registry.go#L12-L42). Since almost all agents receive your initial task at practically every step, this information should be used by them as a strict rule. However, due to long context length, they might not follow this rule during execution. That's why we're currently working on a settings page that will appear in the next update, where you'll be able to manage prompts and change them directly from the UI, enable/disable functions, test them, manage accumulated knowledge, edit or delete saved guides. If you have more suggestions for improvements - we're always open to such ideas!
Author
Owner

@VictoryLN commented on GitHub (Jun 28, 2025):

Thank you for the quick and detailed response!
I've successfully implemented the solution you provided:

  1. Pulled the latest image.
  2. Updated docker-compose.yml.
  3. Added the environment variable DUCKDUCKGO_ENABLED=false to my .env file.

The solution works perfectly! The DuckDuckGo search function is now properly disabled as intended.

The settings page for managing prompts and functions directly from the UI sounds very promising. I'm currently not familiar with how to customize the local penetration testing knowledge base, but I'm really looking forward to the Settings page that will make this much more accessible.

<!-- gh-comment-id:3015869873 --> @VictoryLN commented on GitHub (Jun 28, 2025): Thank you for the quick and detailed response! I've successfully implemented the solution you provided: 1. Pulled the latest image. 2. Updated docker-compose.yml. 3. Added the environment variable `DUCKDUCKGO_ENABLED=false` to my `.env` file. The solution works perfectly! The DuckDuckGo search function is now properly disabled as intended. The settings page for managing prompts and functions directly from the UI sounds very promising. I'm currently not familiar with how to customize the local penetration testing knowledge base, but I'm really looking forward to the Settings page that will make this much more accessible.
Author
Owner

@asdek commented on GitHub (Jun 28, 2025):

@VictoryLN, great to hear the issue is resolved! 😉

Regarding the knowledge base - currently, agents prepare instructions for themselves during their work, meaning the knowledge base is populated by the agents themselves with information they gather from search engines and during task execution. Some data serves as long-term memory for specific flows, while other parts can be used across different flows. Right now on the Vector Store tab it looks confusing, so we want to provide an interface where you can first browse and edit this knowledge base, and later build it yourself or transfer it between installations, or load from global servers and share it if desired.

At the moment, this includes pentesting guides, software installation instructions, software troubleshooting solutions, source code written by the AI agent coder, and results from comprehensive information searches from search engines.

Feel free to join our community to stay updated and have more direct communication on topics that interest you: Discord and Telegram

<!-- gh-comment-id:3015968377 --> @asdek commented on GitHub (Jun 28, 2025): @VictoryLN, great to hear the issue is resolved! 😉 Regarding the knowledge base - currently, agents prepare instructions for themselves during their work, meaning the knowledge base is populated by the agents themselves with information they gather from search engines and during task execution. Some data serves as long-term memory for specific flows, while other parts can be used across different flows. Right now on the Vector Store tab it looks confusing, so we want to provide an interface where you can first browse and edit this knowledge base, and later build it yourself or transfer it between installations, or load from global servers and share it if desired. At the moment, this includes pentesting guides, software installation instructions, software troubleshooting solutions, source code written by the AI agent `coder`, and results from comprehensive information searches from search engines. Feel free to join our community to stay updated and have more direct communication on topics that interest you: [Discord](https://discord.gg/2xrMh7qX6m) and [Telegram](https://t.me/+Ka9i6CNwe71hMWQy)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vxcontrol/pentagi#25