thalamus-memory 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- thalamus_memory-0.1.0/.gitignore +43 -0
- thalamus_memory-0.1.0/LICENSE +21 -0
- thalamus_memory-0.1.0/PKG-INFO +318 -0
- thalamus_memory-0.1.0/README.md +271 -0
- thalamus_memory-0.1.0/pyproject.toml +157 -0
- thalamus_memory-0.1.0/src/thalamus/__init__.py +3 -0
- thalamus_memory-0.1.0/src/thalamus/__main__.py +9 -0
- thalamus_memory-0.1.0/src/thalamus/arch/__init__.py +40 -0
- thalamus_memory-0.1.0/src/thalamus/arch/deadends.py +1036 -0
- thalamus_memory-0.1.0/src/thalamus/arch/extractor.py +366 -0
- thalamus_memory-0.1.0/src/thalamus/arch/findings.py +136 -0
- thalamus_memory-0.1.0/src/thalamus/arch/growth.py +301 -0
- thalamus_memory-0.1.0/src/thalamus/arch/metrics.py +196 -0
- thalamus_memory-0.1.0/src/thalamus/arch/model.py +464 -0
- thalamus_memory-0.1.0/src/thalamus/arch/references.py +625 -0
- thalamus_memory-0.1.0/src/thalamus/arch/routes.py +361 -0
- thalamus_memory-0.1.0/src/thalamus/archive/__init__.py +59 -0
- thalamus_memory-0.1.0/src/thalamus/archive/store.py +312 -0
- thalamus_memory-0.1.0/src/thalamus/cli.py +4926 -0
- thalamus_memory-0.1.0/src/thalamus/console/__init__.py +6 -0
- thalamus_memory-0.1.0/src/thalamus/console/ceremonies.py +1052 -0
- thalamus_memory-0.1.0/src/thalamus/console/dispatch.py +747 -0
- thalamus_memory-0.1.0/src/thalamus/console/distill.py +701 -0
- thalamus_memory-0.1.0/src/thalamus/console/occasion_cost.py +190 -0
- thalamus_memory-0.1.0/src/thalamus/console/panes.py +253 -0
- thalamus_memory-0.1.0/src/thalamus/console/readiness.py +136 -0
- thalamus_memory-0.1.0/src/thalamus/console/room_capabilities.py +158 -0
- thalamus_memory-0.1.0/src/thalamus/console/rooms.py +418 -0
- thalamus_memory-0.1.0/src/thalamus/console/server.py +2623 -0
- thalamus_memory-0.1.0/src/thalamus/console/static/PLEX-OFL.txt +93 -0
- thalamus_memory-0.1.0/src/thalamus/console/static/app.js +3419 -0
- thalamus_memory-0.1.0/src/thalamus/console/static/icon-192.png +0 -0
- thalamus_memory-0.1.0/src/thalamus/console/static/icon-512.png +0 -0
- thalamus_memory-0.1.0/src/thalamus/console/static/index.html +276 -0
- thalamus_memory-0.1.0/src/thalamus/console/static/manifest.webmanifest +16 -0
- thalamus_memory-0.1.0/src/thalamus/console/static/plex-mono-400.woff2 +0 -0
- thalamus_memory-0.1.0/src/thalamus/console/static/plex-mono-600.woff2 +0 -0
- thalamus_memory-0.1.0/src/thalamus/console/static/plex-sans-400.woff2 +0 -0
- thalamus_memory-0.1.0/src/thalamus/console/static/plex-sans-600.woff2 +0 -0
- thalamus_memory-0.1.0/src/thalamus/console/static/style.css +1417 -0
- thalamus_memory-0.1.0/src/thalamus/console/static/sw.js +51 -0
- thalamus_memory-0.1.0/src/thalamus/console/sweep.py +134 -0
- thalamus_memory-0.1.0/src/thalamus/console/tmux.py +88 -0
- thalamus_memory-0.1.0/src/thalamus/console/transcript.py +505 -0
- thalamus_memory-0.1.0/src/thalamus/console/windows.py +405 -0
- thalamus_memory-0.1.0/src/thalamus/contract/__init__.py +5 -0
- thalamus_memory-0.1.0/src/thalamus/contract/boundaries.py +414 -0
- thalamus_memory-0.1.0/src/thalamus/contract/capabilities.py +202 -0
- thalamus_memory-0.1.0/src/thalamus/contract/conformance.py +1160 -0
- thalamus_memory-0.1.0/src/thalamus/contract/manifest.py +548 -0
- thalamus_memory-0.1.0/src/thalamus/contract/ontology.py +445 -0
- thalamus_memory-0.1.0/src/thalamus/contract/ownership.py +104 -0
- thalamus_memory-0.1.0/src/thalamus/contract/paths.py +91 -0
- thalamus_memory-0.1.0/src/thalamus/contract/pinning.py +275 -0
- thalamus_memory-0.1.0/src/thalamus/contract/probes.py +348 -0
- thalamus_memory-0.1.0/src/thalamus/eval/__init__.py +8 -0
- thalamus_memory-0.1.0/src/thalamus/eval/attribution.py +484 -0
- thalamus_memory-0.1.0/src/thalamus/eval/conditioning.py +154 -0
- thalamus_memory-0.1.0/src/thalamus/eval/cost.py +290 -0
- thalamus_memory-0.1.0/src/thalamus/eval/gremlin.py +564 -0
- thalamus_memory-0.1.0/src/thalamus/eval/legibility.py +41 -0
- thalamus_memory-0.1.0/src/thalamus/eval/pins.py +302 -0
- thalamus_memory-0.1.0/src/thalamus/eval/policy.py +216 -0
- thalamus_memory-0.1.0/src/thalamus/eval/profile.py +501 -0
- thalamus_memory-0.1.0/src/thalamus/eval/rankers.py +139 -0
- thalamus_memory-0.1.0/src/thalamus/eval/rates.py +168 -0
- thalamus_memory-0.1.0/src/thalamus/eval/reflex.py +437 -0
- thalamus_memory-0.1.0/src/thalamus/eval/report.py +431 -0
- thalamus_memory-0.1.0/src/thalamus/eval/snapshots.py +403 -0
- thalamus_memory-0.1.0/src/thalamus/eval/sync.py +621 -0
- thalamus_memory-0.1.0/src/thalamus/eval/traces.py +354 -0
- thalamus_memory-0.1.0/src/thalamus/eval/uses.py +481 -0
- thalamus_memory-0.1.0/src/thalamus/eval/vocabulary.py +166 -0
- thalamus_memory-0.1.0/src/thalamus/eval/withholding.py +477 -0
- thalamus_memory-0.1.0/src/thalamus/examples/experts/literature.yaml +43 -0
- thalamus_memory-0.1.0/src/thalamus/examples/experts/qe.yaml +41 -0
- thalamus_memory-0.1.0/src/thalamus/examples/presets/budget.yaml +17 -0
- thalamus_memory-0.1.0/src/thalamus/examples/presets/cost.yaml +11 -0
- thalamus_memory-0.1.0/src/thalamus/graph/docker-compose.yml +47 -0
- thalamus_memory-0.1.0/src/thalamus/graph/gremlin-server.yaml +31 -0
- thalamus_memory-0.1.0/src/thalamus/graph/thalamus-graph.groovy +7 -0
- thalamus_memory-0.1.0/src/thalamus/graph/tinkergraph.properties +21 -0
- thalamus_memory-0.1.0/src/thalamus/harness/__init__.py +1 -0
- thalamus_memory-0.1.0/src/thalamus/harness/agentic.py +477 -0
- thalamus_memory-0.1.0/src/thalamus/harness/agents.py +481 -0
- thalamus_memory-0.1.0/src/thalamus/harness/bootstrap.py +206 -0
- thalamus_memory-0.1.0/src/thalamus/harness/budget.py +329 -0
- thalamus_memory-0.1.0/src/thalamus/harness/closes.py +235 -0
- thalamus_memory-0.1.0/src/thalamus/harness/codex_models.py +145 -0
- thalamus_memory-0.1.0/src/thalamus/harness/codex_transcripts.py +737 -0
- thalamus_memory-0.1.0/src/thalamus/harness/consultation.py +607 -0
- thalamus_memory-0.1.0/src/thalamus/harness/cursor_store.py +555 -0
- thalamus_memory-0.1.0/src/thalamus/harness/cursor_transcripts.py +675 -0
- thalamus_memory-0.1.0/src/thalamus/harness/delegate.py +170 -0
- thalamus_memory-0.1.0/src/thalamus/harness/extraction.py +1854 -0
- thalamus_memory-0.1.0/src/thalamus/harness/extractor_policy.py +469 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/budget.sh +59 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/conditioning.sh +189 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/graph-guard.sh +214 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/gremlin-guard.sh +145 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/gremlin-tap.sh +58 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/pin-engaged.sh +39 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/post-tool-use.sh +51 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/recipe-stage.sh +90 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/reflex-pointer-tap.sh +136 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/reflex.sh +127 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/resolve-scope.sh +416 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/role-guard.sh +317 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/room-command-guard.sh +156 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/room-guard.sh +118 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/session-end.sh +246 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/session-start.sh +248 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/timestamp.sh +22 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/claude-code/write-guard.sh +150 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/budget.sh +11 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/conditioning.sh +26 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/graph-guard.sh +20 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/gremlin-guard.sh +22 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/gremlin-tap.sh +31 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/pin-engaged.sh +20 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/post-tool-use.sh +21 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/recipe-stage.sh +29 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/resolve-scope.sh +60 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/role-guard.sh +116 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/room-command-guard.sh +19 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/session-end.sh +146 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/session-start.sh +176 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/timestamp.sh +19 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/codex/write-guard.sh +13 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/conditioning.sh +72 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/distill.sh +126 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/graph-guard.sh +56 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/gremlin-guard.sh +58 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/gremlin-tap.sh +29 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/inject.sh +84 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/mcp-tap.sh +47 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/pin-engaged.sh +30 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/readiness-pending.sh +53 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/readiness-ready.sh +66 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/resolve-scope.sh +118 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/room-command-guard.sh +61 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/session-end.sh +60 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/session-start.sh +108 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/spool.sh +59 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/timestamp.sh +33 -0
- thalamus_memory-0.1.0/src/thalamus/harness/hooks/cursor/write-guard.sh +56 -0
- thalamus_memory-0.1.0/src/thalamus/harness/ingest.py +1051 -0
- thalamus_memory-0.1.0/src/thalamus/harness/install.py +2522 -0
- thalamus_memory-0.1.0/src/thalamus/harness/launch_policy.py +317 -0
- thalamus_memory-0.1.0/src/thalamus/harness/launcher.py +545 -0
- thalamus_memory-0.1.0/src/thalamus/harness/ledger_io.py +51 -0
- thalamus_memory-0.1.0/src/thalamus/harness/mcp_server.py +622 -0
- thalamus_memory-0.1.0/src/thalamus/harness/pin.py +777 -0
- thalamus_memory-0.1.0/src/thalamus/harness/propagation.py +136 -0
- thalamus_memory-0.1.0/src/thalamus/harness/quick.py +890 -0
- thalamus_memory-0.1.0/src/thalamus/harness/reflex.py +882 -0
- thalamus_memory-0.1.0/src/thalamus/harness/reflex_channel.py +385 -0
- thalamus_memory-0.1.0/src/thalamus/harness/reflex_note.py +101 -0
- thalamus_memory-0.1.0/src/thalamus/harness/reflex_queue.py +177 -0
- thalamus_memory-0.1.0/src/thalamus/harness/reflex_worker.py +634 -0
- thalamus_memory-0.1.0/src/thalamus/harness/rescope.py +258 -0
- thalamus_memory-0.1.0/src/thalamus/harness/retrieval.py +263 -0
- thalamus_memory-0.1.0/src/thalamus/harness/status.py +217 -0
- thalamus_memory-0.1.0/src/thalamus/harness/transcripts.py +689 -0
- thalamus_memory-0.1.0/src/thalamus/pulse/__init__.py +1 -0
- thalamus_memory-0.1.0/src/thalamus/pulse/metrics.py +869 -0
- thalamus_memory-0.1.0/src/thalamus/pulse/static/PLEX-OFL.txt +93 -0
- thalamus_memory-0.1.0/src/thalamus/pulse/static/icon-192.png +0 -0
- thalamus_memory-0.1.0/src/thalamus/pulse/static/icon-512.png +0 -0
- thalamus_memory-0.1.0/src/thalamus/pulse/static/icon.svg +39 -0
- thalamus_memory-0.1.0/src/thalamus/pulse/static/index.html +1153 -0
- thalamus_memory-0.1.0/src/thalamus/pulse/static/manifest.webmanifest +16 -0
- thalamus_memory-0.1.0/src/thalamus/pulse/static/plex-mono-400.woff2 +0 -0
- thalamus_memory-0.1.0/src/thalamus/pulse/static/plex-mono-600.woff2 +0 -0
- thalamus_memory-0.1.0/src/thalamus/pulse/static/plex-sans-400.woff2 +0 -0
- thalamus_memory-0.1.0/src/thalamus/pulse/static/plex-sans-600.woff2 +0 -0
- thalamus_memory-0.1.0/src/thalamus/pulse/web.py +174 -0
- thalamus_memory-0.1.0/src/thalamus/snapshotting.py +158 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/__init__.py +6 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/artifact_audit.py +169 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/artifact_paths.py +207 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/claim_address_repair.py +312 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/project_repair.py +380 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/query.py +330 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/reader.py +1558 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/scan_retirement.py +191 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/schema.py +718 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/snapshot.py +65 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/source_retirement.py +173 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/spans.py +303 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/vocabulary.py +459 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/witnesses.py +123 -0
- thalamus_memory-0.1.0/src/thalamus/substrate/writer.py +1236 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# The graph and the evidence archive are PRIVATE and are NEVER shipped. Every
|
|
2
|
+
# install is fresh, for everyone: the graph is one operator's session history,
|
|
3
|
+
# and the archive holds their retained transcripts verbatim. Both live outside
|
|
4
|
+
# the tree by design (a named Docker volume; ~/.thalamus/), so these patterns
|
|
5
|
+
# guard against a stray `snapshot --path ./…` or a hand-copied archive rather
|
|
6
|
+
# than against normal operation.
|
|
7
|
+
# Anchored on purpose: an unanchored `archive/` would swallow the archive
|
|
8
|
+
# *module* under src/, and `thalamus-graph*` would swallow the server's
|
|
9
|
+
# config/thalamus-graph.groovy. Both are tracked code.
|
|
10
|
+
*.kryo
|
|
11
|
+
*.gryo
|
|
12
|
+
/thalamus-graph-data/
|
|
13
|
+
/archive/
|
|
14
|
+
/.thalamus/
|
|
15
|
+
|
|
16
|
+
# Python
|
|
17
|
+
__pycache__/
|
|
18
|
+
*.pyc
|
|
19
|
+
*.pyo
|
|
20
|
+
.venv/
|
|
21
|
+
dist/
|
|
22
|
+
*.egg-info/
|
|
23
|
+
.ruff_cache/
|
|
24
|
+
.pytest_cache/
|
|
25
|
+
|
|
26
|
+
# Node
|
|
27
|
+
frontend/node_modules/
|
|
28
|
+
frontend/.vite/
|
|
29
|
+
frontend/dist/
|
|
30
|
+
.idea/
|
|
31
|
+
|
|
32
|
+
# Derived pinned-agent definitions (thalamus pin) — the manifest is the source of truth
|
|
33
|
+
.claude/agents/thalamus-*.md
|
|
34
|
+
|
|
35
|
+
# Concurrent-session worktrees and per-machine harness settings. Ignored here rather
|
|
36
|
+
# than only in .git/info/exclude because hatchling's sdist walk reads .gitignore and
|
|
37
|
+
# nothing else: without these, `uv build` sweeps every in-progress branch checkout and
|
|
38
|
+
# the local permission list into a publishable archive.
|
|
39
|
+
.claude/worktrees/
|
|
40
|
+
.claude/settings.local.json
|
|
41
|
+
|
|
42
|
+
# qe findings — session-generated triage and corpus drafts, not the shipped suite.
|
|
43
|
+
/tests/qe/findings/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jackson Porter
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: thalamus-memory
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Federated graph memory for coding agents — with a trust model and a measured utility loop
|
|
5
|
+
Project-URL: Homepage, https://github.com/Ybx-jp/thalamus
|
|
6
|
+
Project-URL: Repository, https://github.com/Ybx-jp/thalamus
|
|
7
|
+
Project-URL: Issues, https://github.com/Ybx-jp/thalamus/issues
|
|
8
|
+
Author: Jackson Porter
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agents,evaluation,gremlin,knowledge-graph,llm,memory
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: MacOS
|
|
17
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Requires-Dist: fastapi>=0.139.0
|
|
23
|
+
Requires-Dist: fastmcp>=3.4.0
|
|
24
|
+
Requires-Dist: gremlinpython<3.8,>=3.7
|
|
25
|
+
Requires-Dist: pydantic>=2.0
|
|
26
|
+
Requires-Dist: pyyaml>=6.0
|
|
27
|
+
Requires-Dist: uvicorn[standard]>=0.51.0
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: claims-ledger>=0.0.4; extra == 'dev'
|
|
30
|
+
Requires-Dist: httpx>=0.28.1; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
32
|
+
Requires-Dist: pytest-xdist>=3.6; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
35
|
+
Requires-Dist: ty==0.0.74; extra == 'dev'
|
|
36
|
+
Provides-Extra: frames
|
|
37
|
+
Requires-Dist: numpy>=2.1; extra == 'frames'
|
|
38
|
+
Requires-Dist: pillow>=10.0; extra == 'frames'
|
|
39
|
+
Requires-Dist: scipy>=1.14; extra == 'frames'
|
|
40
|
+
Provides-Extra: nli
|
|
41
|
+
Requires-Dist: sentence-transformers>=3.3; extra == 'nli'
|
|
42
|
+
Requires-Dist: torch>=2.5; extra == 'nli'
|
|
43
|
+
Requires-Dist: transformers>=4.46; extra == 'nli'
|
|
44
|
+
Provides-Extra: pdf
|
|
45
|
+
Requires-Dist: pypdf>=5.0; extra == 'pdf'
|
|
46
|
+
Description-Content-Type: text/markdown
|
|
47
|
+
|
|
48
|
+
# Thalamus
|
|
49
|
+
|
|
50
|
+
Memory for coding agents that can show where each thing it remembers came from.
|
|
51
|
+
|
|
52
|
+
When a Claude Code, Cursor or codex session ends, Thalamus reads the transcript and
|
|
53
|
+
writes what happened into a graph database: the decisions and the reasons for them, the
|
|
54
|
+
problems and how they were fixed, and the work left unfinished. The next session starts
|
|
55
|
+
with the unfinished work in front of it and can search the rest.
|
|
56
|
+
|
|
57
|
+
Every stored item points back to the session or document it came from, and that
|
|
58
|
+
transcript or document is kept unedited outside the graph. Each item also records whose
|
|
59
|
+
word it rests on: yours, the agent's own reasoning, or a document the agent read. That
|
|
60
|
+
record is what lets you ask the agent why it believes something and get an answer you
|
|
61
|
+
can check.
|
|
62
|
+
|
|
63
|
+
What it does not show yet is that recalled memory makes an agent finish tasks better.
|
|
64
|
+
It shows that memory gets surfaced; the [status](#status) section says what would
|
|
65
|
+
settle the rest.
|
|
66
|
+
|
|
67
|
+
The name is from the brain: the thalamus relays nearly every signal bound for a
|
|
68
|
+
specialized region of the cortex, and gates what gets through.
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
session ends → transcript read → decisions, fixes and open work written to the graph
|
|
72
|
+
↓
|
|
73
|
+
next session starts with the open work and can search the rest
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## How it works
|
|
77
|
+
|
|
78
|
+
The project has its own vocabulary, and every term below is defined in
|
|
79
|
+
[Concepts](docs/concepts.md). This section uses as little of it as it can.
|
|
80
|
+
|
|
81
|
+
### Memory writes itself when a session ends
|
|
82
|
+
|
|
83
|
+
You don't curate it. A hook reads the retained transcript and extracts claims (a
|
|
84
|
+
decision, a problem, a fix) and open threads (work the session did not finish). The
|
|
85
|
+
next session opens already knowing where you left off.
|
|
86
|
+
|
|
87
|
+
### Where an item came from decides how far it is trusted
|
|
88
|
+
|
|
89
|
+
Every item carries a trust tier: 0 for what you wrote down yourself, 1 for what an agent
|
|
90
|
+
observed or worked out in its own sessions, 2 for outside documents from sources you
|
|
91
|
+
approved, and 3 for outside content from anywhere else.
|
|
92
|
+
|
|
93
|
+
The data model defines an item's effective trust as the lowest tier anywhere in what it
|
|
94
|
+
was derived from, so an agent's summary of a paper is trusted like the
|
|
95
|
+
paper.<!-- (A0051, cites-as-live) -->
|
|
96
|
+
No code computes that rule across a whole chain of derivations yet.
|
|
97
|
+
|
|
98
|
+
What is enforced today is narrower. When a session fetched pages with the agent's web
|
|
99
|
+
tools, the claims that rest on those pages are stored at outside-document
|
|
100
|
+
trust.<!-- (A0052, cites-as-live) -->
|
|
101
|
+
The extractor marks them, and a mechanical check also catches a claim that repeats the
|
|
102
|
+
page's wording when the mark is missing. A page fetched through the shell, and a claim
|
|
103
|
+
that restates a page in different words, are not caught.
|
|
104
|
+
|
|
105
|
+
Recalled items come back quoted, with their source and tier attached: they inform the
|
|
106
|
+
agent and never instruct it.<!-- (A0054, cites-as-live) -->
|
|
107
|
+
|
|
108
|
+
### Each specialist keeps its own memory
|
|
109
|
+
|
|
110
|
+
Knowledge is split by domain. Each specialist, called an expert (a literature reviewer,
|
|
111
|
+
a quality engineer, an architect), has its own graph of curated documents plus its own
|
|
112
|
+
session history, and the pair is called a scope. A session runs as exactly one scope,
|
|
113
|
+
fixed when the session starts.<!-- (A0001, cites-as-live) -->
|
|
114
|
+
Asking another expert is a recorded consultation, never a search that happens to reach
|
|
115
|
+
across.<!-- (A0094, cites-as-live) -->
|
|
116
|
+
|
|
117
|
+
### A bad write is refused, not filtered later
|
|
118
|
+
|
|
119
|
+
One set of rules, the federation contract, is at once the data schema, the permission
|
|
120
|
+
system and the trust boundary. A write that breaks it is rejected when it is written,
|
|
121
|
+
rather than filtered out when it is read.<!-- (A0025, cites-as-live) -->
|
|
122
|
+
|
|
123
|
+
### You can see what memory cost
|
|
124
|
+
|
|
125
|
+
Every memory lookup is logged<!-- (A0097, cites-as-live) -->
|
|
126
|
+
and priced. `thalamus pulse` serves a live dashboard of what retrieval actually
|
|
127
|
+
cost.<!-- (A0085, cites-as-live) -->
|
|
128
|
+
|
|
129
|
+
## Quick start
|
|
130
|
+
|
|
131
|
+
Your graph starts empty and stays yours. Thalamus ships no seed graph, no export and
|
|
132
|
+
no fixture corpus: a graph is one operator's session history, so every install is
|
|
133
|
+
fresh, for everyone.
|
|
134
|
+
|
|
135
|
+
### Prerequisites
|
|
136
|
+
|
|
137
|
+
| | Why |
|
|
138
|
+
|---|---|
|
|
139
|
+
| **Docker** | runs the graph (Gremlin Server on TinkerGraph) |
|
|
140
|
+
| **Python ≥3.11** and [**uv**](https://docs.astral.sh/uv/) | the package and its CLI |
|
|
141
|
+
| **jq** | every hook parses its stdin with it; without it the hook layer dies silently |
|
|
142
|
+
| **A coding-agent CLI**: Claude Code (`claude`), Cursor (`agent`), codex (`codex`), or any mix | distillation shells out to it |
|
|
143
|
+
|
|
144
|
+
The console additionally needs **tmux**: it runs pinned sessions as tmux windows
|
|
145
|
+
([docs/console.md](docs/console.md)).
|
|
146
|
+
|
|
147
|
+
### Install
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
git clone https://github.com/Ybx-jp/thalamus && cd thalamus
|
|
151
|
+
|
|
152
|
+
docker compose up -d # the graph, on 127.0.0.1:8182; no licence, no account
|
|
153
|
+
uv sync --extra dev # creates .venv with the package and its CLI
|
|
154
|
+
uv run thalamus init # wire your editor, then verify what it wired
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
The graph answers a few seconds after `up -d` returns, because Docker publishes the
|
|
158
|
+
port before the server finishes starting. `docker compose ps` says `healthy` when it is
|
|
159
|
+
actually serving.
|
|
160
|
+
|
|
161
|
+
`thalamus init` installs at user scope, so the harness arms in every directory rather
|
|
162
|
+
than only inside this checkout. It wires every supported harness by default; use
|
|
163
|
+
`--harness claude`, `--harness cursor` or `--harness codex` for one. `--dry-run`
|
|
164
|
+
reports without writing, and `--check` re-verifies any time.
|
|
165
|
+
|
|
166
|
+
Because user scope means outside this checkout, it lists what it will write and asks
|
|
167
|
+
before writing: `~/.claude/settings.json`, `~/.cursor/hooks.json` and
|
|
168
|
+
`~/.codex/hooks.json`, `~/.claude.json` (the MCP server), plus skill symlinks and one
|
|
169
|
+
derived agent per expert. Pass `--yes` to skip the prompt in a script; a
|
|
170
|
+
non-interactive stdin declines rather than assumes. `thalamus init --uninstall` takes
|
|
171
|
+
all of it back out, removing only what it can prove it installed, and leaving your
|
|
172
|
+
graph, `~/.thalamus/` and the transcript archive alone.
|
|
173
|
+
|
|
174
|
+
### Then relaunch your editor
|
|
175
|
+
|
|
176
|
+
Hooks and the MCP server arm per process, so an already-running session picks up
|
|
177
|
+
nothing. Quit and reopen your editor; `/clear` is not enough.
|
|
178
|
+
|
|
179
|
+
A new session should greet you with a memory prompt and its pinned scope. From there,
|
|
180
|
+
memory builds itself. Distillation runs when a session ends, detached, and says nothing
|
|
181
|
+
in your terminal. So have a real session, quit the editor, and ask:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
uv run thalamus status # sessions in the graph, and the last distillation run
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The count going from 0 to 1 is the confirmation that it works. `thalamus init --check`
|
|
188
|
+
answers the other half: whether the wiring that writes it is armed.
|
|
189
|
+
|
|
190
|
+
The full walkthrough, including what the first run looks like, is
|
|
191
|
+
[docs/getting-started.md](docs/getting-started.md).
|
|
192
|
+
|
|
193
|
+
## What this release is
|
|
194
|
+
|
|
195
|
+
Thalamus runs from a clone, and `git pull` is the upgrade path. A wheel built from
|
|
196
|
+
the tree installs outside a checkout: it finds its own hook scripts and skills, and its
|
|
197
|
+
hooks run the CLI under the interpreter `thalamus init` records, and `init` gives it
|
|
198
|
+
two example experts, and `thalamus graph up` brings up the graph from the compose file
|
|
199
|
+
it ships. A version tag publishes it to PyPI as `thalamus-memory` (CONTRIBUTING.md,
|
|
200
|
+
"Releasing"); the import name and the CLI stay `thalamus`.
|
|
201
|
+
|
|
202
|
+
One feature is experimental and off by default: frame themes, which render the pane
|
|
203
|
+
inside artwork, behind `thalamus console --frames PATH`. Without the flag there are no
|
|
204
|
+
controls and no key bindings, and no artwork ships.
|
|
205
|
+
|
|
206
|
+
## What's live
|
|
207
|
+
|
|
208
|
+
- **The graph.** A property graph (Apache TinkerPop / TinkerGraph) with ten node kinds:
|
|
209
|
+
`Session`, `Claim`, `Thread`, `Source`, `Artifact`, `Chunk`, `Entity`, `Exchange`,
|
|
210
|
+
`Trace` and `Agent`, every one carrying provenance and a
|
|
211
|
+
scope.<!-- (A0086, cites-as-live) -->
|
|
212
|
+
Orphans and contract violations are rejected at write time.
|
|
213
|
+
- **The evidence archive.** Memory is bootstrapped from retained session transcripts,
|
|
214
|
+
held in an immutable content-addressed store outside the
|
|
215
|
+
repo.<!-- (A0087, cites-as-live) -->
|
|
216
|
+
The graph is a view over that log that can be rebuilt from it: re-extract, never
|
|
217
|
+
migrate.
|
|
218
|
+
- **Curated ingestion.** An expert's document half is fed one document at a time.
|
|
219
|
+
`thalamus ingest <url|path> --scope <expert>` refuses bytes whose serving origin the
|
|
220
|
+
scope's manifest does not allowlist<!-- (A0088, cites-as-live) -->,
|
|
221
|
+
retains what survives the gate in the archive, and on `--write` lands it as a `Source`
|
|
222
|
+
with the text indexed as `Chunk` vertices beside the claims drawn from it.
|
|
223
|
+
`--check` runs that same path and stops at the model call, reporting the host that
|
|
224
|
+
actually served the bytes for no model spend.<!-- (A0089, cites-as-live) -->
|
|
225
|
+
The bytes are retained either way; the graph is what `--write` gates.
|
|
226
|
+
- **Experts.** Each scope is declared by a manifest in `config/experts/` and
|
|
227
|
+
nothing else.<!-- (A0004, cites-as-live) -->
|
|
228
|
+
This repository's `config/` holds five, and an installed wheel ships two examples;
|
|
229
|
+
write a YAML file and you have another.
|
|
230
|
+
- **Role boundaries.** Where a scope is defined by what it must not produce, its
|
|
231
|
+
manifest declares a `write_boundary` and a PreToolUse hook enforces it against the
|
|
232
|
+
file-editing tools.<!-- (A0091, cites-as-live) -->
|
|
233
|
+
The shipped `qe` manifest is the worked example: it holds the adversarial suite and is
|
|
234
|
+
denied `src/`, so the scope that asserts against an implementation cannot quietly
|
|
235
|
+
repair it.<!-- (A0092, cites-as-live) -->
|
|
236
|
+
The reverse denial is in the ownership table, so no other scope can soften what it
|
|
237
|
+
asserts either.<!-- (A0093, cites-as-live) -->
|
|
238
|
+
- **Session pinning.** One OS process, one immutable pin. `thalamus pin <scope>`
|
|
239
|
+
hands the terminal to a session pinned to that scope. The MCP server
|
|
240
|
+
reads the scope from its environment at startup and no tool accepts a scope argument,
|
|
241
|
+
so a model cannot widen its own view by asking. Nor by shelling out: the graph client
|
|
242
|
+
reaches the whole graph<!-- (A0148, cites-as-live) -->,
|
|
243
|
+
so a PreToolUse guard keeps a pinned session off it and on the tools that confine a
|
|
244
|
+
read to the pin.
|
|
245
|
+
- **The console.** Optional, and the part that needs tmux: it runs pinned sessions as
|
|
246
|
+
tmux windows so all of them are addressable from one place. `thalamus console`
|
|
247
|
+
serves them to a browser: a tab per window, the live pane, a composer, and one tap
|
|
248
|
+
to spawn an expert in a project. It installs as a PWA on a phone over a tailnet.
|
|
249
|
+
- **Consultations.** Cross-expert questions ride single-use tickets where minting the
|
|
250
|
+
ticket is writing the exchange record, and answers must cite nodes inside the
|
|
251
|
+
consulted scope.<!-- (A0094, cites-as-live) -->
|
|
252
|
+
Beside it, `thalamus quick ask` forks an expert's live session rather than
|
|
253
|
+
cold-starting one.<!-- (A0063, cites-as-live) -->
|
|
254
|
+
- **Rooms.** Part of the console: a private set of live sessions whose members see and
|
|
255
|
+
message each other and nobody else,
|
|
256
|
+
enforced by a per-room config directory and an outbound
|
|
257
|
+
guard.<!-- (A0096, cites-as-live) -->
|
|
258
|
+
- **The eval loop.** Every memory-tool call is logged as a `Trace` node, judged used or
|
|
259
|
+
ignored against the retained transcript, and priced in injected
|
|
260
|
+
tokens.<!-- (A0097, cites-as-live) -->
|
|
261
|
+
Above it, a counterfactual harness runs one task with memory on, off and degraded in
|
|
262
|
+
a confined worktree, graded by an oracle whose rungs are validated against a mutant
|
|
263
|
+
set before any run is scored.
|
|
264
|
+
- **Trust enforcement, first pass.** The transcript-ingress floor down-tiers distilled
|
|
265
|
+
claims that rest on pages fetched with the agent's web tools.
|
|
266
|
+
|
|
267
|
+
## Status
|
|
268
|
+
|
|
269
|
+
Built and running: the graph, the archive, curated ingestion, experts and pinning, the console,
|
|
270
|
+
consultations, rooms, and the eval loop's trace, attribution and cost layers.
|
|
271
|
+
|
|
272
|
+
In progress: counterfactual measurement at a scale that can settle whether recalled
|
|
273
|
+
memory changes task outcomes. What the instrument shows today is that memory gets
|
|
274
|
+
surfaced; that it improves results is not yet demonstrated, and saying so is part of
|
|
275
|
+
the design. Computing trust across whole derivation chains, closing the shell-fetch
|
|
276
|
+
and paraphrase gaps, and end-to-end audit chains come after.
|
|
277
|
+
|
|
278
|
+
Roadmap and open work live in
|
|
279
|
+
[GitHub issues and milestones](https://github.com/Ybx-jp/thalamus/issues).
|
|
280
|
+
|
|
281
|
+
## Documentation
|
|
282
|
+
|
|
283
|
+
| | |
|
|
284
|
+
|---|---|
|
|
285
|
+
| [Getting started](docs/getting-started.md) | Install, first run, and what each step should look like |
|
|
286
|
+
| [Concepts](docs/concepts.md) | Scopes, experts, the federation contract, trust tiers, distillation |
|
|
287
|
+
| [CLI reference](docs/cli.md) | Every command |
|
|
288
|
+
| [The console](docs/console.md) | Driving your pinned sessions from your phone: the PWA, reaching it off the box, keeping it up |
|
|
289
|
+
| [Contributing](CONTRIBUTING.md) | Tests, conventions, how the pieces fit |
|
|
290
|
+
|
|
291
|
+
## Layout
|
|
292
|
+
|
|
293
|
+
```
|
|
294
|
+
src/thalamus/
|
|
295
|
+
substrate/ storage kernel: schema, Gremlin writer, Gremlin reader, query span tap
|
|
296
|
+
contract/ the federation boundary: ontology, expert manifests, conformance
|
|
297
|
+
console/ the optional browser/PWA control plane: tmux windows, rooms, dispatch
|
|
298
|
+
archive/ immutable content-addressed store for retained evidence
|
|
299
|
+
harness/ where it meets the agent: MCP server, hooks, skills, bootstrap, ingest
|
|
300
|
+
eval/ trace tap, attribution, cost: the live-serving half of the eval loop.
|
|
301
|
+
The counterfactual harness (task battery, arms, oracle) is research
|
|
302
|
+
instrumentation; it lives in the private thalamus-eval companion repo
|
|
303
|
+
arch/ the `architect` scope's instrument: a declared-policy import extractor
|
|
304
|
+
and the structural metrics computed over it, gated in CI
|
|
305
|
+
pulse/ live telemetry dashboard over the eval loop
|
|
306
|
+
arch/ model.yaml, the committed architecture model the gates check against
|
|
307
|
+
config/ expert manifests
|
|
308
|
+
ledger/ the claims ledger: one entry per documented commitment, pinned by
|
|
309
|
+
digest to the section of source that keeps it true
|
|
310
|
+
docs/ user documentation
|
|
311
|
+
docker/ the confinement image a counterfactual arm runs inside
|
|
312
|
+
tools/ frame-theme authoring scripts (`--extra frames`)
|
|
313
|
+
tests/ the suite, including `tests/qe/`, the adversarial suite owned by `qe`
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## License
|
|
317
|
+
|
|
318
|
+
MIT. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# Thalamus
|
|
2
|
+
|
|
3
|
+
Memory for coding agents that can show where each thing it remembers came from.
|
|
4
|
+
|
|
5
|
+
When a Claude Code, Cursor or codex session ends, Thalamus reads the transcript and
|
|
6
|
+
writes what happened into a graph database: the decisions and the reasons for them, the
|
|
7
|
+
problems and how they were fixed, and the work left unfinished. The next session starts
|
|
8
|
+
with the unfinished work in front of it and can search the rest.
|
|
9
|
+
|
|
10
|
+
Every stored item points back to the session or document it came from, and that
|
|
11
|
+
transcript or document is kept unedited outside the graph. Each item also records whose
|
|
12
|
+
word it rests on: yours, the agent's own reasoning, or a document the agent read. That
|
|
13
|
+
record is what lets you ask the agent why it believes something and get an answer you
|
|
14
|
+
can check.
|
|
15
|
+
|
|
16
|
+
What it does not show yet is that recalled memory makes an agent finish tasks better.
|
|
17
|
+
It shows that memory gets surfaced; the [status](#status) section says what would
|
|
18
|
+
settle the rest.
|
|
19
|
+
|
|
20
|
+
The name is from the brain: the thalamus relays nearly every signal bound for a
|
|
21
|
+
specialized region of the cortex, and gates what gets through.
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
session ends → transcript read → decisions, fixes and open work written to the graph
|
|
25
|
+
↓
|
|
26
|
+
next session starts with the open work and can search the rest
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## How it works
|
|
30
|
+
|
|
31
|
+
The project has its own vocabulary, and every term below is defined in
|
|
32
|
+
[Concepts](docs/concepts.md). This section uses as little of it as it can.
|
|
33
|
+
|
|
34
|
+
### Memory writes itself when a session ends
|
|
35
|
+
|
|
36
|
+
You don't curate it. A hook reads the retained transcript and extracts claims (a
|
|
37
|
+
decision, a problem, a fix) and open threads (work the session did not finish). The
|
|
38
|
+
next session opens already knowing where you left off.
|
|
39
|
+
|
|
40
|
+
### Where an item came from decides how far it is trusted
|
|
41
|
+
|
|
42
|
+
Every item carries a trust tier: 0 for what you wrote down yourself, 1 for what an agent
|
|
43
|
+
observed or worked out in its own sessions, 2 for outside documents from sources you
|
|
44
|
+
approved, and 3 for outside content from anywhere else.
|
|
45
|
+
|
|
46
|
+
The data model defines an item's effective trust as the lowest tier anywhere in what it
|
|
47
|
+
was derived from, so an agent's summary of a paper is trusted like the
|
|
48
|
+
paper.<!-- (A0051, cites-as-live) -->
|
|
49
|
+
No code computes that rule across a whole chain of derivations yet.
|
|
50
|
+
|
|
51
|
+
What is enforced today is narrower. When a session fetched pages with the agent's web
|
|
52
|
+
tools, the claims that rest on those pages are stored at outside-document
|
|
53
|
+
trust.<!-- (A0052, cites-as-live) -->
|
|
54
|
+
The extractor marks them, and a mechanical check also catches a claim that repeats the
|
|
55
|
+
page's wording when the mark is missing. A page fetched through the shell, and a claim
|
|
56
|
+
that restates a page in different words, are not caught.
|
|
57
|
+
|
|
58
|
+
Recalled items come back quoted, with their source and tier attached: they inform the
|
|
59
|
+
agent and never instruct it.<!-- (A0054, cites-as-live) -->
|
|
60
|
+
|
|
61
|
+
### Each specialist keeps its own memory
|
|
62
|
+
|
|
63
|
+
Knowledge is split by domain. Each specialist, called an expert (a literature reviewer,
|
|
64
|
+
a quality engineer, an architect), has its own graph of curated documents plus its own
|
|
65
|
+
session history, and the pair is called a scope. A session runs as exactly one scope,
|
|
66
|
+
fixed when the session starts.<!-- (A0001, cites-as-live) -->
|
|
67
|
+
Asking another expert is a recorded consultation, never a search that happens to reach
|
|
68
|
+
across.<!-- (A0094, cites-as-live) -->
|
|
69
|
+
|
|
70
|
+
### A bad write is refused, not filtered later
|
|
71
|
+
|
|
72
|
+
One set of rules, the federation contract, is at once the data schema, the permission
|
|
73
|
+
system and the trust boundary. A write that breaks it is rejected when it is written,
|
|
74
|
+
rather than filtered out when it is read.<!-- (A0025, cites-as-live) -->
|
|
75
|
+
|
|
76
|
+
### You can see what memory cost
|
|
77
|
+
|
|
78
|
+
Every memory lookup is logged<!-- (A0097, cites-as-live) -->
|
|
79
|
+
and priced. `thalamus pulse` serves a live dashboard of what retrieval actually
|
|
80
|
+
cost.<!-- (A0085, cites-as-live) -->
|
|
81
|
+
|
|
82
|
+
## Quick start
|
|
83
|
+
|
|
84
|
+
Your graph starts empty and stays yours. Thalamus ships no seed graph, no export and
|
|
85
|
+
no fixture corpus: a graph is one operator's session history, so every install is
|
|
86
|
+
fresh, for everyone.
|
|
87
|
+
|
|
88
|
+
### Prerequisites
|
|
89
|
+
|
|
90
|
+
| | Why |
|
|
91
|
+
|---|---|
|
|
92
|
+
| **Docker** | runs the graph (Gremlin Server on TinkerGraph) |
|
|
93
|
+
| **Python ≥3.11** and [**uv**](https://docs.astral.sh/uv/) | the package and its CLI |
|
|
94
|
+
| **jq** | every hook parses its stdin with it; without it the hook layer dies silently |
|
|
95
|
+
| **A coding-agent CLI**: Claude Code (`claude`), Cursor (`agent`), codex (`codex`), or any mix | distillation shells out to it |
|
|
96
|
+
|
|
97
|
+
The console additionally needs **tmux**: it runs pinned sessions as tmux windows
|
|
98
|
+
([docs/console.md](docs/console.md)).
|
|
99
|
+
|
|
100
|
+
### Install
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
git clone https://github.com/Ybx-jp/thalamus && cd thalamus
|
|
104
|
+
|
|
105
|
+
docker compose up -d # the graph, on 127.0.0.1:8182; no licence, no account
|
|
106
|
+
uv sync --extra dev # creates .venv with the package and its CLI
|
|
107
|
+
uv run thalamus init # wire your editor, then verify what it wired
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The graph answers a few seconds after `up -d` returns, because Docker publishes the
|
|
111
|
+
port before the server finishes starting. `docker compose ps` says `healthy` when it is
|
|
112
|
+
actually serving.
|
|
113
|
+
|
|
114
|
+
`thalamus init` installs at user scope, so the harness arms in every directory rather
|
|
115
|
+
than only inside this checkout. It wires every supported harness by default; use
|
|
116
|
+
`--harness claude`, `--harness cursor` or `--harness codex` for one. `--dry-run`
|
|
117
|
+
reports without writing, and `--check` re-verifies any time.
|
|
118
|
+
|
|
119
|
+
Because user scope means outside this checkout, it lists what it will write and asks
|
|
120
|
+
before writing: `~/.claude/settings.json`, `~/.cursor/hooks.json` and
|
|
121
|
+
`~/.codex/hooks.json`, `~/.claude.json` (the MCP server), plus skill symlinks and one
|
|
122
|
+
derived agent per expert. Pass `--yes` to skip the prompt in a script; a
|
|
123
|
+
non-interactive stdin declines rather than assumes. `thalamus init --uninstall` takes
|
|
124
|
+
all of it back out, removing only what it can prove it installed, and leaving your
|
|
125
|
+
graph, `~/.thalamus/` and the transcript archive alone.
|
|
126
|
+
|
|
127
|
+
### Then relaunch your editor
|
|
128
|
+
|
|
129
|
+
Hooks and the MCP server arm per process, so an already-running session picks up
|
|
130
|
+
nothing. Quit and reopen your editor; `/clear` is not enough.
|
|
131
|
+
|
|
132
|
+
A new session should greet you with a memory prompt and its pinned scope. From there,
|
|
133
|
+
memory builds itself. Distillation runs when a session ends, detached, and says nothing
|
|
134
|
+
in your terminal. So have a real session, quit the editor, and ask:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
uv run thalamus status # sessions in the graph, and the last distillation run
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The count going from 0 to 1 is the confirmation that it works. `thalamus init --check`
|
|
141
|
+
answers the other half: whether the wiring that writes it is armed.
|
|
142
|
+
|
|
143
|
+
The full walkthrough, including what the first run looks like, is
|
|
144
|
+
[docs/getting-started.md](docs/getting-started.md).
|
|
145
|
+
|
|
146
|
+
## What this release is
|
|
147
|
+
|
|
148
|
+
Thalamus runs from a clone, and `git pull` is the upgrade path. A wheel built from
|
|
149
|
+
the tree installs outside a checkout: it finds its own hook scripts and skills, and its
|
|
150
|
+
hooks run the CLI under the interpreter `thalamus init` records, and `init` gives it
|
|
151
|
+
two example experts, and `thalamus graph up` brings up the graph from the compose file
|
|
152
|
+
it ships. A version tag publishes it to PyPI as `thalamus-memory` (CONTRIBUTING.md,
|
|
153
|
+
"Releasing"); the import name and the CLI stay `thalamus`.
|
|
154
|
+
|
|
155
|
+
One feature is experimental and off by default: frame themes, which render the pane
|
|
156
|
+
inside artwork, behind `thalamus console --frames PATH`. Without the flag there are no
|
|
157
|
+
controls and no key bindings, and no artwork ships.
|
|
158
|
+
|
|
159
|
+
## What's live
|
|
160
|
+
|
|
161
|
+
- **The graph.** A property graph (Apache TinkerPop / TinkerGraph) with ten node kinds:
|
|
162
|
+
`Session`, `Claim`, `Thread`, `Source`, `Artifact`, `Chunk`, `Entity`, `Exchange`,
|
|
163
|
+
`Trace` and `Agent`, every one carrying provenance and a
|
|
164
|
+
scope.<!-- (A0086, cites-as-live) -->
|
|
165
|
+
Orphans and contract violations are rejected at write time.
|
|
166
|
+
- **The evidence archive.** Memory is bootstrapped from retained session transcripts,
|
|
167
|
+
held in an immutable content-addressed store outside the
|
|
168
|
+
repo.<!-- (A0087, cites-as-live) -->
|
|
169
|
+
The graph is a view over that log that can be rebuilt from it: re-extract, never
|
|
170
|
+
migrate.
|
|
171
|
+
- **Curated ingestion.** An expert's document half is fed one document at a time.
|
|
172
|
+
`thalamus ingest <url|path> --scope <expert>` refuses bytes whose serving origin the
|
|
173
|
+
scope's manifest does not allowlist<!-- (A0088, cites-as-live) -->,
|
|
174
|
+
retains what survives the gate in the archive, and on `--write` lands it as a `Source`
|
|
175
|
+
with the text indexed as `Chunk` vertices beside the claims drawn from it.
|
|
176
|
+
`--check` runs that same path and stops at the model call, reporting the host that
|
|
177
|
+
actually served the bytes for no model spend.<!-- (A0089, cites-as-live) -->
|
|
178
|
+
The bytes are retained either way; the graph is what `--write` gates.
|
|
179
|
+
- **Experts.** Each scope is declared by a manifest in `config/experts/` and
|
|
180
|
+
nothing else.<!-- (A0004, cites-as-live) -->
|
|
181
|
+
This repository's `config/` holds five, and an installed wheel ships two examples;
|
|
182
|
+
write a YAML file and you have another.
|
|
183
|
+
- **Role boundaries.** Where a scope is defined by what it must not produce, its
|
|
184
|
+
manifest declares a `write_boundary` and a PreToolUse hook enforces it against the
|
|
185
|
+
file-editing tools.<!-- (A0091, cites-as-live) -->
|
|
186
|
+
The shipped `qe` manifest is the worked example: it holds the adversarial suite and is
|
|
187
|
+
denied `src/`, so the scope that asserts against an implementation cannot quietly
|
|
188
|
+
repair it.<!-- (A0092, cites-as-live) -->
|
|
189
|
+
The reverse denial is in the ownership table, so no other scope can soften what it
|
|
190
|
+
asserts either.<!-- (A0093, cites-as-live) -->
|
|
191
|
+
- **Session pinning.** One OS process, one immutable pin. `thalamus pin <scope>`
|
|
192
|
+
hands the terminal to a session pinned to that scope. The MCP server
|
|
193
|
+
reads the scope from its environment at startup and no tool accepts a scope argument,
|
|
194
|
+
so a model cannot widen its own view by asking. Nor by shelling out: the graph client
|
|
195
|
+
reaches the whole graph<!-- (A0148, cites-as-live) -->,
|
|
196
|
+
so a PreToolUse guard keeps a pinned session off it and on the tools that confine a
|
|
197
|
+
read to the pin.
|
|
198
|
+
- **The console.** Optional, and the part that needs tmux: it runs pinned sessions as
|
|
199
|
+
tmux windows so all of them are addressable from one place. `thalamus console`
|
|
200
|
+
serves them to a browser: a tab per window, the live pane, a composer, and one tap
|
|
201
|
+
to spawn an expert in a project. It installs as a PWA on a phone over a tailnet.
|
|
202
|
+
- **Consultations.** Cross-expert questions ride single-use tickets where minting the
|
|
203
|
+
ticket is writing the exchange record, and answers must cite nodes inside the
|
|
204
|
+
consulted scope.<!-- (A0094, cites-as-live) -->
|
|
205
|
+
Beside it, `thalamus quick ask` forks an expert's live session rather than
|
|
206
|
+
cold-starting one.<!-- (A0063, cites-as-live) -->
|
|
207
|
+
- **Rooms.** Part of the console: a private set of live sessions whose members see and
|
|
208
|
+
message each other and nobody else,
|
|
209
|
+
enforced by a per-room config directory and an outbound
|
|
210
|
+
guard.<!-- (A0096, cites-as-live) -->
|
|
211
|
+
- **The eval loop.** Every memory-tool call is logged as a `Trace` node, judged used or
|
|
212
|
+
ignored against the retained transcript, and priced in injected
|
|
213
|
+
tokens.<!-- (A0097, cites-as-live) -->
|
|
214
|
+
Above it, a counterfactual harness runs one task with memory on, off and degraded in
|
|
215
|
+
a confined worktree, graded by an oracle whose rungs are validated against a mutant
|
|
216
|
+
set before any run is scored.
|
|
217
|
+
- **Trust enforcement, first pass.** The transcript-ingress floor down-tiers distilled
|
|
218
|
+
claims that rest on pages fetched with the agent's web tools.
|
|
219
|
+
|
|
220
|
+
## Status
|
|
221
|
+
|
|
222
|
+
Built and running: the graph, the archive, curated ingestion, experts and pinning, the console,
|
|
223
|
+
consultations, rooms, and the eval loop's trace, attribution and cost layers.
|
|
224
|
+
|
|
225
|
+
In progress: counterfactual measurement at a scale that can settle whether recalled
|
|
226
|
+
memory changes task outcomes. What the instrument shows today is that memory gets
|
|
227
|
+
surfaced; that it improves results is not yet demonstrated, and saying so is part of
|
|
228
|
+
the design. Computing trust across whole derivation chains, closing the shell-fetch
|
|
229
|
+
and paraphrase gaps, and end-to-end audit chains come after.
|
|
230
|
+
|
|
231
|
+
Roadmap and open work live in
|
|
232
|
+
[GitHub issues and milestones](https://github.com/Ybx-jp/thalamus/issues).
|
|
233
|
+
|
|
234
|
+
## Documentation
|
|
235
|
+
|
|
236
|
+
| | |
|
|
237
|
+
|---|---|
|
|
238
|
+
| [Getting started](docs/getting-started.md) | Install, first run, and what each step should look like |
|
|
239
|
+
| [Concepts](docs/concepts.md) | Scopes, experts, the federation contract, trust tiers, distillation |
|
|
240
|
+
| [CLI reference](docs/cli.md) | Every command |
|
|
241
|
+
| [The console](docs/console.md) | Driving your pinned sessions from your phone: the PWA, reaching it off the box, keeping it up |
|
|
242
|
+
| [Contributing](CONTRIBUTING.md) | Tests, conventions, how the pieces fit |
|
|
243
|
+
|
|
244
|
+
## Layout
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
src/thalamus/
|
|
248
|
+
substrate/ storage kernel: schema, Gremlin writer, Gremlin reader, query span tap
|
|
249
|
+
contract/ the federation boundary: ontology, expert manifests, conformance
|
|
250
|
+
console/ the optional browser/PWA control plane: tmux windows, rooms, dispatch
|
|
251
|
+
archive/ immutable content-addressed store for retained evidence
|
|
252
|
+
harness/ where it meets the agent: MCP server, hooks, skills, bootstrap, ingest
|
|
253
|
+
eval/ trace tap, attribution, cost: the live-serving half of the eval loop.
|
|
254
|
+
The counterfactual harness (task battery, arms, oracle) is research
|
|
255
|
+
instrumentation; it lives in the private thalamus-eval companion repo
|
|
256
|
+
arch/ the `architect` scope's instrument: a declared-policy import extractor
|
|
257
|
+
and the structural metrics computed over it, gated in CI
|
|
258
|
+
pulse/ live telemetry dashboard over the eval loop
|
|
259
|
+
arch/ model.yaml, the committed architecture model the gates check against
|
|
260
|
+
config/ expert manifests
|
|
261
|
+
ledger/ the claims ledger: one entry per documented commitment, pinned by
|
|
262
|
+
digest to the section of source that keeps it true
|
|
263
|
+
docs/ user documentation
|
|
264
|
+
docker/ the confinement image a counterfactual arm runs inside
|
|
265
|
+
tools/ frame-theme authoring scripts (`--extra frames`)
|
|
266
|
+
tests/ the suite, including `tests/qe/`, the adversarial suite owned by `qe`
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
## License
|
|
270
|
+
|
|
271
|
+
MIT. See [LICENSE](LICENSE).
|