Skip to main content

LLM Agent

To get support by the Visual Studio Code extension, create a file with the name *.agent.yml or *.agent.yaml.

version: "0.1"
structure:
id: "my-agent"
action: ...
constants: { ... }
slots: [...]

Root Structure

The root configuration object for an LLM Agent.

PropertyTypeRequiredDescription
versionstringYesFixed to "0.1".
structureAgent StructureYesThe agent structure definition.

Agent Structure

The agent structure configuration object.

PropertyTypeRequiredDescription
idstringYesUnique identifier for the LLM agent (structure).
actionStepYesThe root step (often a chain).
constantsobjectNoConstants available to all steps.
slotsarrayNoPreloads for slots before execution. List of LoadToSlot.

LoadToSlot

Pre-loads data into slots when the agent starts.

PropertyTypeRequiredDescription
namestringYesThe name of the slot to populate.
sourceValueSourceYesThe source of the value.

Example

version: "0.1"
structure:
id: simple-chat
constants:
greeting: "Hello there!"
action:
id: main
message:
message: "{{greeting}}"

Steps

A Step defines a unit of work. Every step must have an id and may optionally have conditions. In addition to the common properties, a Step MUST define exactly one of the specific action properties (e.g., message, llm, chain, combined, etc.).

Common Properties

PropertyTypeRequiredDescription
idstringYesUnique identifier for the step.
conditionsarrayNoList of Condition.

If any condition fails, the step is skipped.

Message Step

Sends a message to the user.

PropertyTypeRequiredDescription
messageMessageBodyYesConfiguration for the message.

MessageBody

PropertyTypeRequiredDescription
messagestringYesThe text content. Supports templates.
holdbooleanNoHold the conversation after this message. Default: false.

LLM Step

Invokes a Large Language Model and streams the response.

PropertyTypeRequiredDescription
llmLlmBodyYesConfiguration for the LLM call.

LlmBody

PropertyTypeRequiredDescription
promptsarrayYesList of Prompt.
modelstringNoOverrides the default model.
temperaturenumberNoSampling temperature.
memoryarrayNoList of Selection to include in context.
memory-limitintegerNoMax tokens/messages from memory?
storeSaveTargetNoWhere to save the LLM response (optional).
holdbooleanNoHold the conversation after this message. Default: false.
skip-prefixbooleanNoDeprecated.

Chain Step

Executes a sequence of steps.

PropertyTypeRequiredDescription
chainarray<Step>YesA list of Steps to execute in order.

Combined Step

Executes multiple steps in parallel. Use with care due to potential interference.

PropertyTypeRequiredDescription
combinedarray<Step>YesSteps to execute concurrently (in parallel).

Flow Step

Controls the execution flow (goto or result).

PropertyTypeRequiredDescription
flowFlowBodyYesFlow control definition.

FlowBody

PropertyTypeRequiredDescription
gotostringNoThe ID of the step to jump to.
actionstringNo"continue" or "repeat".

Note: One of goto or action is required. IDs of chain steps are not allowed in goto. Use the ID of the first step within the chain instead.

SetSlot Step

Sets values in slots.

PropertyTypeRequiredDescription
set-slotSetSlotBodyYesConfiguration for setting slots.

SetSlotBody

PropertyTypeRequiredDescription
valuesarrayYesList of SlotValuePair.

APICall Step

Performs an HTTP API call.

PropertyTypeRequiredDescription
api-callApiBodyYesConfiguration for the API call.

ApiBody

PropertyTypeRequiredDescription
urlstringYesTarget URL.
methodstringYesHTTP Method (GET, POST, PUT, DELETE).
headersarrayNoList of headers.

Header format:

PropertyTypeRequiredDescription
keystringYesHeader name.
valueTemplateYesHeader value (templated).
bodystringNoRequest body (template supported).
response-pathstringNoPath to extract from JSON response.
targetSaveTargetYesWhere to save the result.
successFlowYesFlow to execute on success.
failFlowYesFlow to execute on failure.

SSECall Step

Connects to a Server-Sent Events stream.

PropertyTypeRequiredDescription
sse-callSseBodyYesSSE configuration.

SseBody

PropertyTypeRequiredDescription
urlstringYesTarget URL.
methodstringYesHTTP Method (GET, POST, PUT, DELETE).
headersarrayNoList of headers.
bodyTemplateNoRequest body (template supported).
response-pathstringNoPath to extract from SSE messages.
storeSaveTargetNoWhere to save incoming SSE data (optional).

Validator Step

Validates the conversation or state against goals.

PropertyTypeRequiredDescription
validatorValidatorBodyYesValidation configuration.

ValidatorBody

PropertyTypeRequiredDescription
goalsarrayYesList of ConversationGoal.
typestringNo"all" or "any".
successFlowYesFlow if validation passes.
failFlowYesFlow if validation fails.

Extractor Step

Extracts structured data using an LLM.

PropertyTypeRequiredDescription
extractorExtractorBodyYesExtraction configuration.

ExtractorBody

PropertyTypeRequiredDescription
valuesarrayYesList of ExtractionValues schemas.

ExtractionValues

PropertyTypeRequiredDescription
descriptionTemplateYesDescription of the value to extract.
typestringNoType (string by default).
enumarray<string>NoAllowed values (optional).
examplesarray<Template>NoFew-shot examples.
itemsExtractionSchemaNoItem schema if type is an array.
propertiesobject<string, ExtractionSchema>NoObject schema if type is object.
targetSaveTargetYesWhere to save the extracted value.

ExtractionSchema

PropertyTypeRequiredDescription
descriptionTemplateYesDescription of the value to extract.
typestringNoType (string by default).
enumarray<string>NoAllowed values (optional).
examplesarray<Template>NoFew-shot examples.
itemsExtractionSchemaNoItem schema if type is an array.
propertiesobject<string, ExtractionSchema>NoObject schema if type is object.
successFlowYesFlow on success.
failFlowYesFlow on failure.

Retriever Step

Retrieves documents from the collection.

PropertyTypeRequiredDescription
retrieverRetrieverBodyYesRetrieval configuration.

RetrieverBody

PropertyTypeRequiredDescription
querySlotPathYesSlot containing the query.
targetSaveTargetYesWhere to save results.
limitintegerNoMax results. Default: 4.
secondarybooleanNoWhether to use secondary document stores. Default: true.

CounterStep

Increments a counter.

PropertyTypeRequiredDescription
counterCounterBodyYesCounter configuration.

CounterBody

PropertyTypeRequiredDescription
slotSlotPathYesThe slot to increment.

Common Types

Condition

PropertyTypeRequiredDescription
namestringYesName of the condition/slot to check.
conditionConditionOperationYesThe check to perform.
destinationstringNoDestination of the slot. Default: "conversation".
global`booleanNoDeprecated: use destination instead.

ConditionOperation

One of:

  • { "equals": value }
  • { "not-equals": value }
  • { "exists": boolean }
  • { "greater-than": number }
  • { "less-than": number }
  • { "greater-than-or-equal": number }
  • { "less-than-or-equal": number }

Prompt

Defines a message in the LLM context. One of:

  • system: Template (System prompt)
  • user: Template (User prompt)
  • a-i: Template (AI response)
  • constant: string (Include a named constant)

Selection

Selects context/memory. One of:

  • { "selector": "current" | "all" }
  • { "from": "string" } (Selects from a specific source/ID)

SaveTarget

PropertyTypeRequiredDescription
slotSlotPathYesThe slot to write to.

SlotPath

PropertyTypeRequiredDescription
namestringYesSlot name.
destinationstringNoDestination of the slot: "conversation" (default), "global", "session", "module".
global`booleanNoDeprecated: use destination instead.

SlotValuePair

PropertyTypeRequiredDescription
pathSlotPathYesThe slot to set.
valueTemplateYesThe value to set (supports templates).

ValueSource

One of:

SessionPath

PropertyTypeRequiredDescription
sessionSelectionNoSession selector. Default: Current session.
moduleSelectionNoModule selector. Default: Current module.
pathstringYesPath to the value.

ModulePath

PropertyTypeRequiredDescription
moduleSelectionNoModule selector. Default: Current module.
pathstringYesPath to the value.

UserPath

PropertyTypeRequiredDescription
pathstringYesPath to the value.

Flow

Used for success/fail handlers. One of:

  • { "goto": "step-id" }
  • { "action": "continue" | "repeat" }

Note: IDs of chain steps are not allowed in goto. Use the ID of the first step within the chain instead.

Template

Templates can contain placeholders for slot injection. Syntax: {{destination.slot_name}}.

Destinations can be global, module, session, conversation. If no destination is provided, conversation is used by default.

SummarizerStep

Summarizes the current conversation and stores it into a slot (commonly summary).

PropertyTypeRequiredDescription
summarizerSummarizerBodyYesSummarization configuration.

SummarizerBody

PropertyTypeRequiredDescription
promptsarray<Prompt>NoList of prompts guiding the summary.
modelstringNoOverrides the default model.
temperaturenumberNoSampling temperature.
memoryarray<Selection>NoMemory selection to include.
memory-limitintegerNoLimit of memory entries to consider.
skip-prefixbooleanNoWhether to skip prefixing.
typeappend/replaceNoUpdate type when writing the summary to the slot.