Standalone script that moves memories between graphs based on tag
matching. Handles memory files, edges, index/embedding/state metadata,
cross-graph edge cleanup, and overlap detection (copy to multiple
graphs). Supports dry-run, idempotent re-runs, and git auto-commit.
Closes: #4, #5, #6
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Allows projects to automatically route all memory operations to a
specific graph without passing graph= on every MCP call. Set the env
var in a project's .claude/settings.json to target a named graph.
Resolution order: explicit graph param > env var > "default".
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Auto-edges called relate() up to 3 times per store, each triggering a
blocking git subprocess (~50-100ms each). Now relate() accepts
skip_commit=True so auto-edges defer to the fire-and-forget git sync,
cutting 150-300ms of latency from every memory_store call.
Closes#2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Non-default graphs were second-class citizens — timers only maintained the
default graph, git sync ignored named graphs, there was no way to create
a graph without editing config manually, cross-graph edge errors were
confusing, and utility scripts were hardcoded to the default graph.
- Add `graph-create` CLI command + `create_graph()` in common.py, with
custom path registration written to the default graph's _config.json
- Add `scripts/maintain-all-graphs.sh` to loop decay/core/embed/reflect
over all discovered graphs; update systemd services to call it
- Refactor `memory-git-sync.sh` into sync_repo() function that iterates
default + all named graphs with .git directories
- Improve cross-graph edge ValueError to explain the same-graph constraint
- Add --graph flag to edge-proposer.py and session_memory.py
- Update systemd/README.md with portable paths and new architecture
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- embeddings.py: embed() early-exit returned hardcoded EMBEDDINGS_PATH
constant instead of self.memory_dir path, giving wrong path for
non-default graphs
- mcp_server.py: _trigger_git_sync() now passes the active graph's
memory_dir via COGNITIVE_MEMORY_DIR env var so non-default graphs
get synced correctly
- analysis.py: replaced hardcoded project name list with auto-detection
(tags in 5+ memories with 4+ co-occurring tags) so reflection works
for any graph without manual maintenance
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Surface auto-edge errors in store response (auto_edge_error key) instead
of silently swallowing exceptions, making failures diagnosable
- Pass similarity score as edge strength so higher-confidence matches get
stronger edges instead of always defaulting to 0.8
- Document why same-type pairs and REQUIRES/FOLLOWS are excluded from the
heuristic table vs edge-proposer.py
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Automatically find and link related memories after every store operation,
removing reliance on Claude manually creating edges. Uses recall + type
heuristics to choose edge types (SOLVES, BUILDS_ON, RELATED_TO) and
returns created edge IDs in the store response for optional review.
Key design choices:
- Keyword-only fallback requires tag overlap to prevent spurious edges
- Similarity threshold (0.4) filters before max-edge cap (3)
- Edge description arrow matches actual from/to direction
- Failures never break the store operation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Moved application code from ~/.claude/skills/cognitive-memory/ to its own
project directory. The skill layer (SKILL.md, SCHEMA.md) remains in the
skill directory for Claude Code to read.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>