mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
2 lines
9.8 KiB
JavaScript
2 lines
9.8 KiB
JavaScript
import{_ as s,o as t,c as o,ag as n}from"./chunks/framework.CAXxHpAX.js";const g=JSON.parse('{"title":"Sessions","description":"","frontmatter":{},"headers":[],"relativePath":"getting-started/sessions.md","filePath":"getting-started/sessions.md","lastUpdated":1776332711000}'),a={name:"getting-started/sessions.md"};function i(r,e,l,c,h,d){return t(),o("div",null,[...e[0]||(e[0]=[n('<h1 id="sessions" tabindex="-1">Sessions <a class="header-anchor" href="#sessions" aria-label="Permalink to "Sessions""></a></h1><p>A <strong>Session</strong> is an independent conversation thread between a user and a bot. Each session maintains its own context window and message history, allowing the bot to focus on a specific topic or task without interference from other conversations.</p><hr><h2 id="concept-conversation-isolation" tabindex="-1">Concept: Conversation Isolation <a class="header-anchor" href="#concept-conversation-isolation" aria-label="Permalink to "Concept: Conversation Isolation""></a></h2><p>When you chat with a bot, your messages are grouped into a session. The bot uses the session's history to maintain context. Starting a new session resets this context, giving you a fresh conversation without losing the previous one.</p><p>Sessions are scoped per bot — each bot manages its own set of sessions independently.</p><hr><h2 id="session-types" tabindex="-1">Session Types <a class="header-anchor" href="#session-types" aria-label="Permalink to "Session Types""></a></h2><p>Memoh uses five session types to separate different kinds of bot activity:</p><table tabindex="0"><thead><tr><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Chat</strong></td><td>Standard user-initiated conversations. This is the default session type when chatting with a bot.</td></tr><tr><td><strong>Discuss</strong></td><td>Observation-oriented conversation mode. The bot may stay silent by default and only speaks when it decides to send a real reply into the conversation.</td></tr><tr><td><strong>Heartbeat</strong></td><td>Automatically created when a bot's heartbeat triggers. Contains the bot's periodic autonomous activity.</td></tr><tr><td><strong>Schedule</strong></td><td>Created when a scheduled task fires. Contains the bot's execution of a cron-triggered command.</td></tr><tr><td><strong>Subagent</strong></td><td>Created when the bot delegates a task to a subagent. Contains the subagent's independent work context.</td></tr></tbody></table><p>Only <strong>Chat</strong> and <strong>Discuss</strong> sessions are directly created from user conversation routes. The other session types are system-managed and appear as read-only records in the session list.</p><h3 id="chat-vs-discuss" tabindex="-1">Chat vs Discuss <a class="header-anchor" href="#chat-vs-discuss" aria-label="Permalink to "Chat vs Discuss""></a></h3><p><code>chat</code> and <code>discuss</code> are the two session types you are most likely to see in normal conversation threads.</p><p><strong>Chat</strong> means:</p><ul><li>the conversation behaves like a normal direct assistant exchange</li><li>users expect a visible reply when they send a prompt</li><li>this is the default in the Web UI and in direct-message style conversations</li></ul><p><strong>Discuss</strong> means:</p><ul><li>the bot is observing an ongoing conversation, often in a group</li><li>the model's direct text output is treated as internal monologue</li><li>the bot only speaks to the conversation when it explicitly issues a <code>send</code> action</li><li>staying silent is valid and often desirable</li></ul><p>In practice, <code>discuss</code> is what makes Memoh feel less like a synchronous chatbot and more like a participant that can decide whether to join in.</p><hr><h2 id="starting-a-new-session-with-new" tabindex="-1">Starting a New Session with <code>/new</code> <a class="header-anchor" href="#starting-a-new-session-with-new" aria-label="Permalink to "Starting a New Session with `/new`""></a></h2><p>The <code>/new</code> slash command creates a fresh session on the current conversation route, resetting the active session context without deleting old history.</p><p>Supported forms:</p><ul><li><code>/new</code> — create a new session using the default session type for the current context</li><li><code>/new chat</code> — force a normal chat session</li><li><code>/new discuss</code> — force a discuss session</li></ul><p>Default routing behavior:</p><ul><li><strong>Web UI local chat</strong> defaults to <code>chat</code></li><li><strong>private conversations</strong> default to <code>chat</code></li><li><strong>group conversations on channel adapters</strong> default to <code>discuss</code></li></ul><p><code>/new discuss</code> is not supported from the built-in Web UI local channel. Use a real channel adapter such as Telegram, Discord, or Misskey if you want to explicitly create discuss sessions.</p><p>This works across supported channels:</p><h3 id="in-external-channels-telegram-discord-feishu-etc" tabindex="-1">In External Channels (Telegram, Discord, Feishu, etc.) <a class="header-anchor" href="#in-external-channels-telegram-discord-feishu-etc" aria-label="Permalink to "In External Channels (Telegram, Discord, Feishu, etc.)""></a></h3><p>Send <code>/new</code>, <code>/new chat</code>, or <code>/new discuss</code> as a message to the bot. The bot will:</p><ol><li>Create a new session of the requested or inferred type.</li><li>Route all subsequent messages from you to this new session.</li><li>The previous session's history is preserved but no longer active.</li></ol><p>This is especially useful when:</p><ul><li>You want to change topics without the bot referencing old context.</li><li>The conversation has become too long and you want a clean start.</li><li>You are switching between different tasks.</li></ul><h3 id="in-the-web-ui" tabindex="-1">In the Web UI <a class="header-anchor" href="#in-the-web-ui" aria-label="Permalink to "In the Web UI""></a></h3><p>The Web UI provides a session sidebar where you can:</p><ul><li>Click the <strong>New Session</strong> button to create a fresh chat session.</li><li>Switch between existing sessions by clicking on them.</li><li>Search sessions by content.</li><li>Filter sessions by type (<code>chat</code>, <code>discuss</code>, <code>heartbeat</code>, <code>schedule</code>, <code>subagent</code>).</li><li>Rename or delete sessions.</li></ul><hr><h2 id="managing-sessions" tabindex="-1">Managing Sessions <a class="header-anchor" href="#managing-sessions" aria-label="Permalink to "Managing Sessions""></a></h2><h3 id="viewing-sessions" tabindex="-1">Viewing Sessions <a class="header-anchor" href="#viewing-sessions" aria-label="Permalink to "Viewing Sessions""></a></h3><p>In the Web UI, the session sidebar lists all sessions for the currently selected bot. Each entry shows:</p><ul><li><strong>Title</strong> — The session name (auto-generated or user-defined).</li><li><strong>Type</strong> — The session type icon.</li><li><strong>Last Activity</strong> — When the session was last active.</li></ul><p>For everyday chat use, <code>chat</code> and <code>discuss</code> sessions are intentionally shown together because they both represent user-facing conversation threads.</p><h3 id="renaming-sessions" tabindex="-1">Renaming Sessions <a class="header-anchor" href="#renaming-sessions" aria-label="Permalink to "Renaming Sessions""></a></h3><p>Click on a session title to rename it. This helps organize conversations by topic.</p><h3 id="deleting-sessions" tabindex="-1">Deleting Sessions <a class="header-anchor" href="#deleting-sessions" aria-label="Permalink to "Deleting Sessions""></a></h3><p>Remove sessions you no longer need. Deleting a session removes its message history permanently.</p><hr><h2 id="session-status-panel" tabindex="-1">Session Status Panel <a class="header-anchor" href="#session-status-panel" aria-label="Permalink to "Session Status Panel""></a></h2><p>The session status panel provides a compact runtime summary for the active session. It is the same information surfaced by <code>/status</code>.</p><p>Key fields include:</p><ul><li><strong>Messages</strong> — total message count in the session</li><li><strong>Context Usage</strong> — current used tokens relative to the selected model's <code>context_window</code></li><li><strong>Cache Hit Rate</strong> — how much of the input came from cache reads</li><li><strong>Cache Read / Cache Write</strong> — token counts associated with caching</li><li><strong>Skills</strong> — effective skills used by the session</li></ul><p>The panel also exposes <strong>Compact Now</strong>, which triggers immediate <a href="/getting-started/compaction.html">Context Compaction</a> for the current session.</p><hr><h2 id="how-sessions-relate-to-other-features" tabindex="-1">How Sessions Relate to Other Features <a class="header-anchor" href="#how-sessions-relate-to-other-features" aria-label="Permalink to "How Sessions Relate to Other Features""></a></h2><ul><li><strong>Discuss</strong> sessions are optimized for channels where the bot should observe and selectively speak, especially in group conversations.</li><li><strong>Heartbeat</strong> sessions are created on each heartbeat trigger. You can view what the bot did during its autonomous activity by opening the corresponding heartbeat session.</li><li><strong>Schedule</strong> sessions are created when a scheduled task runs. Check these to see the results of cron-triggered commands.</li><li><strong>Subagent</strong> sessions track delegated tasks. They show the independent work context of each subagent invocation.</li><li><strong>Memory</strong> is shared across all sessions for a bot — memories extracted from one session are available in all others.</li></ul>',54)])])}const p=s(a,[["render",i]]);export{g as __pageData,p as default};
|