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 pipe has a default agent. When a new conversation starts, messages go to that agent automatically.
If you have multiple agents installed, you can direct a message to a specific agent by mentioning it:
@weather-agent What's the forecast for tomorrow?When no agent is mentioned, the default agent handles the message. The default agent can also delegate tasks to specialist agents automatically — if it determines another agent is better suited for a request, it hands the task off behind the scenes and returns the result.
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.
Each agent can have its own idle timeout, configured in the agent’s definition file (agent.yaml). If no per-agent timeout is set, the global default applies.
Shorter timeouts use less memory but mean the agent forgets context sooner. Longer timeouts keep conversations going but use more resources.
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 talk to a different agent at any time by @mentioning it in your message. Your previous conversation with the other agent stays intact.