[PR #24136] [CLOSED] feat(retrieval): migrate Brave Search to LLM Context API #114827

Closed
opened 2026-05-18 15:40:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/24136
Author: @Yashh56
Created: 4/25/2026
Status: Closed

Base: devHead: feat-brave-context


📝 Commits (2)

  • 0da58d7 feat(retrieval): migrate Brave Search to LLM Context API
  • 636e13e feat(retrieval): add Brave Search configuration options and update search function

📊 Changes

4 files changed (+170 additions, -6 deletions)

View changed files

📝 backend/open_webui/config.py (+55 -0)
📝 backend/open_webui/main.py (+18 -0)
📝 backend/open_webui/retrieval/web/brave.py (+52 -6)
📝 backend/open_webui/routers/retrieval.py (+45 -0)

📄 Description

Pull Request Checklist

Before submitting, make sure you've checked the following:

  • Target branch: Verify that the pull request targets the dev branch. PRs targeting main will be immediately closed.
  • Description: Provide a concise description of the changes made in this pull request down below.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Testing: Perform manual tests to verify the implemented fix/feature works as intended AND does not break any other functionality. Include reproducible steps to demonstrate the issue before the fix. Test edge cases (URL encoding, HTML entities, types). Take this as an opportunity to make screenshots of the feature/fix and include them in the PR description.
  • Agentic AI Code: Confirm this Pull Request is not written by any AI Agent or has at least gone through additional human review AND manual testing. If any AI Agent is the co-author of this PR, it may lead to immediate closure of the PR.
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Git Hygiene: Keep PRs atomic (one logical change). Clean up commits and rebase on dev to ensure no unrelated commits (e.g. from main) are included. Push updates to the existing PR branch instead of closing and reopening.
  • Title Prefix: feat: Introduces a new feature or enhancement to the codebase

Changelog Entry

Description

  • This PR migrates the Brave Search integration from the standard Web Search API (/res/v1/web/search) to their new LLM Context API (/res/v1/llm/context). The LLM Context API is specifically designed for RAG applications. Instead of returning plain search result descriptions, it provides richer grounding data with multiple relevant snippets extracted from the source pages, which provides much better context for the LLM.

Added

Contributor License Agreement


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/24136 **Author:** [@Yashh56](https://github.com/Yashh56) **Created:** 4/25/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `feat-brave-context` --- ### 📝 Commits (2) - [`0da58d7`](https://github.com/open-webui/open-webui/commit/0da58d7d16f44c028ae7f5cb6b3478c0b1024b7c) feat(retrieval): migrate Brave Search to LLM Context API - [`636e13e`](https://github.com/open-webui/open-webui/commit/636e13eb937b8f5c8e82b7e7dc9253f317ab097f) feat(retrieval): add Brave Search configuration options and update search function ### 📊 Changes **4 files changed** (+170 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/config.py` (+55 -0) 📝 `backend/open_webui/main.py` (+18 -0) 📝 `backend/open_webui/retrieval/web/brave.py` (+52 -6) 📝 `backend/open_webui/routers/retrieval.py` (+45 -0) </details> ### 📄 Description <!-- ⚠️ CRITICAL CHECKS FOR CONTRIBUTORS (READ, DON'T DELETE) ⚠️ 1. Target the `dev` branch. PRs targeting `main` will be automatically closed. 2. Do NOT delete the CLA section at the bottom. It is required for the bot to accept your PR. --> # Pull Request Checklist **Before submitting, make sure you've checked the following:** - [x] **Target branch:** Verify that the pull request targets the `dev` branch. **PRs targeting `main` will be immediately closed.** - [x] **Description:** Provide a concise description of the changes made in this pull request down below. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [x] **Testing:** Perform manual tests to **verify the implemented fix/feature works as intended AND does not break any other functionality**. Include reproducible steps to demonstrate the issue before the fix. Test edge cases (URL encoding, HTML entities, types). Take this as an opportunity to **make screenshots of the feature/fix and include them in the PR description**. - [x] **Agentic AI Code:** Confirm this Pull Request is **not written by any AI Agent** or has at least **gone through additional human review AND manual testing**. If any AI Agent is the co-author of this PR, it may lead to immediate closure of the PR. - [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [x] **Git Hygiene:** Keep PRs atomic (one logical change). Clean up commits and rebase on `dev` to ensure no unrelated commits (e.g. from `main`) are included. Push updates to the existing PR branch instead of closing and reopening. - [x] **Title Prefix:** `feat`: Introduces a new feature or enhancement to the codebase # Changelog Entry ### Description - This PR migrates the Brave Search integration from the standard Web Search API (`/res/v1/web/search`) to their new LLM Context API (`/res/v1/llm/context`). The LLM Context API is specifically designed for RAG applications. Instead of returning plain search result descriptions, it provides richer grounding data with multiple relevant snippets extracted from the source pages, which provides much better context for the LLM. ### Added - #24120 ### Contributor License Agreement <!-- 🚨 DO NOT DELETE THE TEXT BELOW 🚨 Keep the "Contributor License Agreement" confirmation text intact. Deleting it will trigger the CLA-Bot to INVALIDATE your PR. Your PR will NOT be reviewed or merged until you check the box below confirming that you have read and agree to the terms of the CLA. --> - [x] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-18 15:40:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#114827