Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DuckDuckGo Search Functionality Not Working with Next.js #427

Open
klei30 opened this issue Nov 15, 2024 · 9 comments
Open

DuckDuckGo Search Functionality Not Working with Next.js #427

klei30 opened this issue Nov 15, 2024 · 9 comments
Assignees

Comments

@klei30
Copy link

klei30 commented Nov 15, 2024

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

@klei30
Copy link
Author

klei30 commented 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

@leehuwuj
Copy link
Collaborator

@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?

@marcusschiesser
Copy link
Collaborator

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

@klei30
Copy link
Author

klei30 commented 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
Copy link
Author

klei30 commented 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 ?

@leehuwuj
Copy link
Collaborator

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.

@marcusschiesser marcusschiesser changed the title DuckDuckGo Search Functionality Not Working with LlamaIndex and Next.js Integration DuckDuckGo Search Functionality Not Working with Next.js Nov 20, 2024
@marcusschiesser
Copy link
Collaborator

yes, the library is not working at the moment, see Snazzah/duck-duck-scrape#140 - so we will:

  1. remove duckduckgo from agentic rag template
  2. generally deactivate the tool for TS

@klei30
Copy link
Author

klei30 commented 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.

@marcusschiesser
Copy link
Collaborator

@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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants