memorymaster 3.4.1__tar.gz → 3.5.1__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.
Files changed (325) hide show
  1. memorymaster-3.5.1/PKG-INFO +231 -0
  2. memorymaster-3.5.1/README.md +187 -0
  3. memorymaster-3.5.1/artifacts/bm25-per-field-eval-harness.py +309 -0
  4. memorymaster-3.5.1/artifacts/l2-haiku-batches/extract.py +66 -0
  5. memorymaster-3.5.1/cloned/MetaClaw/examples/run_conversation_opd.py +64 -0
  6. memorymaster-3.5.1/cloned/MetaClaw/examples/run_conversation_replay.py +242 -0
  7. memorymaster-3.5.1/cloned/MetaClaw/examples/run_conversation_rl.py +118 -0
  8. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/__init__.py +39 -0
  9. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/__main__.py +5 -0
  10. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/api_server.py +1782 -0
  11. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/bedrock_client.py +195 -0
  12. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/calendar_client.py +290 -0
  13. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/claw_adapter.py +597 -0
  14. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/cli.py +559 -0
  15. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/config.py +200 -0
  16. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/config_store.py +283 -0
  17. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/data_formatter.py +242 -0
  18. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/idle_detector.py +122 -0
  19. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/launcher.py +273 -0
  20. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/log_color.py +150 -0
  21. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/openclaw_env_rollout.py +384 -0
  22. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/prm_scorer.py +244 -0
  23. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/rollout.py +189 -0
  24. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/runtime_state.py +131 -0
  25. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/scheduler.py +254 -0
  26. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/sdk_backend.py +166 -0
  27. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/setup_wizard.py +420 -0
  28. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/skill_evolver.py +463 -0
  29. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/skill_manager.py +487 -0
  30. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/trainer.py +560 -0
  31. memorymaster-3.5.1/cloned/MetaClaw/metaclaw/utils.py +161 -0
  32. memorymaster-3.5.1/cloned/MetaClaw/scripts/run_v03_benchmark.py +310 -0
  33. memorymaster-3.5.1/cloned/MetaClaw/tests/conftest.py +7 -0
  34. memorymaster-3.5.1/cloned/MetaClaw/tests/test_cli.py +352 -0
  35. memorymaster-3.5.1/cloned/MetaClaw/tests/test_launcher.py +98 -0
  36. memorymaster-3.5.1/cloned/MetaClaw/tests/test_openclaw_env_rollout.py +153 -0
  37. memorymaster-3.5.1/cloned/MetaClaw/tests/test_runtime_state.py +62 -0
  38. memorymaster-3.5.1/cloned/MetaClaw/tests/test_sdk_backend.py +144 -0
  39. memorymaster-3.5.1/cloned/MetaClaw/tests/test_setup_wizard.py +130 -0
  40. memorymaster-3.5.1/cloned/MetaClaw/tests/test_utils.py +211 -0
  41. memorymaster-3.5.1/cloned/MetaClaw/tests/test_v03_live_tinker.py +743 -0
  42. memorymaster-3.5.1/cloned/agent-skill-creator/references/examples/stock-analyzer/scripts/main.py +397 -0
  43. memorymaster-3.5.1/cloned/agent-skill-creator/scripts/export_utils.py +845 -0
  44. memorymaster-3.5.1/cloned/agent-skill-creator/scripts/security_scan.py +423 -0
  45. memorymaster-3.5.1/cloned/agent-skill-creator/scripts/skill_registry.py +823 -0
  46. memorymaster-3.5.1/cloned/agent-skill-creator/scripts/staleness_check.py +796 -0
  47. memorymaster-3.5.1/cloned/agent-skill-creator/scripts/validate.py +461 -0
  48. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/__init__.py +5 -5
  49. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/_storage_lifecycle.py +552 -552
  50. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/_storage_read.py +654 -654
  51. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/_storage_schema.py +652 -652
  52. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/_storage_shared.py +41 -41
  53. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/_storage_write_claims.py +353 -353
  54. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/access_control.py +126 -126
  55. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/auto_extractor.py +139 -139
  56. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/auto_resolver.py +220 -220
  57. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/cli.py +442 -434
  58. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/cli_handlers_basic.py +716 -716
  59. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/cli_handlers_curation.py +893 -823
  60. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/cli_helpers.py +138 -138
  61. memorymaster-3.5.1/memorymaster/config_templates/hooks/memorymaster-auto-ingest.py +222 -0
  62. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/config_templates/hooks/memorymaster-classify.py +304 -216
  63. memorymaster-3.5.1/memorymaster/config_templates/hooks/memorymaster-dream-sync.py +27 -0
  64. memorymaster-3.5.1/memorymaster/config_templates/hooks/memorymaster-observe.py +39 -0
  65. memorymaster-3.5.1/memorymaster/config_templates/hooks/memorymaster-precompact.py +76 -0
  66. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/config_templates/hooks/memorymaster-recall.py +32 -27
  67. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/config_templates/hooks/memorymaster-session-start.py +272 -251
  68. memorymaster-3.5.1/memorymaster/config_templates/hooks/memorymaster-steward-cycle.py +49 -0
  69. memorymaster-3.5.1/memorymaster/context_hook.py +1561 -0
  70. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/context_optimizer.py +253 -253
  71. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/dashboard.py +1059 -1059
  72. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/db_merge.py +156 -156
  73. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/dream_bridge.py +697 -697
  74. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/embeddings.py +199 -181
  75. memorymaster-3.5.1/memorymaster/entity_extractor.py +690 -0
  76. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/entity_graph.py +313 -313
  77. memorymaster-3.5.1/memorymaster/entity_registry.py +456 -0
  78. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/feedback.py +247 -247
  79. memorymaster-3.5.1/memorymaster/graph_store.py +570 -0
  80. memorymaster-3.5.1/memorymaster/hook_log.py +65 -0
  81. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/jobs/__init__.py +5 -5
  82. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/jobs/decay.py +50 -50
  83. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/jobs/deterministic.py +376 -376
  84. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/jobs/validator.py +233 -193
  85. memorymaster-3.5.1/memorymaster/key_rotator.py +176 -0
  86. memorymaster-3.5.1/memorymaster/llm_provider.py +469 -0
  87. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/llm_steward.py +847 -847
  88. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/mcp_server.py +962 -919
  89. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/metrics_exporter.py +1 -1
  90. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/models.py +336 -336
  91. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/operator.py +1453 -1453
  92. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/policy.py +133 -110
  93. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/postgres_store.py +1665 -1665
  94. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/qdrant_backend.py +327 -327
  95. memorymaster-3.5.1/memorymaster/qdrant_recall_fallback.py +305 -0
  96. memorymaster-3.5.1/memorymaster/query_expansion.py +184 -0
  97. memorymaster-3.5.1/memorymaster/recall_fusion.py +79 -0
  98. memorymaster-3.5.1/memorymaster/recall_tokenizer.py +305 -0
  99. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/retrieval.py +237 -237
  100. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/scheduler.py +98 -98
  101. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/schema.sql +123 -123
  102. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/security.py +363 -231
  103. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/service.py +792 -764
  104. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/session_tracker.py +129 -129
  105. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/setup_hooks.py +404 -404
  106. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/skill_evolver.py +161 -161
  107. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/steward.py +1627 -1627
  108. memorymaster-3.5.1/memorymaster/steward_classifier.py +149 -0
  109. memorymaster-3.5.1/memorymaster/steward_features.py +345 -0
  110. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/storage.py +101 -101
  111. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/vault_linter.py +301 -224
  112. memorymaster-3.5.1/memorymaster/verbatim_recall.py +296 -0
  113. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/webhook.py +58 -58
  114. memorymaster-3.5.1/memorymaster/wiki_freshness.py +228 -0
  115. memorymaster-3.5.1/memorymaster/wiki_similarity.py +621 -0
  116. memorymaster-3.5.1/memorymaster.egg-info/PKG-INFO +231 -0
  117. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster.egg-info/SOURCES.txt +113 -1
  118. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster.egg-info/requires.txt +11 -0
  119. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster.egg-info/top_level.txt +5 -0
  120. {memorymaster-3.4.1 → memorymaster-3.5.1}/pyproject.toml +72 -60
  121. memorymaster-3.5.1/scripts/agg_recall_latency.py +184 -0
  122. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/alert_operator_metrics.py +1 -1
  123. memorymaster-3.5.1/scripts/backfill_entity_extraction.py +327 -0
  124. memorymaster-3.5.1/scripts/backfill_graph_store.py +264 -0
  125. memorymaster-3.5.1/scripts/backfill_stop_hook_citations.py +137 -0
  126. memorymaster-3.5.1/scripts/backtest_steward_classifier.py +757 -0
  127. memorymaster-3.5.1/scripts/build_steward_training_set.py +119 -0
  128. memorymaster-3.5.1/scripts/check_hook_template_drift.py +143 -0
  129. memorymaster-3.5.1/scripts/eval_bm25_sweep.py +432 -0
  130. memorymaster-3.5.1/scripts/eval_classify_f1.py +226 -0
  131. memorymaster-3.5.1/scripts/eval_recall_precision_at_5.py +468 -0
  132. memorymaster-3.5.1/scripts/eval_recall_quality.py +132 -0
  133. memorymaster-3.5.1/scripts/eval_steward_pareto.py +273 -0
  134. memorymaster-3.5.1/scripts/eval_verbatim_recall.py +216 -0
  135. memorymaster-3.5.1/scripts/expand_recall_eval.py +404 -0
  136. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/gitnexus_to_claims.py +180 -180
  137. memorymaster-3.5.1/scripts/index_claims_to_qdrant.py +315 -0
  138. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/ingest_planning_docs.py +170 -170
  139. memorymaster-3.5.1/scripts/merge_scope_variants.py +216 -0
  140. memorymaster-3.5.1/scripts/run_longmemeval.py +997 -0
  141. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/scheduled_ingest.py +595 -595
  142. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/setup-hooks.py +10 -10
  143. memorymaster-3.5.1/scripts/sync_hook_templates.py +117 -0
  144. memorymaster-3.5.1/scripts/train_steward_classifier.py +457 -0
  145. {memorymaster-3.4.1 → memorymaster-3.5.1}/setup.cfg +4 -4
  146. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/conftest.py +37 -37
  147. memorymaster-3.5.1/tests/integration/test_extract_llm_ollama_live.py +49 -0
  148. memorymaster-3.5.1/tests/test_auto_ingest_hook_citations.py +147 -0
  149. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_auto_validate.py +197 -197
  150. memorymaster-3.5.1/tests/test_bm25_per_field.py +222 -0
  151. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_claim_links.py +288 -288
  152. memorymaster-3.5.1/tests/test_classify_hook_f1.py +85 -0
  153. memorymaster-3.5.1/tests/test_classify_hook_latency.py +91 -0
  154. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_cli_review_queue.py +1 -1
  155. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_compaction_trace.py +1 -1
  156. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_connectors.py +473 -473
  157. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_context_hook.py +260 -260
  158. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_deterministic_predicates.py +1 -1
  159. memorymaster-3.5.1/tests/test_entity_extractor.py +150 -0
  160. memorymaster-3.5.1/tests/test_entity_extractor_llm.py +296 -0
  161. memorymaster-3.5.1/tests/test_entity_new_kinds.py +241 -0
  162. memorymaster-3.5.1/tests/test_entity_registry.py +406 -0
  163. memorymaster-3.5.1/tests/test_eval_harness.py +291 -0
  164. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_events_schema.py +1 -1
  165. memorymaster-3.5.1/tests/test_extract_llm_ollama.py +140 -0
  166. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_fts5_search.py +169 -169
  167. memorymaster-3.5.1/tests/test_graph_distance.py +233 -0
  168. memorymaster-3.5.1/tests/test_graph_store.py +321 -0
  169. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_integration_workflows.py +534 -534
  170. memorymaster-3.5.1/tests/test_key_rotator.py +159 -0
  171. memorymaster-3.5.1/tests/test_llm_fallback.py +219 -0
  172. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_mcp_helpers.py +412 -319
  173. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_metrics_exporter.py +1 -1
  174. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_operator.py +379 -373
  175. memorymaster-3.5.1/tests/test_policy_mode_env.py +91 -0
  176. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_postgres_parity.py +625 -625
  177. memorymaster-3.5.1/tests/test_query_expansion.py +264 -0
  178. memorymaster-3.5.1/tests/test_recall_entity_fanout.py +459 -0
  179. memorymaster-3.5.1/tests/test_recall_fusion.py +94 -0
  180. memorymaster-3.5.1/tests/test_recall_latency.py +275 -0
  181. memorymaster-3.5.1/tests/test_recall_precision_at_5.py +261 -0
  182. memorymaster-3.5.1/tests/test_recall_tokenizer.py +234 -0
  183. memorymaster-3.5.1/tests/test_recall_vector_fallback.py +306 -0
  184. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_reliability_hardening.py +1 -1
  185. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_rl_trainer.py +232 -232
  186. memorymaster-3.5.1/tests/test_rrf_auto_gate.py +223 -0
  187. memorymaster-3.5.1/tests/test_scope_boost.py +298 -0
  188. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_security_patterns.py +249 -246
  189. memorymaster-3.5.1/tests/test_sensitivity_filter_adversarial.py +93 -0
  190. memorymaster-3.5.1/tests/test_sensitivity_filter_adversarial_v2.py +153 -0
  191. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_sqlite_core.py +255 -255
  192. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_steward.py +348 -348
  193. memorymaster-3.5.1/tests/test_steward_classifier.py +261 -0
  194. memorymaster-3.5.1/tests/test_steward_features.py +174 -0
  195. memorymaster-3.5.1/tests/test_steward_features_v3.py +254 -0
  196. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_steward_resolution_parity.py +219 -219
  197. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_vault_exporter.py +381 -381
  198. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_vector_search.py +367 -365
  199. memorymaster-3.5.1/tests/test_verbatim_recall.py +321 -0
  200. memorymaster-3.5.1/tests/test_wiki_freshness.py +281 -0
  201. memorymaster-3.5.1/tests/test_wiki_similarity_multiscope.py +270 -0
  202. memorymaster-3.4.1/PKG-INFO +0 -884
  203. memorymaster-3.4.1/README.md +0 -848
  204. memorymaster-3.4.1/memorymaster/config_templates/hooks/memorymaster-auto-ingest.py +0 -129
  205. memorymaster-3.4.1/memorymaster/config_templates/hooks/memorymaster-precompact.py +0 -35
  206. memorymaster-3.4.1/memorymaster/config_templates/hooks/memorymaster-steward-cycle.py +0 -28
  207. memorymaster-3.4.1/memorymaster/context_hook.py +0 -230
  208. memorymaster-3.4.1/memorymaster/entity_registry.py +0 -255
  209. memorymaster-3.4.1/memorymaster/llm_provider.py +0 -229
  210. memorymaster-3.4.1/memorymaster.egg-info/PKG-INFO +0 -884
  211. {memorymaster-3.4.1 → memorymaster-3.5.1}/LICENSE +0 -0
  212. {memorymaster-3.4.1 → memorymaster-3.5.1}/benchmarks/longmemeval_runner.py +0 -0
  213. {memorymaster-3.4.1 → memorymaster-3.5.1}/benchmarks/longmemeval_vector_runner.py +0 -0
  214. {memorymaster-3.4.1 → memorymaster-3.5.1}/benchmarks/perf_smoke.py +0 -0
  215. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/__main__.py +0 -0
  216. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/claim_verifier.py +0 -0
  217. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/config.py +0 -0
  218. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/config_templates/claude-md-append.md +0 -0
  219. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/config_templates/codex-agents-md-append.md +0 -0
  220. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/config_templates/hooks/memorymaster-validate-wiki.py +0 -0
  221. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/conflict_resolver.py +0 -0
  222. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/daily_notes.py +0 -0
  223. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/jobs/compact_summaries.py +0 -0
  224. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/jobs/compactor.py +0 -0
  225. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/jobs/dedup.py +0 -0
  226. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/jobs/extractor.py +0 -0
  227. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/jobs/staleness.py +0 -0
  228. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/lifecycle.py +0 -0
  229. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/operator_queue.py +0 -0
  230. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/plugins.py +0 -0
  231. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/qmd_bridge.py +0 -0
  232. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/query_classifier.py +0 -0
  233. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/retry.py +0 -0
  234. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/review.py +0 -0
  235. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/rl_trainer.py +0 -0
  236. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/schema.py +0 -0
  237. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/schema_postgres.sql +0 -0
  238. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/snapshot.py +0 -0
  239. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/store_factory.py +0 -0
  240. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/transcript_miner.py +0 -0
  241. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/turn_schema.py +0 -0
  242. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/vault_bases.py +0 -0
  243. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/vault_curator.py +0 -0
  244. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/vault_exporter.py +0 -0
  245. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/vault_log.py +0 -0
  246. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/vault_query_capture.py +0 -0
  247. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/vault_synthesis.py +0 -0
  248. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/verbatim_store.py +0 -0
  249. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster/wiki_engine.py +0 -0
  250. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster.egg-info/dependency_links.txt +0 -0
  251. {memorymaster-3.4.1 → memorymaster-3.5.1}/memorymaster.egg-info/entry_points.txt +0 -0
  252. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/autoresearch_daemon.py +0 -0
  253. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/claude_to_turns.py +0 -0
  254. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/codex_live_to_turns.py +0 -0
  255. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/compaction_edge_cases.py +0 -0
  256. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/compaction_trace_report.py +0 -0
  257. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/compaction_trace_validate.py +0 -0
  258. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/confusion_matrix_eval.py +0 -0
  259. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/conversation_importer.py +0 -0
  260. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/conversation_to_turns.py +0 -0
  261. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/e2e_operator.py +0 -0
  262. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/email_live_to_turns.py +0 -0
  263. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/eval_memorymaster.py +0 -0
  264. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/generate_drill_signoff.py +0 -0
  265. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/git_to_turns.py +0 -0
  266. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/github_live_to_turns.py +0 -0
  267. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/jira_live_to_turns.py +0 -0
  268. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/llm_benchmark.py +0 -0
  269. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/messages_to_turns.py +0 -0
  270. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/operator_metrics.py +0 -0
  271. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/recurring_incident_drill.py +0 -0
  272. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/release_readiness.py +0 -0
  273. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/run_codex_autologger.py +0 -0
  274. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/run_incident_drill.py +0 -0
  275. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/slack_live_to_turns.py +0 -0
  276. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/tickets_to_turns.py +0 -0
  277. {memorymaster-3.4.1 → memorymaster-3.5.1}/scripts/webhook_to_turns.py +0 -0
  278. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_access_control.py +0 -0
  279. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_auto_extractor.py +0 -0
  280. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_auto_ingest_hook_schema.py +0 -0
  281. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_auto_resolver.py +0 -0
  282. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_claude_to_turns.py +0 -0
  283. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_cli_json_flag.py +0 -0
  284. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_cli_ready.py +0 -0
  285. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_cli_subcommands.py +0 -0
  286. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_compact_summaries.py +0 -0
  287. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_config.py +0 -0
  288. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_conflict_resolver.py +0 -0
  289. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_confusion_matrix_eval.py +0 -0
  290. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_connection_retry.py +0 -0
  291. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_context_optimizer.py +0 -0
  292. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_conversation_to_turns.py +0 -0
  293. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_dashboard.py +0 -0
  294. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_dedup.py +0 -0
  295. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_embeddings_coverage.py +0 -0
  296. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_entity_graph.py +0 -0
  297. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_feedback.py +0 -0
  298. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_handler_regressions.py +0 -0
  299. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_human_id.py +0 -0
  300. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_incident_drill_runner.py +0 -0
  301. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_lifecycle.py +0 -0
  302. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_llm_steward_coverage.py +0 -0
  303. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_llm_steward_key_rotation.py +0 -0
  304. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_obsidian_mind_patterns.py +0 -0
  305. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_operator_queue.py +0 -0
  306. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_perf_smoke_config.py +0 -0
  307. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_plugins.py +0 -0
  308. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_policy_coverage.py +0 -0
  309. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_qdrant_backend.py +0 -0
  310. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_qmd_bridge.py +0 -0
  311. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_query_classifier.py +0 -0
  312. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_review.py +0 -0
  313. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_scheduler.py +0 -0
  314. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_schema.py +0 -0
  315. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_security_access.py +0 -0
  316. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_service_coverage.py +0 -0
  317. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_session_tracker.py +0 -0
  318. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_snapshot.py +0 -0
  319. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_staleness.py +0 -0
  320. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_stealth_mode.py +0 -0
  321. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_store_factory.py +0 -0
  322. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_tenant_isolation.py +0 -0
  323. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_turn_schema.py +0 -0
  324. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_webhook.py +0 -0
  325. {memorymaster-3.4.1 → memorymaster-3.5.1}/tests/test_wiki_binding.py +0 -0
@@ -0,0 +1,231 @@
1
+ Metadata-Version: 2.4
2
+ Name: memorymaster
3
+ Version: 3.5.1
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: vector
31
+ Requires-Dist: sentence-transformers>=3.0; extra == "vector"
32
+ Requires-Dist: qdrant-client>=1.9; extra == "vector"
33
+ Provides-Extra: graph
34
+ Requires-Dist: kuzu>=0.4; extra == "graph"
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest>=8.2; extra == "dev"
37
+ Requires-Dist: pytest-cov>=6.0; extra == "dev"
38
+ Provides-Extra: mcp
39
+ Requires-Dist: mcp>=1.2; extra == "mcp"
40
+ Provides-Extra: ml
41
+ Requires-Dist: scikit-learn>=1.3; extra == "ml"
42
+ Requires-Dist: joblib>=1.3; extra == "ml"
43
+ Dynamic: license-file
44
+
45
+ # MemoryMaster
46
+
47
+ **Production-grade memory reliability system for AI coding agents.**
48
+
49
+ Lifecycle-managed claims with citations, conflict detection, steward governance, hybrid retrieval, and MCP integration. Give your AI agents persistent, trustworthy memory.
50
+
51
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
52
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
53
+ [![Tests](https://img.shields.io/badge/tests-1029-green.svg)]()
54
+ [![MCP Tools](https://img.shields.io/badge/MCP%20tools-22-purple.svg)]()
55
+ [![CLI Commands](https://img.shields.io/badge/CLI%20commands-64-orange.svg)]()
56
+ [![PyPI](https://img.shields.io/pypi/v/memorymaster.svg)](https://pypi.org/project/memorymaster/)
57
+
58
+ MemoryMaster prevents the #1 problem with agent memory: **drift, stale assumptions, and unsafe disclosure**. It gives Claude Code, Codex, and any MCP-compatible agent persistent, verifiable memory with a full claim lifecycle, citation tracking, conflict detection, and human-in-the-loop governance.
59
+
60
+ ---
61
+
62
+ ## Architecture
63
+
64
+ ```
65
+ ┌─────────────────────────────────────────────────────────────────┐
66
+ │ Agent Runtime │
67
+ │ (Claude Code / Codex / any MCP-compatible agent) │
68
+ └────────────┬────────────────────────────────┬───────────────────┘
69
+ │ MCP (22 tools) │ CLI (64 commands)
70
+ v v
71
+ ┌─────────────────────────────────────────────────────────────────┐
72
+ │ MemoryMaster Core │
73
+ │ ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌───────────────┐ │
74
+ │ │ Ingestor │ │ Extractor │ │ Validator │ │ State Engine │ │
75
+ │ │ (events) │->│ (claims) │->│ (probes) │->│ (6-state FSM) │ │
76
+ │ └──────────┘ └───────────┘ └──────────┘ └───────────────┘ │
77
+ │ ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌───────────────┐ │
78
+ │ │ Retrieval│ │ Compactor │ │ Steward │ │ Dashboard │ │
79
+ │ │ (hybrid) │ │ (archive) │ │ (govern) │ │ (HTML+SSE) │ │
80
+ │ └──────────┘ └───────────┘ └──────────┘ └───────────────┘ │
81
+ └────────┬──────────────┬──────────────┬──────────┬───────────────┘
82
+ v v v v
83
+ SQLite/Postgres Qdrant Ollama/CLI Claude Code
84
+ (vectors) (LLM stack) Auto Dream + Vault
85
+ ```
86
+
87
+ ## Key features
88
+
89
+ - **6-state lifecycle**: `candidate` → `confirmed` → `stale` → `superseded` → `conflicted` → `archived`
90
+ - **Citation tracking** with provenance for every claim
91
+ - **Hybrid retrieval**: vector (sentence-transformers / Gemini) + FTS5 + freshness + confidence
92
+ - **Context optimizer**: `query_for_context(budget=4000)` returns auto-curated memory that fits your token budget
93
+ - **Entity graph** with typed relationships and alias resolution
94
+ - **Steward governance**: multi-probe validators (filesystem, format, citation, semantic, tool) with proposal review
95
+ - **Conflict resolution**: 5-tier auto (confidence > freshness > citations > LLM > manual)
96
+ - **Auto-redaction** at ingest: JWT, GitHub tokens, Bearer, AWS keys, SSH keys, custom patterns
97
+ - **LLM Wiki**: compiled-truth + append-only timeline articles with progressive-disclosure frontmatter
98
+ - **Dual backend**: SQLite (zero-config) and Postgres (full feature parity with pgvector)
99
+ - **Dream Bridge** for bidirectional sync with Claude Code's Auto Dream
100
+ - **7-hook stack**: recall, classify, validate-wiki, session-start, auto-ingest, precompact, steward-cron
101
+
102
+ Full feature index lives in [`docs/handbook.md`](docs/handbook.md).
103
+
104
+ ## Prerequisites
105
+
106
+ **Required**
107
+
108
+ - Python **3.10+** with `pip`
109
+ - Claude Code, Codex, or any MCP-compatible agent
110
+
111
+ **Optional**
112
+
113
+ - **Already a Claude Code subscriber?** No API key needed — set `MEMORYMASTER_LLM_PROVIDER=claude_cli` and the steward + auto-ingest hooks will use your existing OAuth via the local `claude --print` binary
114
+ - A free Gemini API key from [aistudio.google.com](https://aistudio.google.com) — powers the auto-ingest hook at ~zero cost
115
+ - **Node.js 18+** for graphify and GitNexus
116
+ - **Obsidian 1.6+** with the Bases core plugin (for visual wiki browsing)
117
+ - **Docker** for Qdrant (SQLite FTS5 is the default and works out of the box)
118
+
119
+ ## Quick start
120
+
121
+ ```bash
122
+ pip install "memorymaster[mcp]"
123
+ memorymaster --db memorymaster.db init-db
124
+ memorymaster-setup # interactive: hooks, MCP, steward cron, CLAUDE.md / AGENTS.md
125
+ ```
126
+
127
+ That's enough to use the CLI, the MCP server, and the auto-ingest Stop hook.
128
+
129
+ ```bash
130
+ # Ingest a claim with citation
131
+ memorymaster --db memorymaster.db ingest \
132
+ --text "Server uses PostgreSQL 16" \
133
+ --source "session://chat|turn-3|user confirmed"
134
+
135
+ # Query memory (hybrid retrieval)
136
+ memorymaster --db memorymaster.db query "database version" --retrieval-mode hybrid
137
+
138
+ # Context optimizer — the killer feature for agents
139
+ memorymaster --db memorymaster.db context "auth patterns" --budget 4000 --format xml
140
+
141
+ # Run validation cycle
142
+ memorymaster --db memorymaster.db run-cycle
143
+ ```
144
+
145
+ For the one-prompt agent install (paste into any agent with shell access), see [`docs/handbook.md#one-prompt-agent-install`](docs/handbook.md#one-prompt-agent-install).
146
+
147
+ ## Pick your LLM provider
148
+
149
+ | Provider | Env vars | Default model | Cost |
150
+ |----------|----------|---------------|------|
151
+ | **Claude Code OAuth** (recommended for subscribers) | `MEMORYMASTER_LLM_PROVIDER=claude_cli` (requires `claude` CLI on PATH) | `claude-haiku-4-5-20251001` | included in Claude Code plan |
152
+ | Google Gemini (default) | `MEMORYMASTER_LLM_PROVIDER=google` + `GEMINI_API_KEY=...` | `gemini-3.1-flash-lite-preview` | ~free |
153
+ | OpenAI | `MEMORYMASTER_LLM_PROVIDER=openai` + `OPENAI_API_KEY=...` | `gpt-4o-mini` | ~$0.001/call |
154
+ | Anthropic API | `MEMORYMASTER_LLM_PROVIDER=anthropic` + `ANTHROPIC_API_KEY=...` | `claude-haiku-4-5-20251001` | ~$0.001/call |
155
+ | Ollama (local) | `MEMORYMASTER_LLM_PROVIDER=ollama` + `OLLAMA_URL=http://localhost:11434` | `llama3.2:3b` | free |
156
+
157
+ The `claude_cli` provider shells out to your local `claude --print` binary, so it inherits the OAuth session you're already logged into in Claude Code — no API key, no rotator, no quota juggling. **Caveat**: cold-start adds 3-15s per call (subprocess spawn), so it's ideal for batched/cron paths (steward, wiki-absorb) and not for latency-sensitive recall. Override with `MEMORYMASTER_CLAUDE_CLI_BIN` and `MEMORYMASTER_CLAUDE_CLI_TIMEOUT`. On VM installs the OAuth token expires ~24h, so pair with `MEMORYMASTER_LLM_FALLBACK_PROVIDER=ollama`; desktop tokens don't expire.
158
+
159
+ For zero-cost offline use, install [Ollama](https://ollama.com), `ollama pull llama3.2:3b`, and set `MEMORYMASTER_LLM_PROVIDER=ollama`.
160
+
161
+ ## MCP server
162
+
163
+ ```json
164
+ {
165
+ "mcpServers": {
166
+ "memorymaster": {
167
+ "command": "memorymaster-mcp",
168
+ "env": {
169
+ "MEMORYMASTER_DEFAULT_DB": "/path/to/memorymaster.db",
170
+ "MEMORYMASTER_WORKSPACE": "/path/to/your/project"
171
+ }
172
+ }
173
+ }
174
+ }
175
+ ```
176
+
177
+ 22 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`, `search_verbatim`, `open_dashboard`, `list_steward_proposals`, `resolve_steward_proposal`, `extract_entities`, `entity_stats`, `find_related_claims`, `quality_scores`, `recompute_tiers`, `federated_query`.
178
+
179
+ See [`.mcp.json.example`](.mcp.json.example) for the full template.
180
+
181
+ ## Backends
182
+
183
+ | Backend | Install | Use case |
184
+ |---------|---------|----------|
185
+ | **SQLite** | Built-in | Local development, single-agent, zero-config |
186
+ | **Postgres** | `pip install "memorymaster[postgres]"` | Team deployment, multi-agent, pgvector search |
187
+
188
+ ## Docker Compose
189
+
190
+ Run the full stack (MemoryMaster + Qdrant + Ollama) with one command:
191
+
192
+ ```bash
193
+ docker compose up -d
194
+ ```
195
+
196
+ See [INSTALLATION.md](INSTALLATION.md) for Kubernetes / Helm.
197
+
198
+ ## Development
199
+
200
+ ```bash
201
+ # Install with dev dependencies
202
+ pip install -e ".[dev,mcp,security,embeddings,qdrant]"
203
+
204
+ # Run tests
205
+ pytest tests/ -q
206
+
207
+ # Lint and format
208
+ ruff check memorymaster/ && ruff format memorymaster/
209
+
210
+ # Performance benchmarks
211
+ python benchmarks/perf_smoke.py
212
+ ```
213
+
214
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the full workflow.
215
+
216
+ ## Documentation
217
+
218
+ | Document | Description |
219
+ |----------|-------------|
220
+ | [docs/handbook.md](docs/handbook.md) | Full operator handbook — hooks, dashboard, steward, dream bridge, troubleshooting, one-prompt install |
221
+ | [INSTALLATION.md](INSTALLATION.md) | Setup guide: pip, Docker, Helm, MCP config |
222
+ | [CONTRIBUTING.md](CONTRIBUTING.md) | Dev setup, testing, PR workflow |
223
+ | [ARCHITECTURE.md](ARCHITECTURE.md) | System design and subsystem details |
224
+ | [USER_GUIDE.md](USER_GUIDE.md) | Usage, MCP integration, troubleshooting |
225
+ | [CHANGELOG.md](CHANGELOG.md) | Version history and release notes |
226
+ | [ROADMAP.md](ROADMAP.md) | Release plan and future tracks |
227
+ | [docs/enabling-v2-systems.md](docs/enabling-v2-systems.md) | v3 statistical classifier + cadence policy opt-in |
228
+
229
+ ## License
230
+
231
+ [MIT](LICENSE) — Built by [wolverin0](https://github.com/wolverin0)
@@ -0,0 +1,187 @@
1
+ # MemoryMaster
2
+
3
+ **Production-grade memory reliability system for AI coding agents.**
4
+
5
+ Lifecycle-managed claims with citations, conflict detection, steward governance, hybrid retrieval, and MCP integration. Give your AI agents persistent, trustworthy memory.
6
+
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
9
+ [![Tests](https://img.shields.io/badge/tests-1029-green.svg)]()
10
+ [![MCP Tools](https://img.shields.io/badge/MCP%20tools-22-purple.svg)]()
11
+ [![CLI Commands](https://img.shields.io/badge/CLI%20commands-64-orange.svg)]()
12
+ [![PyPI](https://img.shields.io/pypi/v/memorymaster.svg)](https://pypi.org/project/memorymaster/)
13
+
14
+ MemoryMaster prevents the #1 problem with agent memory: **drift, stale assumptions, and unsafe disclosure**. It gives Claude Code, Codex, and any MCP-compatible agent persistent, verifiable memory with a full claim lifecycle, citation tracking, conflict detection, and human-in-the-loop governance.
15
+
16
+ ---
17
+
18
+ ## Architecture
19
+
20
+ ```
21
+ ┌─────────────────────────────────────────────────────────────────┐
22
+ │ Agent Runtime │
23
+ │ (Claude Code / Codex / any MCP-compatible agent) │
24
+ └────────────┬────────────────────────────────┬───────────────────┘
25
+ │ MCP (22 tools) │ CLI (64 commands)
26
+ v v
27
+ ┌─────────────────────────────────────────────────────────────────┐
28
+ │ MemoryMaster Core │
29
+ │ ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌───────────────┐ │
30
+ │ │ Ingestor │ │ Extractor │ │ Validator │ │ State Engine │ │
31
+ │ │ (events) │->│ (claims) │->│ (probes) │->│ (6-state FSM) │ │
32
+ │ └──────────┘ └───────────┘ └──────────┘ └───────────────┘ │
33
+ │ ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌───────────────┐ │
34
+ │ │ Retrieval│ │ Compactor │ │ Steward │ │ Dashboard │ │
35
+ │ │ (hybrid) │ │ (archive) │ │ (govern) │ │ (HTML+SSE) │ │
36
+ │ └──────────┘ └───────────┘ └──────────┘ └───────────────┘ │
37
+ └────────┬──────────────┬──────────────┬──────────┬───────────────┘
38
+ v v v v
39
+ SQLite/Postgres Qdrant Ollama/CLI Claude Code
40
+ (vectors) (LLM stack) Auto Dream + Vault
41
+ ```
42
+
43
+ ## Key features
44
+
45
+ - **6-state lifecycle**: `candidate` → `confirmed` → `stale` → `superseded` → `conflicted` → `archived`
46
+ - **Citation tracking** with provenance for every claim
47
+ - **Hybrid retrieval**: vector (sentence-transformers / Gemini) + FTS5 + freshness + confidence
48
+ - **Context optimizer**: `query_for_context(budget=4000)` returns auto-curated memory that fits your token budget
49
+ - **Entity graph** with typed relationships and alias resolution
50
+ - **Steward governance**: multi-probe validators (filesystem, format, citation, semantic, tool) with proposal review
51
+ - **Conflict resolution**: 5-tier auto (confidence > freshness > citations > LLM > manual)
52
+ - **Auto-redaction** at ingest: JWT, GitHub tokens, Bearer, AWS keys, SSH keys, custom patterns
53
+ - **LLM Wiki**: compiled-truth + append-only timeline articles with progressive-disclosure frontmatter
54
+ - **Dual backend**: SQLite (zero-config) and Postgres (full feature parity with pgvector)
55
+ - **Dream Bridge** for bidirectional sync with Claude Code's Auto Dream
56
+ - **7-hook stack**: recall, classify, validate-wiki, session-start, auto-ingest, precompact, steward-cron
57
+
58
+ Full feature index lives in [`docs/handbook.md`](docs/handbook.md).
59
+
60
+ ## Prerequisites
61
+
62
+ **Required**
63
+
64
+ - Python **3.10+** with `pip`
65
+ - Claude Code, Codex, or any MCP-compatible agent
66
+
67
+ **Optional**
68
+
69
+ - **Already a Claude Code subscriber?** No API key needed — set `MEMORYMASTER_LLM_PROVIDER=claude_cli` and the steward + auto-ingest hooks will use your existing OAuth via the local `claude --print` binary
70
+ - A free Gemini API key from [aistudio.google.com](https://aistudio.google.com) — powers the auto-ingest hook at ~zero cost
71
+ - **Node.js 18+** for graphify and GitNexus
72
+ - **Obsidian 1.6+** with the Bases core plugin (for visual wiki browsing)
73
+ - **Docker** for Qdrant (SQLite FTS5 is the default and works out of the box)
74
+
75
+ ## Quick start
76
+
77
+ ```bash
78
+ pip install "memorymaster[mcp]"
79
+ memorymaster --db memorymaster.db init-db
80
+ memorymaster-setup # interactive: hooks, MCP, steward cron, CLAUDE.md / AGENTS.md
81
+ ```
82
+
83
+ That's enough to use the CLI, the MCP server, and the auto-ingest Stop hook.
84
+
85
+ ```bash
86
+ # Ingest a claim with citation
87
+ memorymaster --db memorymaster.db ingest \
88
+ --text "Server uses PostgreSQL 16" \
89
+ --source "session://chat|turn-3|user confirmed"
90
+
91
+ # Query memory (hybrid retrieval)
92
+ memorymaster --db memorymaster.db query "database version" --retrieval-mode hybrid
93
+
94
+ # Context optimizer — the killer feature for agents
95
+ memorymaster --db memorymaster.db context "auth patterns" --budget 4000 --format xml
96
+
97
+ # Run validation cycle
98
+ memorymaster --db memorymaster.db run-cycle
99
+ ```
100
+
101
+ For the one-prompt agent install (paste into any agent with shell access), see [`docs/handbook.md#one-prompt-agent-install`](docs/handbook.md#one-prompt-agent-install).
102
+
103
+ ## Pick your LLM provider
104
+
105
+ | Provider | Env vars | Default model | Cost |
106
+ |----------|----------|---------------|------|
107
+ | **Claude Code OAuth** (recommended for subscribers) | `MEMORYMASTER_LLM_PROVIDER=claude_cli` (requires `claude` CLI on PATH) | `claude-haiku-4-5-20251001` | included in Claude Code plan |
108
+ | Google Gemini (default) | `MEMORYMASTER_LLM_PROVIDER=google` + `GEMINI_API_KEY=...` | `gemini-3.1-flash-lite-preview` | ~free |
109
+ | OpenAI | `MEMORYMASTER_LLM_PROVIDER=openai` + `OPENAI_API_KEY=...` | `gpt-4o-mini` | ~$0.001/call |
110
+ | Anthropic API | `MEMORYMASTER_LLM_PROVIDER=anthropic` + `ANTHROPIC_API_KEY=...` | `claude-haiku-4-5-20251001` | ~$0.001/call |
111
+ | Ollama (local) | `MEMORYMASTER_LLM_PROVIDER=ollama` + `OLLAMA_URL=http://localhost:11434` | `llama3.2:3b` | free |
112
+
113
+ The `claude_cli` provider shells out to your local `claude --print` binary, so it inherits the OAuth session you're already logged into in Claude Code — no API key, no rotator, no quota juggling. **Caveat**: cold-start adds 3-15s per call (subprocess spawn), so it's ideal for batched/cron paths (steward, wiki-absorb) and not for latency-sensitive recall. Override with `MEMORYMASTER_CLAUDE_CLI_BIN` and `MEMORYMASTER_CLAUDE_CLI_TIMEOUT`. On VM installs the OAuth token expires ~24h, so pair with `MEMORYMASTER_LLM_FALLBACK_PROVIDER=ollama`; desktop tokens don't expire.
114
+
115
+ For zero-cost offline use, install [Ollama](https://ollama.com), `ollama pull llama3.2:3b`, and set `MEMORYMASTER_LLM_PROVIDER=ollama`.
116
+
117
+ ## MCP server
118
+
119
+ ```json
120
+ {
121
+ "mcpServers": {
122
+ "memorymaster": {
123
+ "command": "memorymaster-mcp",
124
+ "env": {
125
+ "MEMORYMASTER_DEFAULT_DB": "/path/to/memorymaster.db",
126
+ "MEMORYMASTER_WORKSPACE": "/path/to/your/project"
127
+ }
128
+ }
129
+ }
130
+ }
131
+ ```
132
+
133
+ 22 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`, `search_verbatim`, `open_dashboard`, `list_steward_proposals`, `resolve_steward_proposal`, `extract_entities`, `entity_stats`, `find_related_claims`, `quality_scores`, `recompute_tiers`, `federated_query`.
134
+
135
+ See [`.mcp.json.example`](.mcp.json.example) for the full template.
136
+
137
+ ## Backends
138
+
139
+ | Backend | Install | Use case |
140
+ |---------|---------|----------|
141
+ | **SQLite** | Built-in | Local development, single-agent, zero-config |
142
+ | **Postgres** | `pip install "memorymaster[postgres]"` | Team deployment, multi-agent, pgvector search |
143
+
144
+ ## Docker Compose
145
+
146
+ Run the full stack (MemoryMaster + Qdrant + Ollama) with one command:
147
+
148
+ ```bash
149
+ docker compose up -d
150
+ ```
151
+
152
+ See [INSTALLATION.md](INSTALLATION.md) for Kubernetes / Helm.
153
+
154
+ ## Development
155
+
156
+ ```bash
157
+ # Install with dev dependencies
158
+ pip install -e ".[dev,mcp,security,embeddings,qdrant]"
159
+
160
+ # Run tests
161
+ pytest tests/ -q
162
+
163
+ # Lint and format
164
+ ruff check memorymaster/ && ruff format memorymaster/
165
+
166
+ # Performance benchmarks
167
+ python benchmarks/perf_smoke.py
168
+ ```
169
+
170
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the full workflow.
171
+
172
+ ## Documentation
173
+
174
+ | Document | Description |
175
+ |----------|-------------|
176
+ | [docs/handbook.md](docs/handbook.md) | Full operator handbook — hooks, dashboard, steward, dream bridge, troubleshooting, one-prompt install |
177
+ | [INSTALLATION.md](INSTALLATION.md) | Setup guide: pip, Docker, Helm, MCP config |
178
+ | [CONTRIBUTING.md](CONTRIBUTING.md) | Dev setup, testing, PR workflow |
179
+ | [ARCHITECTURE.md](ARCHITECTURE.md) | System design and subsystem details |
180
+ | [USER_GUIDE.md](USER_GUIDE.md) | Usage, MCP integration, troubleshooting |
181
+ | [CHANGELOG.md](CHANGELOG.md) | Version history and release notes |
182
+ | [ROADMAP.md](ROADMAP.md) | Release plan and future tracks |
183
+ | [docs/enabling-v2-systems.md](docs/enabling-v2-systems.md) | v3 statistical classifier + cadence policy opt-in |
184
+
185
+ ## License
186
+
187
+ [MIT](LICENSE) — Built by [wolverin0](https://github.com/wolverin0)