Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
docs(session): document external session storage
Xubin Ren45245b5e5533
diff --git a/docs/architecture.md b/docs/architecture.mdindex afe23fc8d..2158ef8be 100644--- a/docs/architecture.md+++ b/docs/architecture.md@@ -149,7 +149,7 @@ Defaults:|---|---|| Config | `~/.nanobot/config.json` || Workspace | `~/.nanobot/workspace/` |-| Sessions | `<workspace>/sessions/*.jsonl` |+| Sessions | `~/.nanobot/sessions/<workspace-hash>/*.jsonl` || Memory | `<workspace>/memory/` || Cron store | `<workspace>/cron/jobs.json` || WebUI/media/log runtime data | config directory subdirectories such as `webui/`, `media/`, and `logs/` |@@ -164,7 +164,7 @@ a WebUI chat may select a separate project:| Concern | Path owner ||---|---|-| Sessions, `SOUL.md`, `USER.md`, memory, and custom skills | Configured agent workspace |+| Session namespace, `SOUL.md`, `USER.md`, memory, and custom skills | Configured agent workspace || Project `AGENTS.md`, relative tool paths, and shell working directory | Effective project workspace || Workspace access mode and project metadata | Session workspace scope |@@ -180,7 +180,7 @@ Session history is the near-term conversation replay. Memory is the longer-term| Store | File area ||---|---|-| Session JSONL files | `<workspace>/sessions/` |+| Session JSONL files | `~/.nanobot/sessions/<workspace-hash>/` || Long-term memory | `<workspace>/memory/MEMORY.md` || Consolidation source history | `<workspace>/memory/history.jsonl` || Bootstrap identity files | `<workspace>/SOUL.md`, `<workspace>/USER.md`, templates under `nanobot/templates/` |diff --git a/docs/concepts.md b/docs/concepts.mdindex 068d83933..ac65a9ab4 100644--- a/docs/concepts.md+++ b/docs/concepts.md@@ -26,7 +26,8 @@ The default instance lives under `~/.nanobot/`:| Path | Meaning ||---|---|| `~/.nanobot/config.json` | Instance configuration: providers, model defaults, channels, tools, gateway, API, and runtime options |-| `~/.nanobot/workspace/` | Agent workspace: memory, sessions, heartbeat tasks, cron jobs, skills, and generated artifacts |+| `~/.nanobot/workspace/` | Agent workspace: memory, heartbeat tasks, cron jobs, skills, and generated artifacts |+| `~/.nanobot/sessions/<workspace-hash>/` | Session history stored outside the agent-accessible workspace and namespaced by its canonical path |You can override both with command flags:@@ -125,7 +126,7 @@ nanobot uses two related stores:| Store | Location | Purpose ||---|---|---|-| Sessions | `<workspace>/sessions/*.jsonl` | Recent conversation turns replayed into context |+| Sessions | `~/.nanobot/sessions/<workspace-hash>/*.jsonl` | Recent conversation turns replayed into context || Memory | `<workspace>/memory/MEMORY.md` and `<workspace>/memory/history.jsonl` | Long-term facts and consolidated history |Dream is a periodic consolidation job. It reads accumulated history and updates workspace memory so useful context can survive beyond short session replay.diff --git a/docs/deployment.md b/docs/deployment.mdindex f9dbf65b5..63f78c506 100644--- a/docs/deployment.md+++ b/docs/deployment.md@@ -11,7 +11,7 @@ Check these once before Render, Docker, systemd, or LaunchAgent:| `nanobot status` shows the expected config and workspace | Confirms the process will read the instance you meant to run || `nanobot agent -m "Hello!"` works | Proves install, config, provider, model, and workspace writes before adding a service layer || Secrets are in environment variables or protected config files | API keys, bot tokens, OAuth state, and chat credentials should not be world-readable |-| `~/.nanobot/` or your custom config/workspace path is persistent | Sessions, memory, channel login state, generated artifacts, and cron jobs live there |+| `~/.nanobot/` (including `sessions/`) and any custom config/workspace paths are persistent | Sessions, memory, channel login state, generated artifacts, and cron jobs live there || Channel access control is intentional | Use `allowFrom`, pairing, WebSocket `token`/`tokenIssueSecret`, or private test channels before exposing the bot || Ports are planned | Gateway health defaults to local-only `127.0.0.1:18790`; WebUI/WebSocket defaults to `8765`; `nanobot serve` defaults to `8900` || Logs are easy to reach | Use `docker compose logs`, `journalctl`, LaunchAgent log files, or `nanobot gateway --verbose` while diagnosing startup |diff --git a/docs/guides/deploy-nanobot-gateway.md b/docs/guides/deploy-nanobot-gateway.mdindex e58c132bb..3353e9201 100644--- a/docs/guides/deploy-nanobot-gateway.md+++ b/docs/guides/deploy-nanobot-gateway.md@@ -47,8 +47,8 @@ nanobot gateway logs- Docker Compose is the most repeatable Linux container path.- systemd user services are useful for Linux user-level gateway deployments.- macOS LaunchAgent keeps the gateway alive after login.-- Persist config, workspace, sessions, memory files, channel login state, and- generated artifacts.+- Persist `~/.nanobot/sessions/` together with config, workspace, memory files,+ channel login state, and generated artifacts.- Restart the gateway after editing `config.json`.## Security notesdiff --git a/docs/quick-start.md b/docs/quick-start.mdindex 92add6256..adf4a3d62 100644--- a/docs/quick-start.md+++ b/docs/quick-start.md@@ -48,7 +48,8 @@ The WebUI launcher creates or updates:| Path | Purpose ||---|---|| `~/.nanobot/config.json` | Provider, model, WebUI, channel, tool, and runtime settings |-| `~/.nanobot/workspace/` | Sessions, memory, skills, automations, and generated files |+| `~/.nanobot/workspace/` | Memory, skills, automations, and generated files |+| `~/.nanobot/sessions/<workspace-hash>/` | Recent session history, isolated by canonical workspace path |If the installer did not open the browser, run:diff --git a/docs/troubleshooting.md b/docs/troubleshooting.mdindex a60089376..1501af0ce 100644--- a/docs/troubleshooting.md+++ b/docs/troubleshooting.md@@ -319,7 +319,7 @@ See [`chat-apps.md`](./chat-apps.md) for channel-specific setup.|---|---|| Conversation context seems wrong | Confirm the active workspace and session. WebUI chats and chat app threads may use different sessions. || Memory does not update immediately | Dream consolidation is periodic; recent turns still live in session history. |-| Old sessions appear after moving config | Session files are stored under `<workspace>/sessions/`; verify the workspace path. |+| Old sessions appear after moving config | Session files are stored under `~/.nanobot/sessions/<workspace-hash>/`; verify the canonical workspace path recorded in the directory's `.workspace` marker. || You want one shared session across devices | Set `agents.defaults.unifiedSession` intentionally; otherwise keep separate sessions. |## Collect Useful Evidence