run-llama / create-llama

The easiest way to get started with LlamaIndex
MIT License
1.04k stars 132 forks source link

DuckDuckGo Search Functionality Not Working with Next.js #427

Open klei30 opened 4 days ago

klei30 commented 4 days ago

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 commented 3 days ago

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 commented 1 day ago

@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 commented 1 day ago

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

klei30 commented 1 day ago

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 1 day ago

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 commented 6 hours ago

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 commented 5 hours ago

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
klei30 commented 2 hours ago

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.