Package com.tnsai.rag

Class ChatKnowledgeBindingValidator

java.lang.Object
com.tnsai.rag.ChatKnowledgeBindingValidator

public final class ChatKnowledgeBindingValidator extends Object
The one rule a chat knowledge binding must meet before it grounds a conversation, whoever installs it: an agent, its builder or an integration.

A binding is valid for an owner when

  • a declaration backs it: it is not undeclared;
  • it belongs to that exact owner: its owner id equals the owner's id when the caller knows one, and its exact owner object, when it was created with one, is the owner itself;
  • every source it searches is an enabled SEARCH entry of the owner's chat knowledge, as KnowledgeDeclarations.chatScope(List) reads it, so a GRAPH entry never backs a binding;
  • it searches the MEMORY entry alone or only the other SEARCH entries, since a chat turn searches the two kinds each on its own; and
  • its topK equals the topK the SEARCH entries of its kind declare, merged field by field over KnowledgeDeclarations.chatSearchDefaults() as the agent wires them.
Knowledge an AgentBuilder gives is layered into the same entries first, so it is checked the same way.
Since:
0.18.0