langchain icon indicating copy to clipboard operation
langchain copied to clipboard

SearxNG meta search api helper

Open blob42 opened this issue 2 years ago • 3 comments

This is a work in progress PR to track my progres.

TODO:

  • [x] Get results using the specifed searx host

  • [x] Prioritize returning an answer or results otherwise

    • [ ] expose the field infobox when available
    • [ ] expose score of result to help agent's decision
    • [ ] expose the suggestions field to agents so they could try new queries if no results are found with the orignial query ?
  • [ ] Dynamic tool description for agents ?

    • Searx offers many engines and a search syntax that agents can take advantage of. It would be nice to generate a dynamic Tool description so that it can be used many times as a tool but for different purposes.
  • [x] Limit number of results

  • [ ] Implement paging

  • [x] Miror the usage of the Google Search tool

  • [x] easy selection of search engines

  • [x] Documentation

    • [ ] update HowTo guide notebook on Search Tools
  • [ ] Handle async

  • [ ] Tests

Add examples / documentation on possible uses with

  • [ ] getting factual answers with !wiki option and infoboxes
  • [ ] getting suggestions
  • [ ] getting corrections

blob42 avatar Feb 02 '23 22:02 blob42

I made the wrapper easy to use like google and serpapi, I also tried to cover as much details in the documentation and example notebook.

I also added a note for those who use or run a self hosted instance with an API rate limiter, I proposed a patch to searx here

blob42 avatar Feb 09 '23 02:02 blob42

It was tough getting the linting to pass, there where many linting packages that didn't instally automatically with poetry and I had to manually add them and the docstring requirements are too strict.

blob42 avatar Feb 11 '23 12:02 blob42

@hwchase17 feel free to merge anytime, I will improve the wrapper in the future on separate PRs as I keep using it. I am already exclusively using Searx anywhere google, serpapi or any search engine is required.

blob42 avatar Feb 14 '23 02:02 blob42