Skip to content

Narrator Agent Nodes

Generate narration through the narrator agent: scene progress, environment, queries, character entries/exits and time passage.

12 nodes.

Node Registry path
Auto Narration agents/narrator/autoNarration
Generate After Dialog Narration agents/narrator/GenerateAfterDialogNarration
Generate Character Entry Narration agents/narrator/GenerateCharacterEntryNarration
Generate Character Exit Narration agents/narrator/GenerateCharacterExitNarration
Generate Character Narration agents/narrator/GenerateCharacterNarration
Generate Environment Narration agents/narrator/GenerateEnvironmentNarration
Generate Progress Narration agents/narrator/GenerateProgress
Generate Query Narration agents/narrator/GenerateQueryNarration
Generate Scene Narration agents/narrator/GenerateSceneNarration
Generate Time Narration agents/narrator/GenerateTimeNarration
Narrator Settings agents/narrator/Settings
Unpack Source agents/narrator/UnpackSource

Auto Narration

agents/narrator/autoNarration

Node module (base type core/Event) defined in src/talemate/agents/narrator/modules/auto-narration.json.

Properties

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

Generate After Dialog Narration

agents/narrator/GenerateAfterDialogNarration

Generates narration reacting to the most recent line of dialogue, from the perspective of the given character, via the narrator agent's narrate_after_dialogue action.

The generated message is not added to the scene history by this node.

Inputs

Input Type Description
state any The graph state
narrative_direction str (optional) Optional direction the narrative should take
response_length int (optional) Optional response length in tokens (0 for default)
character character The character whose dialogue the narration follows

Outputs

Output Type Description
generated str The generated narration text
message message_object The generated NarratorMessage object

Properties

Property Type Default Description
response_length int 0 Response length (0 for default)
narrative_direction str "" Narrative directions

Generate Character Entry Narration

agents/narrator/GenerateCharacterEntryNarration

Generates narration for a character entering the scene, via the narrator agent's narrate_character_entry action. The node does not activate the character or add the message to the scene history.

Inputs

Input Type Description
state any The graph state
narrative_direction str (optional) Optional direction the narrative should take
response_length int (optional) Optional response length in tokens (0 for default)
character character The character entering the scene

Outputs

Output Type Description
generated str The generated narration text
message message_object The generated NarratorMessage object

Properties

Property Type Default Description
response_length int 0 Response length (0 for default)
narrative_direction str "" Narrative directions

Generate Character Exit Narration

agents/narrator/GenerateCharacterExitNarration

Generates narration for a character exiting the scene, via the narrator agent's narrate_character_exit action. The node does not deactivate the character or add the message to the scene history.

Inputs

Input Type Description
state any The graph state
narrative_direction str (optional) Optional direction the narrative should take
response_length int (optional) Optional response length in tokens (0 for default)
character character The character exiting the scene

Outputs

Output Type Description
generated str The generated narration text
message message_object The generated NarratorMessage object

Properties

Property Type Default Description
response_length int 0 Response length (0 for default)
narrative_direction str "" Narrative directions

Generate Character Narration

agents/narrator/GenerateCharacterNarration

Generates narration describing a specific character, via the narrator agent's narrate_character action.

The generated message is not added to the scene history by this node.

Inputs

Input Type Description
state any The graph state
narrative_direction str (optional) Optional direction the narrative should take
response_length int (optional) Optional response length in tokens (0 for default)
character character The character to narrate

Outputs

Output Type Description
generated str The generated narration text
message message_object The generated NarratorMessage object

Properties

Property Type Default Description
response_length int 0 Response length (0 for default)
narrative_direction str "" Narrative directions

Generate Environment Narration

agents/narrator/GenerateEnvironmentNarration

Generates narration describing the current environment, via the narrator agent's narrate_environment action (which narrates from the player character's perspective).

The generated message is not added to the scene history by this node.

Inputs

Input Type Description
state any The graph state
narrative_direction str (optional) Optional direction the narrative should take
response_length int (optional) Optional response length in tokens (0 for default)

Outputs

Output Type Description
generated str The generated narration text
message message_object The generated NarratorMessage object

Properties

Property Type Default Description
response_length int 0 Response length (0 for default)
narrative_direction str "" Narrative directions

Generate Progress Narration

agents/narrator/GenerateProgress

Generates narration that moves the story forward, via the narrator agent's progress_story action. If no narrative direction is given the narrator will attempt to subtly move the story forward on its own.

The generated message is not added to the scene history by this node.

Inputs

Input Type Description
state any The graph state
narrative_direction str (optional) Optional direction the narrative should take
response_length int (optional) Optional response length in tokens (0 for default)

Outputs

Output Type Description
generated str The generated narration text
message message_object The generated NarratorMessage object

Properties

Property Type Default Description
response_length int 0 Response length (0 for default)
narrative_direction str "" Narrative directions

Generate Query Narration

agents/narrator/GenerateQueryNarration

Generates narration answering a specific question about the scene, via the narrator agent's narrate_query action.

The generated message is not added to the scene history by this node.

Inputs

Input Type Description
state any The graph state
response_length int (optional) Optional response length in tokens (0 for default)
query str The question to answer through narration
extra_context str (optional) Optional additional context to inform the answer

Outputs

Output Type Description
generated str The generated narration text
message message_object The generated NarratorMessage object

Properties

Property Type Default Description
response_length int 0 Response length (0 for default)
narrative_direction str "" Narrative directions

Generate Scene Narration

agents/narrator/GenerateSceneNarration

Generates narration describing the current scene, via the narrator agent's narrate_scene action.

The generated message is not added to the scene history by this node.

Inputs

Input Type Description
state any The graph state
narrative_direction str (optional) Optional direction the narrative should take
response_length int (optional) Optional response length in tokens (0 for default)

Outputs

Output Type Description
generated str The generated narration text
message message_object The generated NarratorMessage object

Properties

Property Type Default Description
response_length int 0 Response length (0 for default)
narrative_direction str "" Narrative directions

Generate Time Narration

agents/narrator/GenerateTimeNarration

Generates narration for a passage of time, via the narrator agent's narrate_time_passage action. The ISO 8601 duration is converted to a human readable string before being handed to the narrator.

The generated message is not added to the scene history by this node, nor does the node advance the scene time.

Inputs

Input Type Description
state any The graph state
narrative_direction str (optional) Optional direction the narrative should take
response_length int (optional) Optional response length in tokens (0 for default)
duration str The time passed as an ISO 8601 duration (e.g. "PT30M")

Outputs

Output Type Description
generated str The generated narration text
message message_object The generated NarratorMessage object

Properties

Property Type Default Description
response_length int 0 Response length (0 for default)
duration str "P0T1S" duration
narrative_direction str "" Narrative directions

Narrator Settings

agents/narrator/Settings

Settings for the narrator agent

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

Unpack Source

agents/narrator/UnpackSource

DEPRECATED - narration messages no longer encode their action in a source string. This node always outputs an empty action name and an empty arguments dict.

Inputs

Input Type Description
source str The narration message source string

Outputs

Output Type Description
action_name str Always an empty string
arguments dict Always an empty dict