mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-17 15:53:59 -06:00
[GH-ISSUE #11888] feat: Filter functions that are applied when writing to the database #16390
Reference in New Issue
Block a user
Originally created by @GeorgelPreput on GitHub (Mar 19, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/11888
Check Existing Issues
Problem Description
I would want the full answer from the LLM presented to me when it is streamed from the LLM, but would like that the database only retains data that has been anonymized.
Desired Solution you'd like
I'd like a solution similar to the existing filter functions, only that the filter is applied upon writing and reading from the database.
Application of a destructive anonymization / redaction filter upon the text would, of course, mean that upon the reload of a chat, the PII data would appear anonymized to the user as well. Alternatively, a key might be pulled from an external source to encrypt and decrypt the data as it enters / leaves the database.
Having filter functions applied to the database read / write operations would open up other use cases as well, just out of my current scope.
Alternatives Considered
An alternative that I've seen floated would be to have an "anonymize" Action Function that the user would press. This is not robust, as users would simply forget to press it.
Another more convoluted alternative is to deploy Open WebUI with Postgres, also deploy a pipelining solution (currently looking at n8n), along with an anonymization engine like Presidio, and running a n8n pipeline that anonymizes records asynchronously in the background on a regular basis. I consider this an unfortunately convoluted work-around, but it does work.
Additional Context
No response