memorymaster 2.0.0__tar.gz → 3.2.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.
- memorymaster-3.2.0/PKG-INFO +730 -0
- memorymaster-3.2.0/README.md +694 -0
- memorymaster-3.2.0/benchmarks/longmemeval_runner.py +290 -0
- memorymaster-3.2.0/benchmarks/longmemeval_vector_runner.py +254 -0
- memorymaster-3.2.0/config-templates/hooks/memorymaster-auto-ingest.py +126 -0
- memorymaster-3.2.0/config-templates/hooks/memorymaster-classify.py +216 -0
- memorymaster-3.2.0/config-templates/hooks/memorymaster-recall.py +27 -0
- memorymaster-3.2.0/config-templates/hooks/memorymaster-session-start.py +251 -0
- memorymaster-3.2.0/config-templates/hooks/memorymaster-steward-cycle.py +28 -0
- memorymaster-3.2.0/config-templates/hooks/memorymaster-validate-wiki.py +158 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/__init__.py +1 -1
- memorymaster-3.2.0/memorymaster/_storage_lifecycle.py +563 -0
- memorymaster-3.2.0/memorymaster/_storage_read.py +614 -0
- memorymaster-3.2.0/memorymaster/_storage_schema.py +624 -0
- memorymaster-3.2.0/memorymaster/_storage_shared.py +41 -0
- memorymaster-3.2.0/memorymaster/_storage_write_claims.py +373 -0
- memorymaster-3.2.0/memorymaster/access_control.py +126 -0
- memorymaster-3.2.0/memorymaster/auto_extractor.py +139 -0
- memorymaster-3.2.0/memorymaster/auto_resolver.py +220 -0
- memorymaster-3.2.0/memorymaster/claim_verifier.py +170 -0
- memorymaster-3.2.0/memorymaster/cli.py +413 -0
- memorymaster-3.2.0/memorymaster/cli_handlers_basic.py +722 -0
- memorymaster-3.2.0/memorymaster/cli_handlers_curation.py +670 -0
- memorymaster-3.2.0/memorymaster/cli_helpers.py +138 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/config.py +2 -2
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/conflict_resolver.py +40 -27
- memorymaster-3.2.0/memorymaster/context_hook.py +226 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/context_optimizer.py +25 -34
- memorymaster-3.2.0/memorymaster/daily_notes.py +186 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/dashboard.py +1059 -1018
- memorymaster-3.2.0/memorymaster/db_merge.py +156 -0
- memorymaster-3.2.0/memorymaster/dream_bridge.py +703 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/embeddings.py +181 -181
- memorymaster-3.2.0/memorymaster/entity_graph.py +313 -0
- memorymaster-3.2.0/memorymaster/feedback.py +247 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/jobs/__init__.py +5 -5
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/jobs/compact_summaries.py +67 -48
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/jobs/decay.py +50 -47
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/jobs/deterministic.py +376 -390
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/jobs/extractor.py +16 -2
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/jobs/validator.py +193 -173
- memorymaster-3.2.0/memorymaster/llm_provider.py +229 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/llm_steward.py +847 -847
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/mcp_server.py +907 -542
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/metrics_exporter.py +1 -1
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/models.py +324 -280
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/operator.py +1453 -1299
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/operator_queue.py +41 -34
- memorymaster-3.2.0/memorymaster/plugins.py +123 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/policy.py +110 -110
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/postgres_store.py +1655 -1637
- memorymaster-3.2.0/memorymaster/qdrant_backend.py +327 -0
- memorymaster-3.2.0/memorymaster/qmd_bridge.py +132 -0
- memorymaster-3.2.0/memorymaster/query_classifier.py +69 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/retrieval.py +237 -221
- memorymaster-3.2.0/memorymaster/rl_trainer.py +132 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/scheduler.py +98 -98
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/schema.sql +6 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/security.py +195 -195
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/service.py +733 -519
- memorymaster-3.2.0/memorymaster/session_tracker.py +129 -0
- memorymaster-3.2.0/memorymaster/skill_evolver.py +161 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/snapshot.py +2 -5
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/steward.py +1627 -1587
- memorymaster-3.2.0/memorymaster/storage.py +93 -0
- memorymaster-3.2.0/memorymaster/transcript_miner.py +152 -0
- memorymaster-3.2.0/memorymaster/vault_bases.py +235 -0
- memorymaster-3.2.0/memorymaster/vault_curator.py +296 -0
- memorymaster-3.2.0/memorymaster/vault_exporter.py +223 -0
- memorymaster-3.2.0/memorymaster/vault_linter.py +224 -0
- memorymaster-3.2.0/memorymaster/vault_log.py +108 -0
- memorymaster-3.2.0/memorymaster/vault_query_capture.py +107 -0
- memorymaster-3.2.0/memorymaster/vault_synthesis.py +152 -0
- memorymaster-3.2.0/memorymaster/verbatim_store.py +341 -0
- memorymaster-3.2.0/memorymaster/webhook.py +58 -0
- memorymaster-3.2.0/memorymaster/wiki_engine.py +531 -0
- memorymaster-3.2.0/memorymaster.egg-info/PKG-INFO +730 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster.egg-info/SOURCES.txt +79 -1
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster.egg-info/requires.txt +4 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster.egg-info/top_level.txt +3 -2
- {memorymaster-2.0.0 → memorymaster-3.2.0}/pyproject.toml +54 -45
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/alert_operator_metrics.py +1 -1
- memorymaster-3.2.0/scripts/autoresearch_daemon.py +225 -0
- memorymaster-3.2.0/scripts/codex_live_to_turns.py +460 -0
- memorymaster-3.2.0/scripts/gitnexus_to_claims.py +180 -0
- memorymaster-3.2.0/scripts/ingest_planning_docs.py +170 -0
- memorymaster-3.2.0/scripts/run_codex_autologger.py +94 -0
- memorymaster-3.2.0/scripts/setup-hooks.py +372 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/setup.cfg +4 -4
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/conftest.py +3 -1
- memorymaster-3.2.0/tests/test_access_control.py +331 -0
- memorymaster-3.2.0/tests/test_auto_extractor.py +309 -0
- memorymaster-3.2.0/tests/test_auto_resolver.py +142 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_auto_validate.py +1 -1
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_claim_links.py +1 -1
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_cli_review_queue.py +1 -1
- memorymaster-3.2.0/tests/test_cli_subcommands.py +189 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_compact_summaries.py +2 -3
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_compaction_trace.py +1 -1
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_conflict_resolver.py +0 -3
- memorymaster-3.2.0/tests/test_context_hook.py +260 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_dedup.py +5 -3
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_deterministic_predicates.py +1 -1
- memorymaster-3.2.0/tests/test_embeddings_coverage.py +127 -0
- memorymaster-3.2.0/tests/test_entity_graph.py +209 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_events_schema.py +1 -1
- memorymaster-3.2.0/tests/test_feedback.py +278 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_fts5_search.py +2 -3
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_human_id.py +0 -1
- memorymaster-3.2.0/tests/test_integration_workflows.py +534 -0
- memorymaster-3.2.0/tests/test_lifecycle.py +75 -0
- memorymaster-3.2.0/tests/test_llm_steward_coverage.py +112 -0
- memorymaster-3.2.0/tests/test_mcp_helpers.py +319 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_metrics_exporter.py +1 -1
- memorymaster-3.2.0/tests/test_obsidian_mind_patterns.py +386 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_operator.py +1 -1
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_operator_queue.py +1 -3
- memorymaster-3.2.0/tests/test_plugins.py +284 -0
- memorymaster-3.2.0/tests/test_policy_coverage.py +56 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_postgres_parity.py +2 -2
- memorymaster-3.2.0/tests/test_qdrant_backend.py +320 -0
- memorymaster-3.2.0/tests/test_qmd_bridge.py +188 -0
- memorymaster-3.2.0/tests/test_query_classifier.py +284 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_reliability_hardening.py +1 -1
- memorymaster-3.2.0/tests/test_rl_trainer.py +232 -0
- memorymaster-3.2.0/tests/test_scheduler.py +160 -0
- memorymaster-3.2.0/tests/test_schema.py +14 -0
- memorymaster-3.2.0/tests/test_security_access.py +219 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_security_patterns.py +0 -1
- memorymaster-3.2.0/tests/test_service_coverage.py +168 -0
- memorymaster-3.2.0/tests/test_session_tracker.py +337 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_sqlite_core.py +14 -12
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_staleness.py +0 -2
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_stealth_mode.py +0 -1
- memorymaster-3.2.0/tests/test_store_factory.py +35 -0
- memorymaster-3.2.0/tests/test_vault_exporter.py +381 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_vector_search.py +3 -3
- memorymaster-3.2.0/tests/test_webhook.py +167 -0
- memorymaster-2.0.0/PKG-INFO +0 -316
- memorymaster-2.0.0/README.md +0 -283
- memorymaster-2.0.0/memorymaster/cli.py +0 -1629
- memorymaster-2.0.0/memorymaster/storage.py +0 -1602
- memorymaster-2.0.0/memorymaster.egg-info/PKG-INFO +0 -316
- {memorymaster-2.0.0 → memorymaster-3.2.0}/LICENSE +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/benchmarks/perf_smoke.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/__main__.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/jobs/compactor.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/jobs/dedup.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/jobs/staleness.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/lifecycle.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/retry.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/review.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/schema.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/schema_postgres.sql +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/store_factory.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster/turn_schema.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster.egg-info/dependency_links.txt +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/memorymaster.egg-info/entry_points.txt +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/claude_to_turns.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/compaction_edge_cases.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/compaction_trace_report.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/compaction_trace_validate.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/confusion_matrix_eval.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/conversation_importer.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/conversation_to_turns.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/e2e_operator.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/email_live_to_turns.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/eval_memorymaster.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/generate_drill_signoff.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/git_to_turns.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/github_live_to_turns.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/jira_live_to_turns.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/messages_to_turns.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/operator_metrics.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/recurring_incident_drill.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/release_readiness.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/run_incident_drill.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/scheduled_ingest.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/slack_live_to_turns.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/tickets_to_turns.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/scripts/webhook_to_turns.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_claude_to_turns.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_cli_json_flag.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_cli_ready.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_config.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_confusion_matrix_eval.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_connection_retry.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_connectors.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_context_optimizer.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_conversation_to_turns.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_dashboard.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_incident_drill_runner.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_llm_steward_key_rotation.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_perf_smoke_config.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_review.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_snapshot.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_steward.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_steward_resolution_parity.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_tenant_isolation.py +0 -0
- {memorymaster-2.0.0 → memorymaster-3.2.0}/tests/test_turn_schema.py +0 -0
|
@@ -0,0 +1,730 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: memorymaster
|
|
3
|
+
Version: 3.2.0
|
|
4
|
+
Summary: Production-grade memory reliability system for AI coding agents. Lifecycle-managed claims with citations, conflict detection, steward governance, and MCP integration.
|
|
5
|
+
Author: wolverin0
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: memory,ai-agents,claims,lifecycle,mcp,sqlite,postgres,coding-agents
|
|
8
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Provides-Extra: postgres
|
|
21
|
+
Requires-Dist: psycopg[binary]>=3.2; extra == "postgres"
|
|
22
|
+
Provides-Extra: security
|
|
23
|
+
Requires-Dist: cryptography>=42; extra == "security"
|
|
24
|
+
Provides-Extra: embeddings
|
|
25
|
+
Requires-Dist: sentence-transformers>=3.0; extra == "embeddings"
|
|
26
|
+
Provides-Extra: gemini
|
|
27
|
+
Requires-Dist: google-genai>=1.0; extra == "gemini"
|
|
28
|
+
Provides-Extra: qdrant
|
|
29
|
+
Requires-Dist: httpx>=0.27; extra == "qdrant"
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: pytest>=8.2; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest-cov>=6.0; extra == "dev"
|
|
33
|
+
Provides-Extra: mcp
|
|
34
|
+
Requires-Dist: mcp>=1.2; extra == "mcp"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# MemoryMaster
|
|
38
|
+
|
|
39
|
+
**Production-grade memory reliability system for AI coding agents.**
|
|
40
|
+
|
|
41
|
+
Lifecycle-managed claims with citations, conflict detection, steward governance, hybrid retrieval, and MCP integration. Give your AI agents persistent, trustworthy memory.
|
|
42
|
+
|
|
43
|
+
[](LICENSE)
|
|
44
|
+
[](https://www.python.org/downloads/)
|
|
45
|
+
[]()
|
|
46
|
+
[]()
|
|
47
|
+
[]()
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
MemoryMaster gives AI coding agents **persistent, verifiable memory** with a full claim lifecycle, citation tracking, conflict detection, and human-in-the-loop governance. It prevents the #1 problem with agent memory: **drift, stale assumptions, and unsafe disclosure**.
|
|
52
|
+
|
|
53
|
+
## Stats
|
|
54
|
+
|
|
55
|
+
| Metric | Count |
|
|
56
|
+
|--------|-------|
|
|
57
|
+
| Source modules | 35+ (20,000+ lines) |
|
|
58
|
+
| Tests | 932 across 66 test modules |
|
|
59
|
+
| MCP tools | 21 |
|
|
60
|
+
| CLI commands | 54+ |
|
|
61
|
+
| Import connectors | 10+ (Git, Slack, Jira, email, GitHub, conversations) |
|
|
62
|
+
| Utility scripts | 30+ (connectors, benchmarks, drills) |
|
|
63
|
+
|
|
64
|
+
## Architecture
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
68
|
+
│ Agent Runtime │
|
|
69
|
+
│ (Claude Code / Codex / any MCP-compatible agent) │
|
|
70
|
+
└────────────┬────────────────────────────────┬───────────────────┘
|
|
71
|
+
│ MCP (21 tools) │ CLI (50+ commands)
|
|
72
|
+
v v
|
|
73
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
74
|
+
│ MemoryMaster Core │
|
|
75
|
+
│ │
|
|
76
|
+
│ ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌───────────────┐ │
|
|
77
|
+
│ │ Ingestor │ │ Extractor │ │ Validator │ │ State Engine │ │
|
|
78
|
+
│ │ (events) │->│ (claims) │->│ (probes) │->│ (6-state FSM) │ │
|
|
79
|
+
│ └──────────┘ └───────────┘ └──────────┘ └───────────────┘ │
|
|
80
|
+
│ │
|
|
81
|
+
│ ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌───────────────┐ │
|
|
82
|
+
│ │ Retrieval│ │ Compactor │ │ Steward │ │ Dashboard │ │
|
|
83
|
+
│ │ (hybrid) │ │ (archive) │ │ (govern) │ │ (HTML+SSE) │ │
|
|
84
|
+
│ └──────────┘ └───────────┘ └──────────┘ └───────────────┘ │
|
|
85
|
+
│ │
|
|
86
|
+
│ ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌───────────────┐ │
|
|
87
|
+
│ │ Entity │ │ Skill │ │ Daily │ │ Vault │ │
|
|
88
|
+
│ │ Graph │ │ Evolver │ │ Notes │ │ Exporter │ │
|
|
89
|
+
│ └──────────┘ └───────────┘ └──────────┘ └───────────────┘ │
|
|
90
|
+
│ │
|
|
91
|
+
│ ┌──────────────────────────────────────────────────────────┐ │
|
|
92
|
+
│ │ Dream Bridge — bidirectional sync with Claude Code │ │
|
|
93
|
+
│ │ Auto Dream: seed claims out, ingest corrections back │ │
|
|
94
|
+
│ └──────────────────────────────────────────────────────────┘ │
|
|
95
|
+
└────────┬──────────────┬──────────────┬──────────┬───────────────┘
|
|
96
|
+
│ │ │ │
|
|
97
|
+
v v v v
|
|
98
|
+
┌──────────────┐ ┌───────────┐ ┌───────────┐ ┌──────────────────┐
|
|
99
|
+
│ SQLite / │ │ Qdrant │ │ Ollama │ │ Claude Code │
|
|
100
|
+
│ Postgres │ │ (vectors) │ │ (LLM) │ │ Auto Dream │
|
|
101
|
+
│ │ │ │ │ │ │ + Obsidian Vault │
|
|
102
|
+
└──────────────┘ └───────────┘ └───────────┘ └──────────────────┘
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Key Features
|
|
106
|
+
|
|
107
|
+
| Feature | Description |
|
|
108
|
+
|---------|-------------|
|
|
109
|
+
| **6-State Lifecycle** | `candidate` -> `confirmed` -> `stale` -> `superseded` -> `conflicted` -> `archived` |
|
|
110
|
+
| **Citation Tracking** | Every claim links to source evidence with provenance |
|
|
111
|
+
| **Hybrid Retrieval** | Vector search (sentence-transformers/Gemini) + FTS5 + freshness + confidence ranking |
|
|
112
|
+
| **Context Optimizer** | `query_for_context(budget=4000)` -- auto-curated memory that fits your token budget |
|
|
113
|
+
| **Claims Engine** | Structured extraction from unstructured text with deduplication and conflict detection |
|
|
114
|
+
| **Entity Graph** | LLM-powered entity extraction with typed relationships between claims |
|
|
115
|
+
| **Skill Evolution** | Track and evolve agent skills based on accumulated knowledge patterns |
|
|
116
|
+
| **Steward Governance** | Multi-probe validators (filesystem, format, citation, semantic, tool) with proposal review |
|
|
117
|
+
| **LLM Steward** | Automated claim validation using configurable LLM providers with round-robin key rotation |
|
|
118
|
+
| **Conflict Resolution** | 5-tier auto-resolution: confidence > freshness > citations > LLM > manual |
|
|
119
|
+
| **Auto-Redaction** | JWT, GitHub tokens, Bearer, AWS keys, SSH keys + custom patterns scrubbed at ingest |
|
|
120
|
+
| **Daily Notes** | Automatic session summarization with ghost note detection (second brain pattern) |
|
|
121
|
+
| **Obsidian Export** | Export claims as linked Markdown files for use with My-Brain-Is-Full-Crew |
|
|
122
|
+
| **Git Versioning** | Snapshot/rollback/diff via SQLite backup API |
|
|
123
|
+
| **Multi-tenancy** | Row-level tenant isolation at the service layer |
|
|
124
|
+
| **Dual Backend** | SQLite (zero-config) and Postgres (full feature parity with pgvector) |
|
|
125
|
+
| **10+ Connectors** | Git, Slack, Jira, email, GitHub, and conversation imports |
|
|
126
|
+
| **Real-time Dashboard** | HTML UI with SSE streaming, conflict view, and triage actions |
|
|
127
|
+
| **Federated Query** | Cross-project querying across multiple memory databases |
|
|
128
|
+
| **Dream Bridge** | Bidirectional sync with Claude Code's Auto Dream — seed quality-filtered claims into `.claude/memory/`, ingest corrections back, with sensitivity filtering and dedup |
|
|
129
|
+
| **GitNexus Bridge** | Convert code intelligence (symbols, call graphs, execution flows) into memory claims for code-aware agent memory |
|
|
130
|
+
| **LLM Wiki** | Karpathy/Farza-style compiled wiki articles (compiled truth + append-only timeline) with `description`/`tags`/`date` frontmatter for progressive disclosure |
|
|
131
|
+
| **Obsidian Bases** | Auto-generated `.base` dashboards (all-claims, gotchas, decisions, recent, needs-review) regenerated on every `wiki-absorb` |
|
|
132
|
+
| **7-Hook Stack** | Recall + Classify (UserPromptSubmit), Validate-Wiki (PostToolUse), Session-Start (SessionStart), Auto-Ingest (Stop), PreCompact — full memory lifecycle without manual intervention |
|
|
133
|
+
|
|
134
|
+
## Quick Start
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Install
|
|
138
|
+
pip install memorymaster
|
|
139
|
+
|
|
140
|
+
# Initialize database
|
|
141
|
+
memorymaster --db memorymaster.db init-db
|
|
142
|
+
|
|
143
|
+
# Full setup: hooks, MCP, steward cron, Obsidian skills
|
|
144
|
+
python scripts/setup-hooks.py
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The setup script configures everything interactively:
|
|
148
|
+
- **Recall hook** — injects relevant claims into every Claude Code prompt
|
|
149
|
+
- **Auto-ingest hook** — uses a cheap LLM (Gemini Flash Lite/GPT-4o-mini/Haiku/Ollama) to extract learnings from each session
|
|
150
|
+
- **MCP server** — 21 tools available in all Claude Code & Codex sessions
|
|
151
|
+
- **Steward cron** — validates and curates claims every 6 hours
|
|
152
|
+
- **CLAUDE.md / AGENTS.md** — appends instructions so Claude and Codex actually use MemoryMaster
|
|
153
|
+
- **Obsidian skills** — read/write/search your vault from Claude Code
|
|
154
|
+
|
|
155
|
+
### Manual Quick Start
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Initialize database
|
|
159
|
+
memorymaster --db memorymaster.db init-db
|
|
160
|
+
|
|
161
|
+
# Ingest a claim with citation
|
|
162
|
+
memorymaster --db memorymaster.db ingest \
|
|
163
|
+
--text "Server uses PostgreSQL 16" \
|
|
164
|
+
--source "session://chat|turn-3|user confirmed"
|
|
165
|
+
|
|
166
|
+
# Run validation cycle
|
|
167
|
+
memorymaster --db memorymaster.db run-cycle
|
|
168
|
+
|
|
169
|
+
# Query memory (hybrid retrieval)
|
|
170
|
+
memorymaster --db memorymaster.db query "database version" --retrieval-mode hybrid
|
|
171
|
+
|
|
172
|
+
# Context optimizer -- THE killer feature for agents
|
|
173
|
+
memorymaster --db memorymaster.db context "auth patterns" --budget 4000 --format xml
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Docker Compose
|
|
177
|
+
|
|
178
|
+
Run the full stack (MemoryMaster + Qdrant + Ollama) with one command:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
docker compose up -d
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
See [INSTALLATION.md](INSTALLATION.md) for detailed setup options including Kubernetes/Helm.
|
|
185
|
+
|
|
186
|
+
### MCP Server (Claude Code / Codex)
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
pip install "memorymaster[mcp]"
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Add to your `.mcp.json` (see [`.mcp.json.example`](.mcp.json.example)):
|
|
193
|
+
|
|
194
|
+
```json
|
|
195
|
+
{
|
|
196
|
+
"mcpServers": {
|
|
197
|
+
"memorymaster": {
|
|
198
|
+
"command": "memorymaster-mcp",
|
|
199
|
+
"env": {
|
|
200
|
+
"MEMORYMASTER_DEFAULT_DB": "/path/to/memorymaster.db",
|
|
201
|
+
"MEMORYMASTER_WORKSPACE": "/path/to/your/project"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**21 MCP tools:** `init_db`, `ingest_claim`, `run_cycle`, `run_steward`, `classify_query`, `query_memory`, `query_for_context`, `list_claims`, `redact_claim_payload`, `pin_claim`, `compact_memory`, `list_events`, `open_dashboard`, `list_steward_proposals`, `resolve_steward_proposal`, `extract_entities`, `entity_stats`, `find_related_claims`, `quality_scores`, `recompute_tiers`, `federated_query`
|
|
209
|
+
|
|
210
|
+
## How It All Works (E2E)
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
YOU SEND A MESSAGE
|
|
214
|
+
│
|
|
215
|
+
▼
|
|
216
|
+
┌──────────────────┐
|
|
217
|
+
│ Recall Hook │ UserPromptSubmit: searches DB for relevant claims,
|
|
218
|
+
│ (read memory) │ injects as invisible context so Claude knows things
|
|
219
|
+
│ │ from previous sessions automatically
|
|
220
|
+
└──────────────────┘
|
|
221
|
+
│
|
|
222
|
+
▼
|
|
223
|
+
CLAUDE / CODEX WORKS
|
|
224
|
+
(edits, debugs, commits)
|
|
225
|
+
│
|
|
226
|
+
▼
|
|
227
|
+
┌──────────────────┐
|
|
228
|
+
│ Stop Hook │ When Claude stops: sends last messages to cheap LLM
|
|
229
|
+
│ (write memory) │ (Gemini Flash Lite / GPT-4o-mini / Haiku / Ollama),
|
|
230
|
+
│ │ extracts max 3 non-obvious learnings, ingests as
|
|
231
|
+
│ │ candidate claims (confidence 0.6)
|
|
232
|
+
└──────────────────┘
|
|
233
|
+
│
|
|
234
|
+
▼
|
|
235
|
+
CLAIM IN DB (status: candidate)
|
|
236
|
+
│
|
|
237
|
+
├──── every 6h ──── STEWARD CRON validates candidates,
|
|
238
|
+
│ promotes good ones to confirmed,
|
|
239
|
+
│ decays old claims, exports to Obsidian vault
|
|
240
|
+
│
|
|
241
|
+
├──── every 15m ─── OPENCLAW SYNC merges claims bidirectionally
|
|
242
|
+
│ between your PC and the server (no overwrites)
|
|
243
|
+
│
|
|
244
|
+
└──── every 24h ─── CLAUDE AUTO DREAM consolidates memory files,
|
|
245
|
+
dream-bridge syncs with MemoryMaster DB
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### What gets installed by `setup-hooks.py`
|
|
249
|
+
|
|
250
|
+
| Component | What it does | Runs when |
|
|
251
|
+
|-----------|-------------|-----------|
|
|
252
|
+
| **Recall hook** | Injects relevant claims into every prompt | Every message you send |
|
|
253
|
+
| **Auto-ingest hook** | LLM extracts learnings from transcript | Every time Claude stops |
|
|
254
|
+
| **MCP server** (global) | 21 tools for query/ingest/steward | Always available |
|
|
255
|
+
| **CLAUDE.md append** | Instructions for Claude to use MemoryMaster | Read at session start |
|
|
256
|
+
| **AGENTS.md append** | Instructions for Codex to use MemoryMaster | Read at session start |
|
|
257
|
+
| **Steward cron** | Validates, decays, compacts claims | Every 6 hours |
|
|
258
|
+
| **Obsidian skills** | Read/write/search vault via CLI | On demand |
|
|
259
|
+
|
|
260
|
+
### Supported LLM providers for auto-ingest
|
|
261
|
+
|
|
262
|
+
| Provider | Env var | Default model | Cost |
|
|
263
|
+
|----------|---------|---------------|------|
|
|
264
|
+
| Google Gemini (default) | `GEMINI_API_KEY` | `gemini-3.1-flash-lite-preview` | ~free |
|
|
265
|
+
| OpenAI | `OPENAI_API_KEY` | `gpt-4o-mini` | ~$0.001/call |
|
|
266
|
+
| Anthropic | `ANTHROPIC_API_KEY` | `claude-haiku-4-5-20251001` | ~$0.001/call |
|
|
267
|
+
| Ollama (local) | `OLLAMA_URL` | `llama3.2:3b` | free |
|
|
268
|
+
|
|
269
|
+
## Operator Runtime
|
|
270
|
+
|
|
271
|
+
Process conversation turns from a JSONL inbox with automatic claim extraction, retrieval, and maintenance:
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
memorymaster --db memory.db run-operator \
|
|
275
|
+
--inbox-jsonl turns.jsonl \
|
|
276
|
+
--retrieval-mode hybrid \
|
|
277
|
+
--policy-mode cadence \
|
|
278
|
+
--max-idle-seconds 120 \
|
|
279
|
+
--log-jsonl artifacts/operator/events.jsonl
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Features: restart-safe checkpointing, durable pending-turn queue, progressive tiered retrieval, configurable maintenance cadence, `<private>...</private>` block exclusion.
|
|
283
|
+
|
|
284
|
+
## Dashboard
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
memorymaster --db memory.db run-dashboard --port 8765
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Open `http://127.0.0.1:8765/dashboard` for:
|
|
291
|
+
- Claims table with status filters
|
|
292
|
+
- Timeline feed with transition history
|
|
293
|
+
- Conflict comparison view
|
|
294
|
+
- Review queue with approve/reject actions
|
|
295
|
+
- Live SSE operator event stream
|
|
296
|
+
|
|
297
|
+
**API endpoints:** `/health`, `/api/claims`, `/api/events`, `/api/timeline`, `/api/conflicts`, `/api/review-queue`, `/api/triage/action`, `/api/operator/stream`
|
|
298
|
+
|
|
299
|
+
## Steward Governance
|
|
300
|
+
|
|
301
|
+
The steward probes confirmed claims for staleness using multiple validators:
|
|
302
|
+
|
|
303
|
+
| Probe | What it checks |
|
|
304
|
+
|-------|----------------|
|
|
305
|
+
| `filesystem_grep` | Does the claim value appear in workspace files? |
|
|
306
|
+
| `deterministic_format` | Is the object value well-formed (IP, URL, email, date)? |
|
|
307
|
+
| `deterministic_citation_locator` | Do cited sources still exist and match? |
|
|
308
|
+
| `semantic_probe` | Does surrounding context still support the claim? |
|
|
309
|
+
| `tool_probe` | Does running the relevant tool confirm the value? |
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# Non-destructive audit (proposals only)
|
|
313
|
+
memorymaster --db memory.db --workspace . run-steward --mode manual --max-cycles 1
|
|
314
|
+
|
|
315
|
+
# Apply transitions
|
|
316
|
+
memorymaster --db memory.db --workspace . run-steward --mode manual --apply
|
|
317
|
+
|
|
318
|
+
# Review and resolve proposals
|
|
319
|
+
memorymaster --db memory.db steward-proposals --limit 50
|
|
320
|
+
memorymaster --db memory.db resolve-proposal --action approve --claim-id 42
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
## Connectors
|
|
324
|
+
|
|
325
|
+
Import from any source into the operator inbox:
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
# Git commits
|
|
329
|
+
python scripts/git_to_turns.py --input export.json --output turns.jsonl
|
|
330
|
+
|
|
331
|
+
# Slack messages
|
|
332
|
+
python scripts/slack_live_to_turns.py --input config.json --output turns.jsonl
|
|
333
|
+
|
|
334
|
+
# Jira / GitHub / Email / Conversations
|
|
335
|
+
python scripts/jira_live_to_turns.py --input config.json --output turns.jsonl
|
|
336
|
+
python scripts/github_live_to_turns.py --input config.json --output turns.jsonl
|
|
337
|
+
python scripts/email_live_to_turns.py --input config.json --output turns.jsonl
|
|
338
|
+
python scripts/conversation_importer.py --input chat.json --output turns.jsonl
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## Obsidian Integration (My-Brain-Is-Full-Crew)
|
|
342
|
+
|
|
343
|
+
Export claims as linked Obsidian-compatible Markdown files:
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
memorymaster --db memory.db export-vault --output ./obsidian-vault/
|
|
347
|
+
memorymaster --db memory.db export-vault --output ./vault/ --scope project:myapp --confirmed-only
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Use with [My-Brain-Is-Full-Crew](https://github.com/wolverin0/My-Brain-Is-Full-Crew) for Obsidian vault management, daily notes, and ghost note detection.
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
# Daily activity summary
|
|
354
|
+
memorymaster --db memory.db daily-note
|
|
355
|
+
|
|
356
|
+
# Find knowledge gaps (topics queried but underexplored)
|
|
357
|
+
memorymaster --db memory.db ghost-notes
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
## Dream Bridge (Claude Code Auto Dream Sync)
|
|
361
|
+
|
|
362
|
+
MemoryMaster integrates with Claude Code's **Auto Dream** memory consolidation system. While Auto Dream provides basic session-to-memory consolidation, MemoryMaster adds structured claims, quality scoring, entity graphs, and security filtering on top.
|
|
363
|
+
|
|
364
|
+
**The problem Auto Dream solves:** Claude Code accumulates memories across sessions, but they drift, contradict each other, and degrade over time. Auto Dream consolidates them every 24 hours.
|
|
365
|
+
|
|
366
|
+
**What MemoryMaster adds:** A quality layer — structured claims with confidence scores, decay, deduplication, conflict resolution, and a sensitivity filter that blocks credentials, private IPs, personal paths, and code snippets from leaking into memory files.
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
# Export top claims as Claude Code memory files
|
|
370
|
+
memorymaster --db memory.db dream-seed --project /path/to/project --max 30
|
|
371
|
+
|
|
372
|
+
# Import Auto Dream memories back as claims
|
|
373
|
+
memorymaster --db memory.db dream-ingest --project /path/to/project
|
|
374
|
+
|
|
375
|
+
# Bidirectional sync (ingest + re-export)
|
|
376
|
+
memorymaster --db memory.db dream-sync --project /path/to/project
|
|
377
|
+
|
|
378
|
+
# Remove all MemoryMaster-seeded files
|
|
379
|
+
memorymaster --db memory.db dream-clean --project /path/to/project
|
|
380
|
+
|
|
381
|
+
# Automatic: run as part of the steward cycle
|
|
382
|
+
memorymaster --db memorymaster.db run-cycle --with-dream-sync --dream-project /path/to/project
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### How it works
|
|
386
|
+
|
|
387
|
+
```
|
|
388
|
+
MemoryMaster DB ──seed──▶ .claude/projects/<slug>/memory/ ◀── Auto Dream
|
|
389
|
+
▲ │ (24h cycle)
|
|
390
|
+
└────────── ingest ────────────┘
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
1. **dream-seed** queries claims filtered by tier (core/working), quality score, and sensitivity
|
|
394
|
+
2. Maps MemoryMaster categories to Auto Dream types (`feedback`, `project`, `user`, `reference`)
|
|
395
|
+
3. Writes markdown files with YAML frontmatter that Auto Dream can consolidate
|
|
396
|
+
4. **dream-ingest** reads non-MemoryMaster memory files back as claims (captures user corrections)
|
|
397
|
+
5. **dream-sync** (or `run-cycle --with-dream-sync`) does both in one pass
|
|
398
|
+
|
|
399
|
+
### Safety
|
|
400
|
+
|
|
401
|
+
- Blocks private IPs (`192.168.x.x`, `10.x.x.x`), personal paths, SSH commands
|
|
402
|
+
- Blocks credentials (API keys, tokens, passwords, `[REDACTED]` markers)
|
|
403
|
+
- Blocks raw code snippets (>50% shell commands)
|
|
404
|
+
- Near-duplicate detection (70% word overlap threshold)
|
|
405
|
+
- Respects Auto Dream's `.dream.lock` file — never writes during consolidation
|
|
406
|
+
- MEMORY.md index capped at 200 lines
|
|
407
|
+
|
|
408
|
+
## Auto-Ingest Stop Hook (LLM-powered memory capture)
|
|
409
|
+
|
|
410
|
+
MemoryMaster includes a Claude Code **Stop hook** that automatically extracts learnings from each session using a lightweight LLM. When Claude finishes responding, the hook reads the session transcript, sends the last assistant messages to a cheap/fast LLM, and ingests any non-obvious learnings as candidate claims.
|
|
411
|
+
|
|
412
|
+
### Supported LLM Providers
|
|
413
|
+
|
|
414
|
+
| Provider | Env Var | Default Model | Cost |
|
|
415
|
+
|----------|---------|---------------|------|
|
|
416
|
+
| **Google Gemini** (default) | `GEMINI_API_KEY` | `gemini-3.1-flash-lite-preview` | ~free |
|
|
417
|
+
| **OpenAI** | `OPENAI_API_KEY` | `gpt-4o-mini` | ~$0.001/call |
|
|
418
|
+
| **Anthropic** | `ANTHROPIC_API_KEY` | `claude-haiku-4-5-20251001` | ~$0.001/call |
|
|
419
|
+
| **Ollama** (local) | `OLLAMA_URL` | `llama3.2:3b` | free |
|
|
420
|
+
|
|
421
|
+
### Configuration
|
|
422
|
+
|
|
423
|
+
Set your provider and API key as environment variables:
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
# Google Gemini (default, cheapest cloud option)
|
|
427
|
+
export MEMORYMASTER_LLM_PROVIDER=google
|
|
428
|
+
export GEMINI_API_KEY=your-key-here
|
|
429
|
+
|
|
430
|
+
# OpenAI
|
|
431
|
+
export MEMORYMASTER_LLM_PROVIDER=openai
|
|
432
|
+
export OPENAI_API_KEY=sk-...
|
|
433
|
+
|
|
434
|
+
# Anthropic Claude
|
|
435
|
+
export MEMORYMASTER_LLM_PROVIDER=anthropic
|
|
436
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
437
|
+
|
|
438
|
+
# Local Ollama (no API key needed)
|
|
439
|
+
export MEMORYMASTER_LLM_PROVIDER=ollama
|
|
440
|
+
export OLLAMA_URL=http://localhost:11434
|
|
441
|
+
|
|
442
|
+
# Optional: override model for any provider
|
|
443
|
+
export MEMORYMASTER_LLM_MODEL=gemini-2.5-flash
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
### How it works
|
|
447
|
+
|
|
448
|
+
1. Claude Code Stop hook fires after each response
|
|
449
|
+
2. Script reads last assistant messages from session transcript (JSONL)
|
|
450
|
+
3. Sends to configured LLM with curator prompt (extracts max 3 learnings per turn)
|
|
451
|
+
4. Ingests as `candidate` claims with `confidence=0.6`
|
|
452
|
+
5. Steward cycle (every 6h) validates and promotes good candidates to `confirmed`
|
|
453
|
+
|
|
454
|
+
The hook never blocks — it always approves the stop. Sensitivity filter rejects any claims containing credentials, private IPs, or tokens.
|
|
455
|
+
|
|
456
|
+
### Using the LLM provider in your own code
|
|
457
|
+
|
|
458
|
+
```python
|
|
459
|
+
from memorymaster.llm_provider import call_llm, parse_json_response
|
|
460
|
+
|
|
461
|
+
response = call_llm("Extract key facts:", "The bug was caused by missing RLS policies")
|
|
462
|
+
claims = parse_json_response(response)
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
## OpenClaw Integration
|
|
466
|
+
|
|
467
|
+
MemoryMaster integrates with [OpenClaw](https://github.com/wolverin0/openclaw) for multi-agent orchestration. Claims, entities, and memory context flow between MemoryMaster and the OpenClaw task board via the `federated-query` command and the `openclaw2claude` MCP bridge.
|
|
468
|
+
|
|
469
|
+
```bash
|
|
470
|
+
# Quick install via OpenClaw installer
|
|
471
|
+
curl -sSL https://raw.githubusercontent.com/wolverin0/memorymaster/main/scripts/openclaw-install.sh | bash
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
## GitNexus Integration (Code Intelligence)
|
|
475
|
+
|
|
476
|
+
MemoryMaster pairs with [GitNexus](https://github.com/wolverin0/gitnexus) to bridge **code knowledge** and **agent memory**. GitNexus builds a knowledge graph of your codebase (symbols, relationships, execution flows), and MemoryMaster stores the claims that emerge from working with that code.
|
|
477
|
+
|
|
478
|
+
### How they work together
|
|
479
|
+
|
|
480
|
+
| Layer | Tool | What it knows |
|
|
481
|
+
|-------|------|---------------|
|
|
482
|
+
| **Code structure** | GitNexus | Functions, classes, call graphs, execution flows, blast radius |
|
|
483
|
+
| **Agent memory** | MemoryMaster | Facts, decisions, corrections, preferences, entity relationships |
|
|
484
|
+
| **Bridge** | `gitnexus_to_claims.py` | Converts GitNexus analysis into MemoryMaster claims |
|
|
485
|
+
|
|
486
|
+
### Workflow
|
|
487
|
+
|
|
488
|
+
```bash
|
|
489
|
+
# 1. Index your codebase with GitNexus
|
|
490
|
+
npx gitnexus analyze
|
|
491
|
+
|
|
492
|
+
# 2. Convert code intelligence into memory claims
|
|
493
|
+
python scripts/gitnexus_to_claims.py --project myapp
|
|
494
|
+
|
|
495
|
+
# 3. Query with both code and memory context
|
|
496
|
+
memorymaster --db memorymaster.db query "auth validation" --retrieval-mode hybrid
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### Impact analysis before editing
|
|
500
|
+
|
|
501
|
+
GitNexus provides blast-radius analysis that MemoryMaster can reference:
|
|
502
|
+
|
|
503
|
+
```bash
|
|
504
|
+
# Check what breaks if you change a function
|
|
505
|
+
npx gitnexus impact --target "validateUser" --direction upstream
|
|
506
|
+
|
|
507
|
+
# MemoryMaster remembers past decisions about that function
|
|
508
|
+
memorymaster --db memorymaster.db query "validateUser" --retrieval-mode hybrid
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
When both are configured as MCP servers, Claude Code gets **code-aware memory** — it can trace execution flows (GitNexus) and recall past decisions about those flows (MemoryMaster).
|
|
512
|
+
|
|
513
|
+
## New in v2.0
|
|
514
|
+
|
|
515
|
+
```bash
|
|
516
|
+
# Deduplication
|
|
517
|
+
memorymaster --db memory.db dedup --dry-run
|
|
518
|
+
|
|
519
|
+
# Conflict resolution
|
|
520
|
+
memorymaster --db memory.db resolve-conflicts
|
|
521
|
+
|
|
522
|
+
# Claims needing attention
|
|
523
|
+
memorymaster --db memory.db ready
|
|
524
|
+
|
|
525
|
+
# Claim audit trail
|
|
526
|
+
memorymaster --db memory.db history 42
|
|
527
|
+
|
|
528
|
+
# Claim relationships
|
|
529
|
+
memorymaster --db memory.db link 10 20 --type supersedes
|
|
530
|
+
memorymaster --db memory.db links 10
|
|
531
|
+
|
|
532
|
+
# Staleness detection
|
|
533
|
+
memorymaster --db memory.db check-staleness --workspace /path/to/project
|
|
534
|
+
|
|
535
|
+
# LLM compaction summaries
|
|
536
|
+
memorymaster --db memory.db compact-summaries --provider gemini --api-key $KEY
|
|
537
|
+
|
|
538
|
+
# Git-backed versioning
|
|
539
|
+
memorymaster --db memory.db snapshot --message "before refactor"
|
|
540
|
+
memorymaster --db memory.db rollback snap_abc123
|
|
541
|
+
|
|
542
|
+
# Stealth mode (local-only experimentation)
|
|
543
|
+
memorymaster --stealth init-db
|
|
544
|
+
|
|
545
|
+
# JSON output for all commands
|
|
546
|
+
memorymaster --db memory.db --json list-claims
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
## New in v3.2 — Wiki Frontmatter Schema + Hook Automation
|
|
550
|
+
|
|
551
|
+
This release adds **4 obsidian-mind-inspired patterns** that turn MemoryMaster into a fully passive memory system. You don't need to remember to call MCP tools — hooks do the work:
|
|
552
|
+
|
|
553
|
+
### New Hooks
|
|
554
|
+
|
|
555
|
+
| Hook | Event | What it does |
|
|
556
|
+
|------|-------|--------------|
|
|
557
|
+
| `memorymaster-classify.py` | UserPromptSubmit | Regex signal matcher (Spanish + English, Latin-letter lookarounds for CJK safety). Detects DECISION / BUG_ROOT_CAUSE / GOTCHA / CONSTRAINT / ARCHITECTURE / ENVIRONMENT / REFERENCE in your prompts and injects routing hints so the agent calls `ingest_claim` after the work. Zero LLM calls, ~5 ms runtime. |
|
|
558
|
+
| `memorymaster-validate-wiki.py` | PostToolUse (Edit/Write) | Fires only on `obsidian-vault/wiki/**/*.md`. Checks frontmatter (`title`, `description`, `type`, `scope`, `tags`, `date`) and warns if the article is an orphan (no `[[wikilinks]]` and body > 300 chars). Returns warnings via `hookSpecificOutput.additionalContext` so the agent fixes them in-place. |
|
|
559
|
+
| `memorymaster-session-start.py` | SessionStart (startup\|resume) | Queries the DB for recent claims, last cycle summary (ingest/validate/decay/supersession counts), pending candidates, and most-recently-updated wiki articles. Injects everything into the session context so the agent starts informed instead of blank. Scope auto-derived from cwd. |
|
|
560
|
+
|
|
561
|
+
All hooks fail silently (`exit 0`) on any exception — they never block the user.
|
|
562
|
+
|
|
563
|
+
### Wiki Article Frontmatter Schema
|
|
564
|
+
|
|
565
|
+
`wiki_engine._write_article` now emits a richer frontmatter for every absorbed article:
|
|
566
|
+
|
|
567
|
+
```yaml
|
|
568
|
+
---
|
|
569
|
+
title: Qdrant
|
|
570
|
+
description: "Qdrant is deployed on an Ubuntu VM, accessible via localhost:6333..."
|
|
571
|
+
type: decision
|
|
572
|
+
scope: project:memorymaster
|
|
573
|
+
tags: ["decision", "project-memorymaster", "fact"]
|
|
574
|
+
claims: [7966, 8062, 8107]
|
|
575
|
+
created: 2026-04-09
|
|
576
|
+
last_updated: 2026-04-09
|
|
577
|
+
date: 2026-04-09
|
|
578
|
+
related: ["[[storage]]", "[[vector-search]]"]
|
|
579
|
+
---
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
The new fields enable **progressive disclosure**: an agent can scan 50 articles' frontmatter before deciding which to read in full, and Obsidian Bases can filter on `type` / `tags` / `date`.
|
|
583
|
+
|
|
584
|
+
### Obsidian Bases Generator
|
|
585
|
+
|
|
586
|
+
`memorymaster/vault_bases.py` writes 5 dynamic dashboards under `obsidian-vault/bases/`:
|
|
587
|
+
|
|
588
|
+
| Base | Shows |
|
|
589
|
+
|------|-------|
|
|
590
|
+
| `all-claims.base` | Every wiki article, sortable by date / type / scope |
|
|
591
|
+
| `gotchas.base` | Articles with `type=gotcha` or `tags.contains("gotcha")` |
|
|
592
|
+
| `decisions.base` | Articles with `type=decision` or `type=architecture` |
|
|
593
|
+
| `recent.base` | Articles updated in the last 14 days |
|
|
594
|
+
| `needs-review.base` | Articles missing a `description` field |
|
|
595
|
+
|
|
596
|
+
Bases regenerate automatically on `wiki-absorb` (use `--no-bases` to skip). They are pure YAML — open any `.base` file in Obsidian to see a live filterable view.
|
|
597
|
+
|
|
598
|
+
### CLI
|
|
599
|
+
|
|
600
|
+
```bash
|
|
601
|
+
# Regenerate Bases manually
|
|
602
|
+
python -m memorymaster --db memorymaster.db bases-generate --output obsidian-vault
|
|
603
|
+
|
|
604
|
+
# Wiki absorb now also regenerates Bases automatically
|
|
605
|
+
python -m memorymaster --db memorymaster.db wiki-absorb --output obsidian-vault
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
### Required Tools
|
|
609
|
+
|
|
610
|
+
- **Python 3.10+** with stdlib `sqlite3` (everything is stdlib — no extra deps)
|
|
611
|
+
- **Obsidian 1.6+** with **Bases core plugin enabled** (for `.base` dashboards). The plugin ships with Obsidian — just enable it under Settings → Core plugins.
|
|
612
|
+
|
|
613
|
+
### Optional Third-Party MCPs
|
|
614
|
+
|
|
615
|
+
These are optional but enhance the experience:
|
|
616
|
+
|
|
617
|
+
| MCP | What it adds | Install |
|
|
618
|
+
|-----|--------------|---------|
|
|
619
|
+
| **memorymaster** | The 21 MCP tools (`ingest_claim`, `query_memory`, `run_cycle`, etc.) | `python scripts/setup-hooks.py` (interactive) |
|
|
620
|
+
| **GitNexus** | Code-graph aware impact analysis before edits | See [GitNexus Integration](#gitnexus-integration-code-intelligence) |
|
|
621
|
+
| **Obsidian CLI** | Vault-aware search via the obsidian CLI tool | `npm install -g obsidian-cli` (requires Obsidian 1.12+) |
|
|
622
|
+
| **Qdrant** | Vector search backend for semantic recall | `docker run -p 6333:6333 qdrant/qdrant` |
|
|
623
|
+
|
|
624
|
+
### Installation
|
|
625
|
+
|
|
626
|
+
```bash
|
|
627
|
+
# 1. Clone and install MemoryMaster
|
|
628
|
+
git clone https://github.com/your-org/memorymaster.git
|
|
629
|
+
cd memorymaster
|
|
630
|
+
pip install -e .
|
|
631
|
+
|
|
632
|
+
# 2. Run the interactive installer (sets up MCP, hooks, env vars, steward cron)
|
|
633
|
+
python scripts/setup-hooks.py
|
|
634
|
+
|
|
635
|
+
# 3. The installer copies hooks from config-templates/hooks/ to ~/.claude/hooks/
|
|
636
|
+
# and registers them in ~/.claude/settings.json automatically.
|
|
637
|
+
|
|
638
|
+
# 4. Verify
|
|
639
|
+
python -m memorymaster --db memorymaster.db query "test"
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
### Tests
|
|
643
|
+
|
|
644
|
+
32 E2E tests in `tests/test_obsidian_mind_patterns.py` validate all 5 components:
|
|
645
|
+
|
|
646
|
+
```bash
|
|
647
|
+
python -m pytest tests/test_obsidian_mind_patterns.py -v
|
|
648
|
+
# 32 passed
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
## Security
|
|
652
|
+
|
|
653
|
+
- **Auto-redaction**: JWT, GitHub tokens, Bearer, AWS keys, SSH keys, and custom patterns scrubbed at ingest
|
|
654
|
+
- **Policy-gated access**: `--allow-sensitive` requires `MEMORYMASTER_ALLOW_SENSITIVE_BYPASS=1`
|
|
655
|
+
- **Non-destructive redaction**: `redact-claim` scrubs claim/citation data with full audit trail
|
|
656
|
+
- **Encryption**: Optional Fernet encryption for sensitive payloads (`pip install "memorymaster[security]"`)
|
|
657
|
+
- **RBAC**: Role-based access control with per-agent role overrides via env vars
|
|
658
|
+
|
|
659
|
+
## Performance
|
|
660
|
+
|
|
661
|
+
SLO-driven benchmarks with configurable profiles:
|
|
662
|
+
|
|
663
|
+
| Metric | Quick Profile | Production Profile |
|
|
664
|
+
|--------|--------------|-------------------|
|
|
665
|
+
| Ingest p95 | <= 60ms | <= 80ms |
|
|
666
|
+
| Ingest throughput | >= 80 ops/sec | >= 60 ops/sec |
|
|
667
|
+
| Query p95 | <= 250ms | <= 400ms |
|
|
668
|
+
| Query throughput | >= 12 ops/sec | >= 8 ops/sec |
|
|
669
|
+
| Cycle p95 | <= 3.5s | <= 6.0s |
|
|
670
|
+
| End-to-end runtime | <= 20s | <= 45s |
|
|
671
|
+
|
|
672
|
+
```bash
|
|
673
|
+
python benchmarks/perf_smoke.py --slo-config benchmarks/slo_targets.json
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
## Configuration
|
|
677
|
+
|
|
678
|
+
All behavior is tunable via environment variables or a JSON config file. See [`.env.example`](.env.example) for the complete list.
|
|
679
|
+
|
|
680
|
+
Key config groups:
|
|
681
|
+
- **Retrieval weights**: Lexical, confidence, freshness, vector balance
|
|
682
|
+
- **Decay rates**: Per-volatility daily decay
|
|
683
|
+
- **Thresholds**: Validation, staleness, conflict margin
|
|
684
|
+
- **LLM models**: Extractor, resolver, entity extraction model overrides
|
|
685
|
+
|
|
686
|
+
## Backends
|
|
687
|
+
|
|
688
|
+
| Backend | Install | Use case |
|
|
689
|
+
|---------|---------|----------|
|
|
690
|
+
| **SQLite** | Built-in | Local development, single-agent, zero-config |
|
|
691
|
+
| **Postgres** | `pip install "memorymaster[postgres]"` | Team deployment, multi-agent, pgvector search |
|
|
692
|
+
|
|
693
|
+
## Development
|
|
694
|
+
|
|
695
|
+
```bash
|
|
696
|
+
# Install with all dev dependencies
|
|
697
|
+
pip install -e ".[dev,mcp,security,embeddings,qdrant]"
|
|
698
|
+
|
|
699
|
+
# Run tests (932 tests)
|
|
700
|
+
pytest tests/ -q
|
|
701
|
+
|
|
702
|
+
# Lint and format
|
|
703
|
+
ruff check memorymaster/ && ruff format memorymaster/
|
|
704
|
+
|
|
705
|
+
# Performance benchmarks
|
|
706
|
+
python benchmarks/perf_smoke.py
|
|
707
|
+
|
|
708
|
+
# Evaluation suite
|
|
709
|
+
python scripts/eval_memorymaster.py --strict
|
|
710
|
+
|
|
711
|
+
# Incident drill
|
|
712
|
+
python scripts/run_incident_drill.py --dry-run
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the full development workflow.
|
|
716
|
+
|
|
717
|
+
## Documentation
|
|
718
|
+
|
|
719
|
+
| Document | Description |
|
|
720
|
+
|----------|-------------|
|
|
721
|
+
| [INSTALLATION.md](INSTALLATION.md) | Setup guide: pip, Docker, Helm, MCP config |
|
|
722
|
+
| [CONTRIBUTING.md](CONTRIBUTING.md) | Dev setup, testing, PR workflow |
|
|
723
|
+
| [ARCHITECTURE.md](ARCHITECTURE.md) | System design and subsystem details |
|
|
724
|
+
| [USER_GUIDE.md](USER_GUIDE.md) | Usage, MCP integration, troubleshooting |
|
|
725
|
+
| [CHANGELOG.md](CHANGELOG.md) | Version history and release notes |
|
|
726
|
+
| [ROADMAP.md](ROADMAP.md) | Release plan and future tracks |
|
|
727
|
+
|
|
728
|
+
## License
|
|
729
|
+
|
|
730
|
+
[MIT](LICENSE) -- Built by [wolverin0](https://github.com/wolverin0)
|