Skip to content

Agent Sessions

When a message arrives on any channel, Selu needs to decide which agent handles it and how long that conversation should stay active. That’s what sessions are for.

Each channel has a default agent assigned to it. When a new conversation starts, messages go to that agent automatically.

If you have multiple agents installed, you can set up routing rules to direct messages based on:

  • Keywords — Route messages containing specific words to a specialized agent.
  • Prefix commands — Messages starting with /agent-name go to that agent.
  • Channel — Different channels can use different default agents.

Configure routing under Settings → Agents → Routing.

A session begins when a user sends their first message and ends when the idle timeout is reached.

The session is active while messages are being exchanged. The agent retains the full conversation context and can refer back to earlier messages.

The idle timeout controls how long a session stays alive without activity. The default is 30 minutes.

To change it:

  1. Go to Settings → Agents → Sessions.
  2. Set the Idle timeout to your preferred duration (e.g., 15 minutes, 1 hour, or 24 hours).
  3. Save your changes.

Shorter timeouts use less memory but mean the agent forgets context sooner. Longer timeouts keep conversations going but use more resources.

Triggers let you start or switch sessions based on events rather than manual routing. For example:

  • Time-based triggers — Activate a specific agent at certain times of day (e.g., a “morning briefing” agent at 8 AM).
  • Event triggers — Switch to a specialized agent when a particular event occurs (e.g., a home automation agent when a sensor fires).
  • Handoff triggers — An agent can hand the conversation off to another agent when it detects a topic outside its expertise.

Set up triggers under Settings → Agents → Triggers.

When multiple agents are available, Selu keeps their sessions separate. Each agent maintains its own conversation context, so switching between agents doesn’t lose progress in either conversation.

You can switch agents mid-conversation by:

  • Using a prefix command like /switch agent-name.
  • Clicking the agent selector in web chat.
  • Configuring automatic handoff triggers.