Table of Contents

Class AgentDefinition.KnowledgeSettings

Namespace
LMKit.Agents
Assembly
LM-Kit.NET.dll

The knowledge sources an agent definition grounds its answers in, and how: the portable form of AgentKnowledge, made of names and values only, so it travels with the definition.

public sealed class AgentDefinition.KnowledgeSettings
Inheritance
AgentDefinition.KnowledgeSettings
Inherited Members

Examples

definition.Knowledge = new AgentDefinition.KnowledgeSettings
{
    Sources = new List<string> { "support/policies" },
    CitationPolicy = "required",
};

Remarks

Sources are references the host resolves to its own knowledge sources: on an LM-Kit server, Search collections (tenant/collection or a collection id), always resolved under the calling key's own grants, never the definition's author's. A reference is a name, never a credential.

Values are strings so the JSON form stays readable and stable: Mode is always or on_demand, CitationPolicy required or optional, WhenNoEvidence abstain or answer; empty means the first.

Fields

AlwaysMode

Mode value: every user turn is searched. The default.

OnDemandMode

Mode value: the model searches through a tool when it decides to.

Properties

CitationPolicy

Gets or sets how strictly the model must cite: required (default) or optional.

HasSources

Gets whether any source is named.

MaxResults

Gets or sets the most passages one search returns; 0 for the default (5).

Mode

Gets or sets when the sources are searched: always (default) or on_demand.

Sources

Gets or sets the references of the knowledge sources, resolved by the host.

WhenNoEvidence

Gets or sets what the model is told when nothing is found: abstain (default) or answer.

Methods

Clone()

A copy of these settings, their source list included.

ToAgentKnowledge(IKnowledgeRetriever)

The runtime knowledge these settings describe, searching retriever: the ONE mapping every host uses, so a definition grounds alike in-process and on a server.

Validate()

The reason these settings are invalid, or null when they are valid: an unknown mode, citation policy or no-evidence behavior is refused by name, never read as a default.

Share