[PR #13663] [CLOSED] feat: Add new action type Parser for better Knowledge #62114

Closed
opened 2026-05-06 06:03:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/13663
Author: @DanielDowns
Created: 5/7/2025
Status: Closed

Base: devHead: dev


📝 Commits (10+)

  • 3a404c9 added parsing type and basic tracing
  • e0f5487 default parsing now properly parses and uploads
  • f8e201f handle all custom parsers and switch to default if none are provided
  • 7dd06c6 removed original save function thats now in plugin. moved get_plugin() to correct module. DefaultParser is now named such with proper structure and logging
  • d512a68 Merge branch 'main' of https://github.com/DanielDowns/open-webui into parser_addition
  • 39c5512 Merge pull request #1 from DanielDowns/parser_addition
  • d06b6d7 removed testing print statement
  • b4d94a1 renamed PARSER_TYPE, modified return of DefaultParser::split, incorrect Parsers now properly throw Exceptions
  • bae2a64 added deleting methods to parsers
  • fb6dd86 expanded verification to include new methods

📊 Changes

10 files changed (+485 additions, -315 deletions)

View changed files

📝 backend/open_webui/functions.py (+93 -5)
📝 backend/open_webui/retrieval/utils.py (+1 -1)
📝 backend/open_webui/routers/files.py (+0 -3)
📝 backend/open_webui/routers/knowledge.py (+58 -48)
📝 backend/open_webui/routers/retrieval.py (+106 -255)
📝 backend/open_webui/utils/middleware.py (+3 -0)
backend/open_webui/utils/parser.py (+217 -0)
📝 backend/open_webui/utils/plugin.py (+3 -1)
📝 src/lib/apis/files/index.ts (+1 -1)
📝 src/lib/components/workspace/Knowledge/KnowledgeBase.svelte (+3 -1)

📄 Description

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.

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

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests to validate the changes?
  • 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?
  • Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
    • BREAKING CHANGE: Significant changes that may affect compatibility
    • build: Changes that affect the build system or external dependencies
    • ci: Changes to our continuous integration processes or workflows
    • chore: Refactor, cleanup, or other non-functional code changes
    • docs: Documentation update or addition
    • feat: Introduces a new feature or enhancement to the codebase
    • fix: Bug fix or error correction
    • i18n: Internationalization or localization changes
    • perf: Performance improvement
    • refactor: Code restructuring for better maintainability, readability, or scalability
    • style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
    • test: Adding missing tests or correcting existing tests
    • WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry

Description

Previously, documents/web searches/videos/etc were all parsed in the same, hard coded manner. Any unique parsing or new ways of parsing required completely ignoring Knowledge to use Pipelines. This allows users to easily add in unique parsing of any information they wish through standard operations.

Added

  • new Parser class, with abstract ParserInterface for easier implementation
  • DefaultParser that will handle parsing if users do not wish to handle it
    • is also inheritable, allowing users to only modify parts of behavior

Changed

  • uploading documents or text now searches for viable Parser functions. If none is found, DefaultParser is used (falls back to LangChain's RecursiveCharacterTextSplitter)

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.


🔄 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/13663 **Author:** [@DanielDowns](https://github.com/DanielDowns) **Created:** 5/7/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (10+) - [`3a404c9`](https://github.com/open-webui/open-webui/commit/3a404c986085ae798b9a9a3a00455b3ed1ca5c11) added parsing type and basic tracing - [`e0f5487`](https://github.com/open-webui/open-webui/commit/e0f5487d6c544b1c680d1703bf1f42549a5da03f) default parsing now properly parses and uploads - [`f8e201f`](https://github.com/open-webui/open-webui/commit/f8e201f14736736213b3a7f011388f18759d4697) handle all custom parsers and switch to default if none are provided - [`7dd06c6`](https://github.com/open-webui/open-webui/commit/7dd06c60977c30d8420f297da180e6d484e7128d) removed original save function thats now in plugin. moved get_plugin() to correct module. DefaultParser is now named such with proper structure and logging - [`d512a68`](https://github.com/open-webui/open-webui/commit/d512a688b4c16e842fd910eecc8ec3864ea94c6b) Merge branch 'main' of https://github.com/DanielDowns/open-webui into parser_addition - [`39c5512`](https://github.com/open-webui/open-webui/commit/39c55121320396deadb5006b93b4b9541fe0df03) Merge pull request #1 from DanielDowns/parser_addition - [`d06b6d7`](https://github.com/open-webui/open-webui/commit/d06b6d769cb20cb50e452224e3754a6a21903c5d) removed testing print statement - [`b4d94a1`](https://github.com/open-webui/open-webui/commit/b4d94a11cf4028181b47bfa36d935c9a57b1a02f) renamed PARSER_TYPE, modified return of DefaultParser::split, incorrect Parsers now properly throw Exceptions - [`bae2a64`](https://github.com/open-webui/open-webui/commit/bae2a641ee22a4ef37386aebfe7fcc2208ee7a87) added deleting methods to parsers - [`fb6dd86`](https://github.com/open-webui/open-webui/commit/fb6dd8652aff24a66a21de6520049199c7269266) expanded verification to include new methods ### 📊 Changes **10 files changed** (+485 additions, -315 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/functions.py` (+93 -5) 📝 `backend/open_webui/retrieval/utils.py` (+1 -1) 📝 `backend/open_webui/routers/files.py` (+0 -3) 📝 `backend/open_webui/routers/knowledge.py` (+58 -48) 📝 `backend/open_webui/routers/retrieval.py` (+106 -255) 📝 `backend/open_webui/utils/middleware.py` (+3 -0) ➕ `backend/open_webui/utils/parser.py` (+217 -0) 📝 `backend/open_webui/utils/plugin.py` (+3 -1) 📝 `src/lib/apis/files/index.ts` (+1 -1) 📝 `src/lib/components/workspace/Knowledge/KnowledgeBase.svelte` (+3 -1) </details> ### 📄 Description # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request. **Before submitting, make sure you've checked the following:** - [x] **Target branch:** Please verify that the pull request targets the `dev` branch. - [x] **Description:** Provide a concise description of the changes made in this pull request. - [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] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [x] **Testing:** Have you written and run sufficient tests to validate the changes? - [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] **Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following: - **BREAKING CHANGE**: Significant changes that may affect compatibility - **build**: Changes that affect the build system or external dependencies - **ci**: Changes to our continuous integration processes or workflows - **chore**: Refactor, cleanup, or other non-functional code changes - **docs**: Documentation update or addition - **feat**: Introduces a new feature or enhancement to the codebase - **fix**: Bug fix or error correction - **i18n**: Internationalization or localization changes - **perf**: Performance improvement - **refactor**: Code restructuring for better maintainability, readability, or scalability - **style**: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.) - **test**: Adding missing tests or correcting existing tests - **WIP**: Work in progress, a temporary label for incomplete or ongoing work # Changelog Entry ### Description Previously, documents/web searches/videos/etc were all parsed in the same, hard coded manner. Any unique parsing or new ways of parsing required completely ignoring Knowledge to use Pipelines. This allows users to easily add in unique parsing of any information they wish through standard operations. ### Added - new Parser class, with abstract ParserInterface for easier implementation - DefaultParser that will handle parsing if users do not wish to handle it - is also inheritable, allowing users to only modify parts of behavior ### Changed - uploading documents or text now searches for viable Parser functions. If none is found, DefaultParser is used (falls back to LangChain's RecursiveCharacterTextSplitter) ### Contributor License Agreement By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](/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-06 06:03:50 -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#62114