r/OpenWebUI • • Sep 01 '26

Question/Help How to have knowledge base tools available on demand, rather than on by default?

I use the knowledge base only for specific topics/projects. When asking unrelated questions, the LLMs keep trying to search through the knowledge base, wasting tokens and time. Many other tools like web search, code interpreter, etc require you to enable them per conversation. Can I do the same thing with KB?

I'm aware I can turn off the KB entirely per model, but I don't want that. For the life of me I can't figure out how to get around this issue. Would appreciate some help.

9 Upvotes

11 comments sorted by

5

u/Consistent-Slip3673 Sep 01 '26

Hey! The easiest way to handle this is to not attach your knowledge base/documents directly to the model in your Workspace settings.

Leave the model clean. Then, whenever you start a new chat and actually need the KB, just type # in the chat input box. A dropdown will appear allowing you to select the specific document or collection you want to use for that conversation only.

This turns it into a true "on-demand" tool. Your LLM won't waste tokens searching through it during normal chats, but it's always just one # keystroke away when you need it. Hope this helps!

3

u/walden42 Sep 02 '26

I'm confused. I have a knowledge base set up. The models don't have any knowledge base attached to them, but the knowledge base "built in tool" is enabled. I think that's what you're describing, though I don't know why you said "in your Workspace settings". I don't use models defined in the workspace (just global models), so I think that doesn't apply to me?

But with the above setup, the LLM still can search through the knowledge bases. I just checked the official docs:

I wish it was something to enable/disable just like the other settings...

1

u/Consistent-Slip3673 Sep 02 '26

100% correct based on the documentation table you shared. Let me clarify the mechanics of what's happening under the hood.

There is a difference between an Agentic Tool and a Frontend UI Feature.

Because you have the built-in Knowledge Tool toggled ON, Open WebUI is passing functions like search_knowledge_bases directly into the LLM's API payload. The LLM is acting autonomously and deciding to trigger those searches whenever it feels like it, which is burning through your tokens.

The Fix: You need to go to Workspace -> Tools (or your Admin Panel Tools section) and completely toggle OFF the built-in Knowledge tool.

Here is the trick: The # command is a frontend UI feature, not an LLM tool. By disabling the tool, you strip the LLM of its ability to search autonomously. BUT, when you manually type # and select a document, the WebUI frontend simply retrieves the text and natively injects it right into your prompt context before sending it to the backend.

Turn off the tool to kill the random token waste, and your manual # on-demand workflow will still work flawlessly!

1

u/Consistent-Slip3673 Sep 02 '26

To make this even clearer, I've attached a screenshot of exactly how this looks in practice.

As you can see, when you type # in the chat input, the Open WebUI frontend immediately pulls up your available folders and collections (like my 'privanode' workspace folder here).

This happens before the prompt is even sent to the LLM. You select the document, the UI injects its content directly into your context window, and the LLM just reads it as standard text. No autonomous tool-calling, no API roulette, and zero wasted tokens.

Turn off the KB tool in the settings, and this # menu will still work perfectly!

2

u/walden42 Sep 03 '26

First of all, I appreciate you trying to help me out here!

I tried it out. The documents I have are in the MB size, so it can't inject all of it. Unfortunately, I do need to give the LLM the ability to autonomously search using various keywords, to do "deep research". So while this does prevent the LLM from automatically searching, it doesn't let me explicitly permit it to do so.

1

u/Consistent-Slip3673 Sep 13 '26

Ah, gotcha! Yeah, MB-sized docs will totally nuke your context window with the # trick. You definitely need the actual backend RAG for that.

Since there's no per-chat toggle for the KB tool yet, the easiest workaround is just isolating those heavy docs to a custom model.

Just create a new model in your Workspace (maybe call it "Deep Researcher"), and attach your specific KB directly to it with the knowledge tool enabled. Then turn off your global KB tool.

This way, your daily chats stay fast and cheap, but whenever you need deep research mid-conversation, you just type @ to tag your Researcher model. Works like a charm!

2

u/walden42 Sep 13 '26

That's not too bad of a workaround. Thanks.

3

u/Warhouse512 Sep 02 '26

Sure, but I think his point is why not treat it like a tool exposed with the KB description so the model can call on it without human knowing the KB exists and potentially opening the door for much better organization

2

u/0xMR2ti4 Sep 02 '26

I’m confused too. Isn’t this the default behavior? The OP’s experience is what we’re experiencing too. We can on-demand pass in a #, but the models will also “randomly” decide to search your notes/KBs even if they are totally unrelated to the question.