[GH-ISSUE #23096] feat: Ability to restrict search_chats and tools to a specific folder / subset of conversations #35415

Closed
opened 2026-04-25 09:37:17 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @cedhuf on GitHub (Mar 26, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23096

Check Existing Issues

  • I have searched for all existing open AND closed issues and discussions for similar requests. I have found none that is comparable to my request.

Verify Feature Scope

  • I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions.

Problem Description

Currently, in OpenWebUI, when using tools such as search_chats, the model can access all conversations, regardless of folder organization.

Attempts to limit the model to a specific folder by including the folder name in the query are ineffective:

  • search_chats does not support a folder filter; it only performs a text search over titles and messages.
  • If the model includes the folder name in the query, it may return zero results even if conversations exist in that folder.
  • Prompt-based “mental scoping” can filter the model’s reasoning, but it cannot prevent the tool from making incorrect queries.

This makes it difficult to create project-based workflows where each folder should only have access to a defined subset of conversations.

Desired Solution you'd like

  • search_chats and similar tools should support scoping by folder, tag, or subset of conversations.
  • Queries generated by the model should only access conversations within the specified scope, regardless of how the query is formed.
  • This would allow building project-based isolated workflows, ensuring proper privacy and context management.
  • Summarization or analysis of specific projects without interference from unrelated conversations

Proposed Solutions

  1. Add an official folder_id or scope parameter to search_chats and all relevant tools.
  2. Allow session-level or agent-level scoping, so the model cannot access conversations outside its assigned scope.
  3. Improve tool backend behavior to support context isolation, removing the need for prompt-only filtering.

Alternatives Considered

A practical workaround is to:

  • Force the model to assume that only the folder in question exists.
  • Leave the query empty when calling search_chats for summaries or listings.
  • Apply a “silent filter” in the prompt, instructing the model to ignore any conversations outside the folder, without explicitly stating that some were ignored.

Example Prompt Workaround:

You have access to tools like `search_chats`, but you must act as if only the conversations in the “[FOLDER_NAME]” folder exist. 
When using the tools, you can call them normally, but ignore silently any results that do not belong to this folder, and never mention or use them in your reasoning. 
You can leave the query parameter empty to retrieve all available conversations in this folder. 
All responses, summaries, and reasoning must be based solely on the results from this folder.

Limitations of this workaround:

  • The prompt cannot enforce the tool backend; the model still calls search_chats itself and may generate incorrect queries if not careful.
  • With large folders, the context size may exceed model limits, leading to incomplete summaries or truncated information.
  • It relies entirely on prompt “mental filtering”, which is not fully reliable or enforced at the backend.

Additional Context

This issue addresses a fundamental limitation in tool scoping and would greatly improve OpenWebUI for structured workflows and project-level isolation.

Originally created by @cedhuf on GitHub (Mar 26, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/23096 ### Check Existing Issues - [x] I have searched for all existing **open AND closed** issues and discussions for similar requests. I have found none that is comparable to my request. ### Verify Feature Scope - [x] I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions. ### Problem Description Currently, in OpenWebUI, when using tools such as search_chats, the model can access all conversations, regardless of folder organization. Attempts to limit the model to a specific folder by including the folder name in the query are ineffective: - search_chats does not support a folder filter; it only performs a text search over titles and messages. - If the model includes the folder name in the query, it may return zero results even if conversations exist in that folder. - Prompt-based “mental scoping” can filter the model’s reasoning, but it cannot prevent the tool from making incorrect queries. This makes it difficult to create project-based workflows where each folder should only have access to a defined subset of conversations. ### Desired Solution you'd like - search_chats and similar tools should support scoping by folder, tag, or subset of conversations. - Queries generated by the model should only access conversations within the specified scope, regardless of how the query is formed. - This would allow building project-based isolated workflows, ensuring proper privacy and context management. - Summarization or analysis of specific projects without interference from unrelated conversations ### Proposed Solutions 1. Add an official folder_id or scope parameter to search_chats and all relevant tools. 2. Allow session-level or agent-level scoping, so the model cannot access conversations outside its assigned scope. 3. Improve tool backend behavior to support context isolation, removing the need for prompt-only filtering. ### Alternatives Considered A practical workaround is to: - Force the model to assume that only the folder in question exists. - Leave the query empty when calling search_chats for summaries or listings. - Apply a “silent filter” in the prompt, instructing the model to ignore any conversations outside the folder, without explicitly stating that some were ignored. Example Prompt Workaround: ``` You have access to tools like `search_chats`, but you must act as if only the conversations in the “[FOLDER_NAME]” folder exist. When using the tools, you can call them normally, but ignore silently any results that do not belong to this folder, and never mention or use them in your reasoning. You can leave the query parameter empty to retrieve all available conversations in this folder. All responses, summaries, and reasoning must be based solely on the results from this folder. ``` Limitations of this workaround: - The prompt cannot enforce the tool backend; the model still calls search_chats itself and may generate incorrect queries if not careful. - With large folders, the context size may exceed model limits, leading to incomplete summaries or truncated information. - It relies entirely on prompt “mental filtering”, which is not fully reliable or enforced at the backend. ### Additional Context This issue addresses a fundamental limitation in tool scoping and would greatly improve OpenWebUI for structured workflows and project-level isolation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#35415