Skip to main content
Sub agents

Shared session for sub-agents

Written By Stanislas

Last updated 16 days ago

Overview

Shared session maintains a continuous child conversation session for a sub-agent when invoked by an orchestrator agent. In Swiftask, this feature is controlled by the Keep sub agent discussion in the same session setting.

When enabled, the orchestrator preserves the sub-agent's conversation history across multiple delegations within the same parent chat or task. The sub-agent retains prior context, generated data, and previous deliverables instead of starting from scratch each time.

When disabled, each invocation runs in an isolated, stateless session. This mode is optimal for independent actions where previous context is irrelevant.


Comparison: Shared session vs. isolated session

Feature

Shared session (Enabled)

Isolated session (Disabled)

Session lifecycle

Continuous child session reused across multiple calls within the same parent thread

Brand new session initialized on every delegation

Context retention

Remembers prior prompts, partial deliverables, search results, and agent memory

Stateless; starts with a clean slate without memory of prior calls

Token efficiency

Highly efficient for iterative workflows; avoids repeating prior instructions

Efficient for one-off tasks; avoids accumulating previous chat history

Auditability & history

Unified chronological timeline in the sub-agent conversation drawer

Disconnected execution cards for each individual call

When to use

Use when tasks require sequential refinements, cumulative data gathering, or ongoing context across multiple steps

Use when calls are self-contained, one-off operations where prior context could introduce unwanted bias or token bloat

Ideal use cases

Multi-turn research, sequential writing, iterative code debugging, data enrichment

Image generation, translation, file conversion, quick independent lookups


Prerequisites

  • Access to the Agents section in your Swiftask workspace

  • An existing orchestrator agent (parent agent)

  • Workspace permissions to configure agents and attach sub-agents


Step-by-step guide

Method 1: Enable shared session when attaching a sub-agent

  1. Navigate to Agents from the left navigation bar and open your parent agent.

  2. In the configuration menu under Agent Instruction, select Sub agents.

  3. Click + Attach sub agent in the top-right corner to open the configuration modal.

  4. Toggle Keep sub agent discussion in the same session to the active position.

Attach sub agent modal with shared session toggle

  1. Fill in the sub-agent skill name, invocation criteria, and select your target agent, then click Attach sub agent.

Method 2: Manage shared session directly from the canvas

  1. In your parent agent settings, go to the Sub agents visual canvas.

  2. Locate the sub-agent card in the visual hierarchy tree.

  3. Switch the Keep sub agent discussion in the same session toggle directly on the node card to activate or deactivate persistence.

Sub agents canvas displaying inline shared session toggle


Practical use cases

Iterative market research: An orchestrator delegates company identification to a research sub-agent. In a follow-up query, the parent agent asks for executive contacts and financial metrics for those companies. With shared session active, the sub-agent references its earlier findings directly without repeating the initial search.

Multi-stage document drafting: A writing sub-agent creates a project brief in the first step. When the parent agent requests refinements to the timeline or budget in subsequent turns, the sub-agent modifies the existing draft while preserving the full editorial context.

Stateless single-purpose tasks (Disabled): An image generation sub-agent produces standalone illustrations from text prompts. Disabling shared session ensures each request starts in a clean environment without carrying forward prior generation prompts or consuming unnecessary token history.


Tips & best practices

  • Activate for multi-turn collaboration: Keep the toggle on whenever a sub-agent needs to refine, expand, or follow up on previous outputs.

  • Deactivate for isolated actions: Turn off shared session for deterministic, standalone tools such as format converters, image generators, or single-turn calculations to reduce context overhead.

  • Inspect execution traces: Use the real-time conversation sidebar or execution cards in chat to view the sub-agent's complete reasoning, tool calls, and session timeline.


Troubleshooting

Sub-agent does not remember prior instructions or outputs
Cause: The Keep sub agent discussion in the same session toggle is switched off on the sub-agent node.
Fix: Open the Sub agents canvas, locate the child agent card, and turn the toggle on.

Context persists across different parent conversations
Cause: Expecting sub-agent sessions to reset while continuing in the same chat thread.
Fix: Sub-agent session continuity is scoped strictly to the current parent chat thread or task. Starting a new conversation automatically initializes a fresh session for all attached sub-agents.


Additional resources

Was this helpful?

Still need help? Ask the team