DuckDuckGo Search Functionality Not Working with Next.js #95

Open
opened 2026-02-15 19:15:52 -05:00 by yindo · 9 comments
Owner

Originally created by @klei30 on GitHub (Nov 15, 2024).

Originally assigned to: @leehuwuj on GitHub.

I'm implementing DuckDuckGo search functionality in my Next.js application using llamaindex. However, the search feature is not working as expected. Also in the other apps that i have already deployed online the DuckDuckGo search stop working.

Below are the details of my implementation and the issues I'm encountering.

Steps to Reproduce

npx create-llama@latest --pro
√ What is your project named? ... newinsuranceagent
√ Which template would you like to use? » Agentic RAG (e.g. chat with docs)
√ Which framework would you like to use? » NextJS
√ Would you like to set up observability? » Traceloop
√ Please provide your OpenAI API key (leave blank to skip): ...
√ Would you like to use a vector database? » Pinecone
√ Which data source would you like to use? » Use an example PDF
√ Would you like to add another data source? » No
√ Would you like to use LlamaParse (improved parser for RAG - requires API key)? ... No / Yes
√ Please provide your LlamaCloud API key (leave blank to skip): ...
√ Would you like to build an agent using tools? If so, select the tools here, otherwise just press enter » DuckDuckGo Search

Actual Behavior

"user: search in internet about last news in BBC

AI: It seems there was an issue with the search. Let me try again to find information about BBC news"

and it keeps loading without showing any other result

Originally created by @klei30 on GitHub (Nov 15, 2024). Originally assigned to: @leehuwuj on GitHub. I'm implementing DuckDuckGo search functionality in my Next.js application using `llamaindex`. However, the search feature is not working as expected. Also in the other apps that i have already deployed online the DuckDuckGo search stop working. Below are the details of my implementation and the issues I'm encountering. ### **Steps to Reproduce** npx create-llama@latest --pro √ What is your project named? ... newinsuranceagent √ Which template would you like to use? » Agentic RAG (e.g. chat with docs) √ Which framework would you like to use? » NextJS √ Would you like to set up observability? » Traceloop √ Please provide your OpenAI API key (leave blank to skip): ... √ Would you like to use a vector database? » Pinecone √ Which data source would you like to use? » Use an example PDF √ Would you like to add another data source? » No √ Would you like to use LlamaParse (improved parser for RAG - requires API key)? ... No / Yes √ Please provide your LlamaCloud API key (leave blank to skip): ... √ Would you like to build an agent using tools? If so, select the tools here, otherwise just press enter » DuckDuckGo Search ### **Actual Behavior** "user: search in internet about last news in BBC AI: It seems there was an issue with the search. Let me try again to find information about BBC news" and it keeps loading without showing any other result
Author
Owner

@klei30 commented on GitHub (Nov 16, 2024):

DuckDuckGo scraping library (duck-duck-scrape) is detecting anomalies due to frequent requests being made in a short timeframe. it is strange how in all apps i have deployed , which are all of different versions this DuckDuckGo functionality is off

@klei30 commented on GitHub (Nov 16, 2024): DuckDuckGo scraping library (duck-duck-scrape) is detecting anomalies due to frequent requests being made in a short timeframe. it is strange how in all apps i have deployed , which are all of different versions this DuckDuckGo functionality is off
Author
Owner

@leehuwuj commented on GitHub (Nov 18, 2024):

@klei30 Yes, I think it's the issue of the DuckDuckGo scrape library. Could you try updating it to the latest version and see if that works?

@leehuwuj commented on GitHub (Nov 18, 2024): @klei30 Yes, I think it's the issue of the DuckDuckGo scrape library. Could you try updating it to the latest version and see if that works?
Author
Owner

@marcusschiesser commented on GitHub (Nov 19, 2024):

@KleiAliaj mentioned in #433 that it's also not working for Python

@marcusschiesser commented on GitHub (Nov 19, 2024): @KleiAliaj mentioned in #433 that it's also not working for Python
Author
Owner

@klei30 commented on GitHub (Nov 19, 2024):

HI @leehuwuj . Again the same issue but with a new one

./node_modules/chokidar/lib/fsevents-handler.js
Module not found: Can't resolve 'fsevents' in 'C:\Users\klei\Desktop\newinsurance\node_modules\chokidar\lib'

and also the duckduckgo issue

Using tool: 'duckduckgo_search' with inputs: 'query: German insurance industry overview, region: de-en, maxResults: 5'
It seems there was an issue with the search request. Let me try again.

@klei30 commented on GitHub (Nov 19, 2024): HI @leehuwuj . Again the same issue but with a new one ./node_modules/chokidar/lib/fsevents-handler.js Module not found: Can't resolve 'fsevents' in 'C:\Users\klei\Desktop\newinsurance\node_modules\chokidar\lib' and also the duckduckgo issue Using tool: 'duckduckgo_search' with inputs: 'query: German insurance industry overview, region: de-en, maxResults: 5' It seems there was an issue with the search request. Let me try again.
Author
Owner

@klei30 commented on GitHub (Nov 19, 2024):

by the way i am using node -v v22.11.0 and npm -v 10.9.0.

maybe i need to use another version of this ?

@klei30 commented on GitHub (Nov 19, 2024): by the way i am using node -v v22.11.0 and npm -v 10.9.0. maybe i need to use another version of this ?
Author
Owner

@leehuwuj commented on GitHub (Nov 20, 2024):

Hi @klei30 and @KleiAliaj, we just fixed the issue with the DuckDuckGo tool for the Python template. Unfortunately, the TypeScript version needs more effort because the duck-duck-scrape library hasn't been updated for a year. Please try using another search engine tool if you are using Typescript template in the meantime.

@leehuwuj commented on GitHub (Nov 20, 2024): Hi @klei30 and @KleiAliaj, we just fixed the issue with the DuckDuckGo tool for the Python template. Unfortunately, the TypeScript version needs more effort because the duck-duck-scrape library hasn't been updated for a year. Please try using another search engine tool if you are using Typescript template in the meantime.
Author
Owner

@marcusschiesser commented on GitHub (Nov 20, 2024):

yes, the library is not working at the moment, see https://github.com/Snazzah/duck-duck-scrape/issues/140 - so we will:

  1. remove duckduckgo from agentic rag template
  2. generally deactivate the tool for TS
@marcusschiesser commented on GitHub (Nov 20, 2024): yes, the library is not working at the moment, see https://github.com/Snazzah/duck-duck-scrape/issues/140 - so we will: 1. remove duckduckgo from agentic rag template 2. generally deactivate the tool for TS
Author
Owner

@klei30 commented on GitHub (Nov 20, 2024):

I see. But we really need a browser search functionality in the rag. So it would be great if we update it or maybe add another search engine tool.

@klei30 commented on GitHub (Nov 20, 2024): I see. But we really need a browser search functionality in the rag. So it would be great if we update it or maybe add another search engine tool.
Author
Owner

@marcusschiesser commented on GitHub (Nov 20, 2024):

@klei30 currently you can use the python backend as a workaround. I couldn't find another TS library using duckduckgo that's not outdated. Want to give https://www.npmjs.com/package/@serptech/api a try?

@marcusschiesser commented on GitHub (Nov 20, 2024): @klei30 currently you can use the python backend as a workaround. I couldn't find another TS library using duckduckgo that's not outdated. Want to give https://www.npmjs.com/package/@serptech/api a try?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/create-llama#95