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 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.

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.

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.

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.