Skip to content

World State Agent Nodes

World state operations through the world state agent: advance time, run character progression, evaluate queries, extract character sheets and emit the world state to the frontend.

16 nodes.

Node Registry path
Advance Time agents/world_state/AdvanceTime
Character Progression agents/world_state/CharacterProgression
Deactivate Character agents/world_state/DeactivateCharacter
Determine Character Avatar agents/world_state/determineCharacterAvatar
Determine Character Presence agents/world_state/DetermineCharacterPresence
Determine Scene Background agents/world_state/determineSceneBackground
Determine Visual agents/world_state/DetermineVisual
Emit World State agents/world_state/EmitWorldState
Evaluate Query agents/world_state/EvaluateQuery
Extract Character Sheet agents/world_state/ExtractCharacterSheet
On Message Set Background agents/world_state/onMessageSetBackground
Request World State agents/world_state/RequestWorldState
Worldstate Settings agents/world_state/Settings
State Reinforcement agents/world_state/StateReinforcement
Wsh Advance Time agents/world_state/wshAdvanceTime
Wsh Determine Avatar agents/world_state/wshDetermineAvatar

Advance Time

agents/world_state/AdvanceTime

Advances the scene time by the given number of seconds. Pushes a TimePassageMessage to the scene history, emits it to the UI and fires the time passage signal (which other agents may react to, e.g. to narrate the time passage using the narration instructions).

Inputs

Input Type Description
state any The graph state
duration int The duration to advance in seconds (e.g. 3600 for an hour)
narration_instructions str Instructions for narrating the time passage (optional)
chapter_title str Names the chapter this time passage opens (optional)

Outputs

Output Type Description
state any The state input, passed through
duration int The duration of the emitted message
narration_instructions str The narration instructions, passed through
message message The TimePassageMessage that was added to the history

Properties

Property Type Default Description
narration_instructions str "" The instructions for the narration
chapter_title str "" Names the chapter this time passage opens
duration int 1 The duration to advance, in seconds. Min: 0.

Character Progression

agents/world_state/CharacterProgression

Determines character development (new, updated or removed attributes, description updates) via the world_state agent and processes the resulting proposals. With as_suggestions enabled the proposals are added to the world state manager as suggestions for the user to review; otherwise they are applied to the character directly.

Inputs

Input Type Description
state any The graph state
character character The character to progress
instructions str (optional) Instructions guiding the development (required at runtime despite the optional socket)

Outputs

Output Type Description
state any The state input, passed through
calls list The list of proposal calls that were generated

Properties

Property Type Default Description
as_suggestions bool False Whether to return the result as suggestions
instructions text "" Instructions for the character progression

Deactivate Character

agents/world_state/DeactivateCharacter

Deactivates a character from the world state.

Inputs

Input Type Description
state any The current state of the graph
character character The character to deactivate

Outputs

Output Type Description
state any The updated state

Determine Character Avatar

agents/world_state/determineCharacterAvatar

Node module (base type core/Graph) defined in src/talemate/agents/world_state/modules/determine-character-avatar.json.

Inputs

Input Type Description
state any
character character
content str
force_regenerate bool (optional)
force_determine bool (optional)
asset_ctx asset_attachment_context (optional)
automatic_source str (optional)

Outputs

Output Type Description
state any
character character
content str
force_regenerate bool
asset_id str
force_determine bool
asset_ctx asset_attachment_context
automatic_source str

Determine Character Presence

agents/world_state/DetermineCharacterPresence

Determines whether a character is present (and active) or leaving the current scene.

Mode is controlled via the check property: - present: calls world_state.is_character_present(character.name) - leaving: calls world_state.is_character_leaving(character.name)

Inputs

Input Type Description
state any The current graph state
character character The character to check

Outputs

Output Type Description
yes bool True if the condition is met
no bool True if the condition is not met

Properties

Property Type Default Description
check str "present" Which condition to check. Choices: present, leaving.

Determine Scene Background

agents/world_state/determineSceneBackground

Node module (base type core/Graph) defined in src/talemate/agents/world_state/modules/determine-scene-background.json.

Inputs

Input Type Description
state any
content str
automatic_source str (optional)

Outputs

Output Type Description
state any
content str
automatic_source str

Determine Visual

agents/world_state/DetermineVisual

Picks the existing portrait or scene background that fits a message. With World State → Character Portraits (or Scene Backgrounds) → Use Decision Model on, the decision model keeps the current one or picks another existing one when it is sure. Otherwise the supplied prompt runs through Generate Response.

Other inputs and outputs match Generate Response. The extracted asset_id is the picked asset; an empty one from the usual request may ask for a new image. The other extracted values come from that request and are missing when the decision model decided. An extracted references list keeps only the ids of the given assets.

Inputs

Input Type Description
state any
agent agent
prompt prompt
action_type str (optional)
response_length int (optional)
response_spec response/spec (optional)
reasoning_effort str (optional)
disable_reasoning bool (optional)
character character (optional) The character whose portrait is picked (portraits only)
content str The message to pick for
assets list The existing portraits or backgrounds to pick from

Outputs

Output Type Description
state state
agent agent
prompt prompt
response str
data_obj dict,list
captured_context str
rendered_prompt str
response_spec response/spec
extracted dict

Properties

Property Type Default Description
data_output bool False Output the response as a data structure
data_multiple bool False Allow multiple data structures in the response
response_length int 256 The maximum length of the response
action_type str "scene_direction" Classification of the generated response. Choices: analyze, conversation, create, edit, narrate, scene_direction, summarize, visualize, world_state.
attempts int 1 The number of attempts (retry on empty response)
reasoning_effort str "" Reasoning effort for this request; empty uses the client setting. Choices: `,default,none,minimal,low,medium,high,xhigh,max`.
disable_reasoning bool False Turn reasoning off for this request
kind str "portrait" Pick a portrait or a scene background. Choices: portrait, background.

Emit World State

agents/world_state/EmitWorldState

Re-emits the scene's current world state to the frontend so the world state UI refreshes. Does not regenerate or update the world state.

Inputs

Input Type Description
state any The graph state

Outputs

Output Type Description
state any The state input, passed through

Evaluate Query

agents/world_state/EvaluateQuery

Evaluates a query on the world state.

World State → Yes/No Queries → Use Decision Model answers confident queries with the configured decision model. Uncertain or failed decisions use the usual LLM request. With the option off or no decision model, only the LLM is used.

Inputs

Input Type Description
state any The current state of the graph
query str The query to evaluate
context str The context to evaluate the query in

Outputs

Output Type Description
state any The current state
result bool The result of the query

Properties

Property Type Default Description
query str unset The query to evaluate

Extract Character Sheet

agents/world_state/ExtractCharacterSheet

Attempts to extract an attribute based character sheet from a given context for a specific character.

Additionally alteration instructions can be given to modify the character's existing sheet.

Inputs

Input Type Description
state any The current state of the graph
character_name str The name of the character to extract the sheet for
context str The context to extract the sheet from
alteration_instructions str (optional) Instructions to alter the character's sheet

Outputs

Output Type Description
character_sheet dict The extracted character sheet (dict, empty if the model produced nothing)

On Message Set Background

agents/world_state/onMessageSetBackground

Node module (base type core/Event) defined in src/talemate/agents/world_state/modules/on-message-set-background.json.

Properties

Property Type Default Description
event_name str "game_loop_new_message" Event to listen for
auto_register bool True Self-register from the node registry instead of requiring placement in the scene loop graph

Request World State

agents/world_state/RequestWorldState

Requests the current world state.

Inputs

Input Type Description
state any The current state of the graph

Outputs

Output Type Description
state any The current state
world_state dict The world snapshot after the update: characters, items, places and location

Worldstate Settings

agents/world_state/Settings

Base node to render world_state agent settings.

Every setting of the world_state agent is exposed as an output socket named after the setting - see the agent's documentation under Agents for what each setting does.

State Reinforcement

agents/world_state/StateReinforcement

Sets up (or updates) a tracked state reinforcement for a character or the world in general. Adds the reinforcement to the scene's world state, then immediately runs an update, producing a reinforcement message.

Inputs

Input Type Description
state any The current state of the graph
query_or_detail str The question or detail to track
character character (optional) The character to track the state for (optional; when omitted the state is tracked for the world in general)
instructions str Additional instructions for the reinforcement (optional)

Outputs

Output Type Description
state any graph state
message message state reinforcement message
reinforcement world_state/reinforcement the reinforcement that was added or updated

Properties

Property Type Default Description
query_or_detail str "" Query or detail to reinforce
instructions text "" Instructions for the reinforcement
interval int 10 Interval for reinforcement. Min: 1.
insert_method str "sequential" Method to insert reinforcement. Choices: sequential, conversation-context, all-context, never.
reset bool False If the state should be reset

Wsh Advance Time

agents/world_state/wshAdvanceTime

Node module (base type agents/AgentWebsocketHandler) defined in src/talemate/agents/world_state/modules/wsh-advance-time.json.

Outputs

Output Type Description
fn function
name str
allow_multiple_calls bool
ai_callback focal/callback

Properties

Property Type Default Description
name str "advance_time" The name of the handler
agent str "world_state" The agent to register the handler on. Choices are generated at runtime.

Wsh Determine Avatar

agents/world_state/wshDetermineAvatar

Node module (base type agents/AgentWebsocketHandler) defined in src/talemate/agents/world_state/modules/wsh-determine-avatar.json.

Outputs

Output Type Description
fn function
name str
allow_multiple_calls bool
ai_callback focal/callback

Properties

Property Type Default Description
name str "determine_avatar" The name of the handler
agent str "world_state" The agent to register the handler on. Choices are generated at runtime.