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

feat: rag api integration support (web search) #586

Closed
tjbck opened this issue Jan 27, 2024 · 17 comments
Closed

feat: rag api integration support (web search) #586

tjbck opened this issue Jan 27, 2024 · 17 comments
Milestone

Comments

@tjbck
Copy link
Contributor

tjbck commented Jan 27, 2024

Extension of #464

Additional information about web content pipeline, I think we can integrate search api for RAG. Like serpapi(free plan is 100 times search/month), bing search API (free plan is 1000 transactions /month),Wikipedia api or other.

@zinwelzl
Copy link

Hi.

Can you give example how to use it.

I try with
count words from #http://example.com/
but doesn't work for me

@tjbck
Copy link
Contributor Author

tjbck commented Jan 29, 2024

@zinwelzl

You should start the prompt using the '#' command followed by the website url like such:

image

Make sure to click on the button to include the website as a document.

@ChingWeiChan
Copy link

@tjbck
I think we can make the url block clickable (hypertext) or catch the website title then can check the url whether we expected or not.
截圖 2024-01-30 晚上7 34 52

@tjbck
Copy link
Contributor Author

tjbck commented Feb 1, 2024

@ChingWeiChan Great idea, I'll make it clickable!

Just merged #616, should work as expected!

@adan89lion
Copy link
Contributor

Hi,

I tried some news articles with RAG, but it seems like models I tried are unable to process the "correct" content.

For instance, given the example article from CNN, the model is unable to extract answers from the article.
Screenshot_20240221_134956_Chrome

And if I want the model to introduce the document, it responded with content that are irrelevant to the article (website headers or SEO data I presume).
Screenshot_20240221_135057_Chrome

I think an integration with Mozilla's Readability library or similar projects can vastly improve the efficiency of website RAG support for open-webui.

@tjbck tjbck changed the title feat: rag api integration support feat: rag api integration support (web search) Mar 1, 2024
@tbendien
Copy link

tbendien commented Mar 1, 2024

DuckDuckGo search API is free: https://pypi.org/project/duckduckgo-search/

@dillfrescott
Copy link

Can't wait for this! Super cool stuff!

@d416
Copy link

d416 commented Mar 22, 2024

Huggingface chat is one of the best implementations of web search I’ve seen for UX so it’d be great if open-webui used this flow: https://huggingface.co/chat/

HuggingChat also open sourced and is OpenAPI compatible so it can be used with Ollama. The web search can be configured to use different search engines including searxng (private open source search engine)
https://github.com/huggingface/chat-ui?tab=readme-ov-file#web-search-config

Edit: chat-ui has Ollama support built in (it’s in the readme)

@strikeoncmputrz
Copy link

LLM_Web_search is a similar capability implemented in Text Generation WebUI that uses Langchain for RAG. It's worked very well for me and with a good system or character prompt I don't even need to ask it to search the web. https://github.com/mamei16/LLM_Web_search. I made a minor bug fix but otherwise am not affiliated.

@dillfrescott
Copy link

I think if open webui were to use a search engine, I nominate searxng (running locally) 100%.

I'm using it with another similar project and it works flawlessly and its totally free too, unlike a lot of these API's.

@sammcj
Copy link
Contributor

sammcj commented Apr 11, 2024

Seconding the recommendation of searxng, it's really very good, self-hostable and works with many backend search engine providers.

@9cento
Copy link

9cento commented Apr 25, 2024

+1
Can't wait for a web search feature, game changer!

@MohamedAliRashad
Copy link

Any updates ?

@knd775
Copy link

knd775 commented Apr 25, 2024

If you don't have anything to add, please don't comment like this. It just makes it harder for other people to follow.

@9cento
Reactions exist for a reason, use them instead

@MohamedAliRashad
Do you see any updates?

@ProjectMoon
Copy link

Idea for how to implement this: make a checkbox/toggle in the message prompt to enable "use web search for enhanced response accuracy". If this toggle is enabled, first send a hidden message to the LLM asking it to analyze the user's message for terms to search for. Then make a search request for each of these terms using some supported search engine, and send the top results to the normal web RAG pipeline.

This would require the admin to configure some search API endpoint. Starting with SearxNG would probably be good because it has an easily configurable JSON API.

@9cento
Copy link

9cento commented May 20, 2024

Reactions exist for a reason, use them instead

That was a bump, frustrated mass-replier. And this is another bump.

@tjbck tjbck added this to the v0.2.0 milestone May 26, 2024
@tjbck
Copy link
Contributor Author

tjbck commented May 27, 2024

Implemented in dev.

@tjbck tjbck closed this as completed May 27, 2024
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