Make WebResearchRetriever
class agnostic of the search engine
#19782
francisco-perez-sorrosal
announced in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Checked
Feature request
The current implementation of the
WebResearchRetriever
class is very tied to the Google Search APIas it uses directly the
GoogleSearchAPIWrapper
in thesearch
attributeI think it would be nice to have a more generic implementation of the
WebResearchRetriever
that can be used with other search engines like DuckDuckGo or Bing.Motivation
I had to use the `WebResearchRetriever but I found out that it's very tied to Google Search. I didn't want to use Google as it requires API KEYS, so I had to end up hacking the injection of the DDG Wrapper directly in a personal project to use the DuckDuckGo Wrapper with the retriever. DuckDuckGo for example doesn't require any API keys (unlike Google) and it's free to use and useful when prototyping or testing. The proposal would avoid those kind of dirty hacks that are not maintainable nor portable by allowing to inject the a compatible wrapper. With the current hack I did I was able to check that the retriever works good with other search engine wrappers like DDG too.
Proposal (If applicable)
The scaffolding of what I propose is this:
search_base.py
) in the langchain community utilities package, with theSearchAPIWrapperBase
class that defines the interface for the search API wrappers.__init__.py
of theutilities
package.web_research.py
and make theWebResearchRetriever
to use theSearchAPIWrapperBase
instead of theGoogleSearchAPIWrapper
andeliminate all the specific references to Google search as it would be generic.
web_research.py
to be search engine agnostic.DuckDuckGoSearchAPIWrapper
:Am I missing something? If you are interested in this approach, I can help you to implement it, I have a WIP which I can turn into a PR that I can share with you to validate the idea.
Thanks for your attention!!!
Beta Was this translation helpful? Give feedback.
All reactions