@square-restaurant-14664 Exactly, for domain-specific or proprietary knowledge, retrieval isn’t optional. Without upfront context, the model doesn’t even have the semantic grounding to reason correctly.
In Botpress specifically, we handle this with a pre-message hook rather than inside the agent flow. The hook intercepts the incoming message, runs a KB query (chunk-level, top-K only), and stores the result on the event/state (e.g. event.state.retrievedContext).
That variable is then injected into the system or instructions node before the LLM executes, so retrieval always happens before any reasoning or tool logic. From the model’s perspective, the knowledge is just part of the context not a callable tool.
We also cap tokens and avoid document-level fetches to keep attention focused. If nothing relevant is returned, the instructions explicitly allow the model to respond with “insufficient information.”
The key is keeping retrieval deterministic and outside the agent loop. Once you do that, confusion between tools largely disappears.