Skip to content

Commit 4f356a3

Browse files
committed
docs: describe machine-labeled session sources
Add a filesystem-sync guide covering structured [[session_sources]] entries and document the attribution contract in the README and configuration guide: a label is fixed when a session is first ingested, and sync --full preserves it rather than acting as a relabel operation.
1 parent 3a576c4 commit 4f356a3

5 files changed

Lines changed: 224 additions & 2 deletions

File tree

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,29 @@ March 2026), which shares that same database. *Kilo (legacy)* is the legacy
480480
RooCode-derived VS Code extension that wrote per-task JSON under
481481
`kilocode.kilo-code/tasks/`.
482482

483+
## Filesystem Session Sync
484+
485+
One primary AgentsView instance can ingest native agent session directories
486+
copied or mounted from other machines without PostgreSQL:
487+
488+
```toml
489+
[[session_sources]]
490+
agent = "copilot"
491+
dir = "/srv/session-archive/buildbox/copilot"
492+
machine = "buildbox"
493+
```
494+
495+
Structured sources are additive to existing `copilot_dirs`,
496+
`claude_project_dirs`, and other per-agent settings. They label sessions by
497+
source machine without namespacing native session IDs. Transport source session
498+
files only -- never copy `sessions.db` or its WAL files. Machine labels are
499+
captured at first ingestion; ordinary sync and `agentsview sync --full` preserve
500+
the stored label. Changing attribution for existing sessions is not currently
501+
supported.
502+
503+
See the [Filesystem Session Sync guide](https://agentsview.io/filesystem-sync/)
504+
for Git, rsync, shared-mount, freshness, and operational guidance.
505+
483506
## PostgreSQL Sync
484507

485508
Push session data to a shared PostgreSQL instance for team dashboards:
@@ -633,6 +656,7 @@ Full docs at **[agentsview.io](https://agentsview.io)**:
633656
[Usage Guide](https://agentsview.io/usage/) --
634657
[CLI Reference](https://agentsview.io/commands/) --
635658
[Configuration](https://agentsview.io/configuration/) --
659+
[Filesystem Sync](https://agentsview.io/filesystem-sync/) --
636660
[Architecture](https://agentsview.io/architecture/)
637661

638662
______________________________________________________________________

docs/configuration.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ daemon_idle_timeout = "20m"
7777
| `[vector]` | Opt-in semantic-search index; model settings live in `[vector.embeddings]`, named endpoints in `[vector.embeddings.servers.<name>]`, embedding schedule in `[vector.embed]` — see [Semantic Search](/semantic-search/#enabling-vector) for every key |
7878
| `[recall.extract]` | Opt-in model-backed recall extraction; named endpoints in `[recall.extract.servers.<name>]`, prompt selection in `[recall.extract.prompts]`, request overrides in `[recall.extract.request]` — see [Recall](/recall/#automatic-extraction) |
7979
| `[[remote_hosts]]` | Remote machines synced by a bare `agentsview sync` — see [CLI Reference](/commands/#agentsview-sync) |
80+
| `[[session_sources]]` | Additional filesystem session roots with per-root machine labels — see [Filesystem Session Sync](/filesystem-sync/) |
8081
| `[automated]` | Custom automated-session patterns — see [Automated Session Detection](#automated-session-detection) |
8182
| `[custom_model_pricing]` | Per-model price overrides for usage reports — see [Custom Model Pricing](/token-usage/#custom-model-pricing) |
8283

@@ -655,6 +656,32 @@ default path.
655656

656657
All listed directories are discovered, watched, and synced independently.
657658

659+
### Machine-Labeled Filesystem Sources
660+
661+
Use `[[session_sources]]` when a root was produced on another machine and
662+
transported to this AgentsView host:
663+
664+
```toml
665+
[[session_sources]]
666+
agent = "copilot"
667+
dir = "/srv/session-archive/buildbox/copilot"
668+
machine = "buildbox"
669+
```
670+
671+
The fields are `agent`, `dir`, and optional `machine`. Entries are additive to
672+
the per-agent arrays, defaults, and environment variables above. Exact duplicate
673+
roots are deduplicated; a structured entry supplies the machine label when it
674+
duplicates a shorthand root. An omitted `machine` uses the local hostname.
675+
676+
Machine attribution is captured when each session is first ingested. Changing
677+
an entry's `machine` value affects newly discovered sessions but does not
678+
relabel existing sessions during ordinary syncs or `agentsview sync --full`.
679+
Changing attribution for existing sessions is not currently supported.
680+
681+
See [Filesystem Session Sync](/filesystem-sync/) for multi-machine examples,
682+
transport safety, ID deduplication, watcher behavior, and the comparison with
683+
PostgreSQL.
684+
658685
### S3-Compatible Session Sources
659686

660687
Claude and Codex session roots can also be `s3://` URIs. This is useful when

docs/filesystem-sync.md

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
______________________________________________________________________
2+
3+
## title: Filesystem Session Sync description: View sessions from multiple machines by transporting native agent session directories to one AgentsView instance
4+
5+
AgentsView can label filesystem session roots with the machine that produced
6+
them. This supports a simple multi-machine topology without PostgreSQL:
7+
8+
1. Each source machine writes its normal agent session files.
9+
1. Git, rsync, a file-copy job, or a shared filesystem transports those native
10+
layouts out of band.
11+
1. One primary AgentsView instance scans the received roots into its local
12+
SQLite archive.
13+
14+
This is a **primary-viewer topology**. Use [PostgreSQL sync](/pg-sync/) instead
15+
when several viewers need a shared live database or a read-only database-backed
16+
endpoint.
17+
18+
## Configure Session Sources
19+
20+
Add one `[[session_sources]]` table per received agent root:
21+
22+
```toml
23+
[[session_sources]]
24+
agent = "copilot"
25+
dir = "/srv/session-archive/buildbox/copilot"
26+
machine = "buildbox"
27+
28+
[[session_sources]]
29+
agent = "claude"
30+
dir = "/srv/session-archive/buildbox/claude/projects"
31+
machine = "buildbox"
32+
33+
[[session_sources]]
34+
agent = "codex"
35+
dir = "/srv/session-archive/laptop/codex/sessions"
36+
machine = "laptop"
37+
```
38+
39+
`agent` must be a supported AgentsView parser name. `dir` must be a filesystem
40+
root in that agent's native layout. `machine` uses the same machine label shown
41+
in session filters and configured by `[pg].machine_name`. If `machine` is
42+
omitted, AgentsView uses the primary viewer's hostname.
43+
44+
Existing per-agent arrays and environment variables remain supported. Structured
45+
sources are additive:
46+
47+
```toml
48+
copilot_dirs = ["/home/viewer/.copilot"]
49+
50+
[[session_sources]]
51+
agent = "copilot"
52+
dir = "/srv/session-archive/buildbox/copilot"
53+
machine = "buildbox"
54+
```
55+
56+
AgentsView normalizes roots for duplicate comparison. Legacy per-agent settings
57+
and structured entries retain their original path spelling. When a structured
58+
source names the same root as a per-agent array, default, or environment
59+
variable, the structured entry supplies the machine label.
60+
61+
`session_sources` accepts filesystem roots only. Keep using the existing
62+
Claude/Codex per-agent arrays for `s3://` roots; S3 ingestion has established
63+
machine-derived ID-prefix behavior that differs from filesystem labeling. Native
64+
SQLite-backed agent stores are supported when `dir` points at their filesystem
65+
root.
66+
67+
## Transport Rules
68+
69+
Sync the **source agent's session files and native directory layout**. Never
70+
copy AgentsView's `sessions.db`, `sessions.db-wal`, `sessions.db-shm`, or
71+
`vectors.db`. Those files belong to the primary viewer and copying a live SQLite
72+
database or WAL can corrupt or fork the archive.
73+
74+
For every destination source tree:
75+
76+
- Have one writer. Multiple transport jobs must not update the same tree.
77+
- Transfer into a staging path, then rename or switch the completed tree into
78+
place when possible.
79+
- Preserve filenames, relative paths, and companion metadata files.
80+
- Avoid exposing partially copied files. AgentsView retries changed files, but
81+
atomic publication prevents transient parse errors and incomplete sessions.
82+
- Treat the primary copy as read-only input to AgentsView.
83+
84+
## Transport Examples
85+
86+
The transport is independent of AgentsView. These examples show the directory
87+
shape; adapt scheduling and authentication to your environment.
88+
89+
### Git
90+
91+
Commit native session trees on the source machine, pull into a staging checkout
92+
on the primary machine, then atomically replace the published checkout:
93+
94+
```text
95+
session-archive/
96+
├── buildbox/
97+
│ ├── claude/projects/...
98+
│ └── copilot/session-state/...
99+
└── laptop/
100+
└── codex/sessions/...
101+
```
102+
103+
Git is most suitable for modest archives where commit history is useful. Avoid
104+
running AgentsView against a checkout while `git pull` is rewriting it; publish
105+
a completed checkout or worktree instead. Session files can contain prompts,
106+
tool output, and source excerpts, so use access controls appropriate for
107+
sensitive data.
108+
109+
### rsync or File Copy
110+
111+
Copy each machine into its own destination tree. `--delay-updates` reduces the
112+
window in which completed files appear partially updated:
113+
114+
```bash
115+
rsync -a --delete --delay-updates \
116+
source-host:/home/user/.copilot/ \
117+
/srv/session-archive/buildbox/copilot/
118+
```
119+
120+
For transports without delayed updates, copy to a sibling staging directory and
121+
rename it into place. Do not let two sources use the same destination tree.
122+
123+
### NFS or Shared Mount
124+
125+
Mount each source machine's exported session directory on the primary viewer,
126+
preferably read-only:
127+
128+
```toml
129+
[[session_sources]]
130+
agent = "claude"
131+
dir = "/mnt/sessions/buildbox/claude/projects"
132+
machine = "buildbox"
133+
134+
[[session_sources]]
135+
agent = "copilot"
136+
dir = "/mnt/sessions/laptop/copilot"
137+
machine = "laptop"
138+
```
139+
140+
Shared mounts remove the copy step, but freshness and watcher behavior depend on
141+
the filesystem. Some network filesystems do not deliver local filesystem events
142+
reliably; the periodic sync remains the backstop.
143+
144+
## Identity, Filtering, and Freshness
145+
146+
- The machine label is stored per discovered source root. Filter sessions by
147+
`machine` in the session browser, API, and analytics views.
148+
- A session keeps the machine label it received when it was first ingested.
149+
Editing a source's `machine` value affects newly discovered sessions but does
150+
not retroactively relabel existing ones, even when their source files later
151+
change. `agentsview sync --full` also preserves the stored label. Changing
152+
attribution for existing sessions is not currently supported.
153+
- Filesystem machine labels do **not** namespace session IDs. If the same native
154+
session is copied into two configured roots, AgentsView continues to
155+
deduplicate it by the agent's native session ID.
156+
- A newly transported or changed file is normally detected by the filesystem
157+
watcher. AgentsView also performs a full periodic sync every 15 minutes.
158+
- Roots that cannot be watched fall back to polling, as described under
159+
[Large Watch Trees](/configuration/#large-watch-trees).
160+
- A machine label changes attribution, not source identity or conflict
161+
resolution. Do not intentionally place different sessions with the same native
162+
ID in separate roots.
163+
- Deleting a transported source file does not automatically erase the archived
164+
session. The local SQLite database is a persistent archive; use pruning tools
165+
when removal is intended.
166+
167+
Filesystem sync is intentionally simple: one primary AgentsView owns the archive
168+
and UI. PostgreSQL remains the better fit for independently running AgentsView
169+
instances that must contribute to or read from a shared live store.

docs/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ See [Activity](/activity/) for the full reference.
185185
AgentsView reads the session files that your
186186
[AI coding agents](/configuration/#session-discovery) leave on your machine and
187187
gives you a local-first desktop and web app to work with them. By default
188-
everything stays on your machine. Optionally, [PostgreSQL sync](/pg-sync/) can
189-
push session data to a shared database for team or multi-machine setups.
188+
everything stays on your machine. For multi-machine use, a primary viewer can
189+
read [out-of-band filesystem copies](/filesystem-sync/), or
190+
[PostgreSQL sync](/pg-sync/) can push session data to a shared database.
190191

191192
<div class="grid cards" markdown>
192193

docs/zensical.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ nav = [
3333
{"Semantic Search Internals" = "semantic-search-internals.md"},
3434
{"Recall (Experimental)" = "recall.md"},
3535
{"Remote Access" = "remote-access.md"},
36+
{"Filesystem Session Sync" = "filesystem-sync.md"},
3637
{"PostgreSQL Sync" = "pg-sync.md"},
3738
{"DuckDB Mirror" = "duckdb.md"},
3839
{"Changelog" = "changelog.md"},

0 commit comments

Comments
 (0)