docs/guides/session-guide.md
Back to README
PicoClaw sessions decide which messages share the same conversation history. If your bot "remembers too much" or "forgets too much", the first thing to check is the session configuration.
This guide is for users configuring session behavior in config.json.
For implementation details, see the architecture docs instead.
A session controls:
Session data is stored under your workspace, typically:
~/.picoclaw/workspace/sessions/
This is the default and is the right choice for most bots.
{
"session": {
"dimensions": ["chat"]
}
}
Use this when:
If users in the same group should not share memory, add sender:
{
"session": {
"dimensions": ["chat", "sender"]
}
}
Use this when:
If your channel exposes a space value, you can route by workspace or guild instead of by room:
{
"session": {
"dimensions": ["space"]
}
}
Use this when:
If your channel exposes topic, you can isolate per thread:
{
"session": {
"dimensions": ["chat", "topic"]
}
}
Use this when:
| Dimension | What it means | Good for |
|---|---|---|
space | Workspace, guild, or similar top-level container | One shared assistant across many rooms |
chat | Direct chat, group, or channel | Default per-room isolation |
topic | Thread, topic, or forum sub-channel | Keep threaded discussions separate |
sender | The message sender after normalization | Per-user context inside shared rooms |
Not every channel provides every field.
If a channel does not supply space or topic, those dimensions simply have no effect for that message.
Even if two agents receive messages from the same chat, they do not share one session.
session.dimensions adds finer-grained isolation, but PicoClaw still keeps a baseline separation by:
That means an empty or very small dimensions list does not create one global memory across every platform.
chat modeTelegram forum messages keep topic isolation by default even when dimensions only contains chat.
You usually do not need a special workaround for Telegram forums.
summarize_message_threshold and summarize_token_percent apply inside each session independently.
If you create smaller sessions, summarization also happens on smaller per-session histories.
{
"session": {
"dimensions": ["chat"]
}
}
{
"session": {
"dimensions": ["chat", "sender"]
}
}
{
"session": {
"dimensions": ["space", "sender"]
}
}
This is useful for workspace-wide assistants where each user should keep their own memory while moving across rooms in the same workspace.
You can keep the global default and override it for one dispatch rule:
{
"agents": {
"list": [
{ "id": "main", "default": true },
{ "id": "support" }
],
"dispatch": {
"rules": [
{
"name": "support group",
"agent": "support",
"when": {
"channel": "telegram",
"chat": "group:-1001234567890"
},
"session_dimensions": ["chat", "sender"]
}
]
}
},
"session": {
"dimensions": ["chat"]
}
}
In this example:
session.identity_links helps when the same user may appear under multiple raw sender IDs and you want PicoClaw to treat them as one sender identity.
Example:
{
"session": {
"dimensions": ["chat", "sender"],
"identity_links": {
"john": ["slack:u123", "u123", "legacy-user-42"]
}
}
}
This is mainly useful for:
Current limitation:
identity_links does not make one user share memory across different channels automaticallyYour current session is probably keyed only by chat.
Switch to:
{
"session": {
"dimensions": ["chat", "sender"]
}
}
That is expected.
PicoClaw still separates sessions by channel even if you use sender.
Add topic when the channel provides one:
{
"session": {
"dimensions": ["chat", "topic"]
}
}
That is normal during migration.
PicoClaw keeps compatibility with older agent:... session keys while moving runtime storage to opaque canonical keys.