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.
How routing works
Section titled “How routing works”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-namego to that agent. - Channel — Different channels can use different default agents.
Configure routing under Settings → Agents → Routing.
Session lifecycle
Section titled “Session lifecycle”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.
When no messages are sent for a period of time, the session enters an idle state. The agent still holds the context but is not actively processing.
Once the idle timeout is reached, the session expires. The next message starts a fresh conversation with no prior context.
Configuring idle timeout
Section titled “Configuring idle timeout”The idle timeout controls how long a session stays alive without activity. The default is 30 minutes.
To change it:
- Go to Settings → Agents → Sessions.
- Set the Idle timeout to your preferred duration (e.g., 15 minutes, 1 hour, or 24 hours).
- 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
Section titled “Triggers”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.
Multi-agent conversations
Section titled “Multi-agent conversations”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.