recallnest 1.4.1

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 (261) hide show
  1. package/.claude-plugin/CLAUDE.md +29 -0
  2. package/.claude-plugin/marketplace.json +18 -0
  3. package/.env.example +3 -0
  4. package/.github/workflows/ci.yml +28 -0
  5. package/.mcp.json +9 -0
  6. package/CHANGELOG.md +51 -0
  7. package/CLAUDE.md +42 -0
  8. package/DEMO.md +94 -0
  9. package/EVAL.md +89 -0
  10. package/FAILURES.md +75 -0
  11. package/LICENSE +21 -0
  12. package/OPERATIONS.md +59 -0
  13. package/README.md +427 -0
  14. package/README_CN.md +425 -0
  15. package/ROADMAP.md +198 -0
  16. package/assets/recallnest-workbench.png +0 -0
  17. package/assets/ui/app.js +807 -0
  18. package/assets/ui/index.html +154 -0
  19. package/assets/ui/styles.css +605 -0
  20. package/assets/wechat-qr.jpg +0 -0
  21. package/config.json.example +38 -0
  22. package/daily-recall.sh +87 -0
  23. package/daily-reflections/2026-03-05.md +15 -0
  24. package/daily-reflections/2026-03-06.md +15 -0
  25. package/daily-reflections/2026-03-07.md +7 -0
  26. package/daily-reflections/2026-03-08.md +34 -0
  27. package/daily-reflections/2026-03-09.md +35 -0
  28. package/daily-reflections/2026-03-10.md +36 -0
  29. package/daily-reflections/2026-03-11.md +35 -0
  30. package/daily-reflections/2026-03-12.md +36 -0
  31. package/daily-reflections/2026-03-13.md +35 -0
  32. package/daily-reflections/2026-03-14.md +35 -0
  33. package/daily-reflections/2026-03-15.md +35 -0
  34. package/daily-reflections/2026-03-16.md +41 -0
  35. package/daily-reflections/2026-03-17.md +10 -0
  36. package/daily-reflections/2026-03-18.md +10 -0
  37. package/daily-reflections/2026-03-19.md +10 -0
  38. package/daily-reflections/2026-03-20.md +10 -0
  39. package/daily-reflections/2026-03-21.md +10 -0
  40. package/daily-reflections/2026-03-22.md +10 -0
  41. package/daily-reflections/2026-03-23.md +10 -0
  42. package/daily-reflections/2026-03-24.md +10 -0
  43. package/daily-reflections/2026-03-25.md +32 -0
  44. package/daily-reflections/2026-03-26.md +37 -0
  45. package/daily-reflections/2026-03-27.md +35 -0
  46. package/daily-reflections/2026-03-28.md +35 -0
  47. package/daily-reflections/2026-03-29.md +35 -0
  48. package/daily-reflections/2026-03-30.md +36 -0
  49. package/daily-reflections/2026-03-31.md +35 -0
  50. package/daily-reflections/2026-04-01.md +35 -0
  51. package/docs/api-reference.md +1291 -0
  52. package/docs/architecture.md +168 -0
  53. package/docs/memory-boundary-contract.md +226 -0
  54. package/docs/memory-categories.md +119 -0
  55. package/docs/pipeline-audit-ultramemory.md +177 -0
  56. package/docs/plans/2026-03-08-query-expansion.md +270 -0
  57. package/docs/plans/2026-03-16-continuity-layer.md +196 -0
  58. package/docs/plans/mcp-tiering-plan.md +126 -0
  59. package/docs/research/recall-quality-audit-2026-03-22.md +153 -0
  60. package/docs/self-evolution.md +198 -0
  61. package/docs/superpowers/plans/2026-03-19-ingest-pipeline-upgrade.md +782 -0
  62. package/docs/superpowers/specs/2026-03-19-ingest-pipeline-upgrade-design.md +77 -0
  63. package/docs/superpowers/specs/2026-03-23-pull-claude-desktop-design.md +95 -0
  64. package/eval/cases.json +85 -0
  65. package/eval/continuity/case-seeds.json +90 -0
  66. package/eval/continuity/cases.json +302 -0
  67. package/eval/continuity/memory-seeds.json +26 -0
  68. package/eval/continuity/pattern-seeds.json +100 -0
  69. package/eval/continuity/results-2026-03-16.md +117 -0
  70. package/eval/continuity/results-2026-03-19.md +453 -0
  71. package/eval/continuity/runbook.md +110 -0
  72. package/eval/continuity/seed-cases.md +54 -0
  73. package/eval/reports/2026-03-06-abstract-query-baseline.md +96 -0
  74. package/eval/reports/2026-03-06-aws-ssh-baseline.md +82 -0
  75. package/eval/reports/2026-03-06-baseline.md +82 -0
  76. package/eval/reports/query-expansion.md +138 -0
  77. package/integrations/README.md +57 -0
  78. package/integrations/claude-code/README.md +133 -0
  79. package/integrations/claude-code/claude-md-snippet.md +31 -0
  80. package/integrations/claude-code/setup.sh +66 -0
  81. package/integrations/claude-code/smoke-continuity.sh +452 -0
  82. package/integrations/codex/README.md +49 -0
  83. package/integrations/codex/agents-md-snippet.md +31 -0
  84. package/integrations/codex/setup.sh +58 -0
  85. package/integrations/examples/claude-agent-sdk/memory-agent.ts +182 -0
  86. package/integrations/examples/langchain/memory-chain.py +111 -0
  87. package/integrations/examples/openai-agents-sdk/memory-agent.py +109 -0
  88. package/integrations/gemini-cli/README.md +57 -0
  89. package/integrations/gemini-cli/gemini-md-snippet.md +31 -0
  90. package/integrations/gemini-cli/setup.sh +64 -0
  91. package/integrations/shared/install-managed-block.sh +51 -0
  92. package/lm +19 -0
  93. package/package.json +50 -0
  94. package/plan-v1.2-distributable.md +105 -0
  95. package/scripts/archive-distilled-junk.ts +116 -0
  96. package/scripts/backfill-l0l1l2.ts +98 -0
  97. package/scripts/blind-scan.ts +588 -0
  98. package/scripts/cleanup-step1-exact-dups.ts +117 -0
  99. package/scripts/cleanup-step2-template-dups.ts +113 -0
  100. package/scripts/cleanup-step3-stale-content.ts +149 -0
  101. package/scripts/cleanup-step4-orphan-scopes.ts +131 -0
  102. package/scripts/delete-distilled-junk.ts +88 -0
  103. package/scripts/distill-facts.ts +305 -0
  104. package/scripts/health-check.ts +343 -0
  105. package/scripts/incremental-ingest.sh +71 -0
  106. package/scripts/mlp-health-check.ts +382 -0
  107. package/scripts/pull-claude-desktop.ts +515 -0
  108. package/scripts/re-ingest-cc.sh +66 -0
  109. package/scripts/rebalance-memory-health.ts +181 -0
  110. package/scripts/run-desktop-ingest.sh +11 -0
  111. package/scripts/start-server.sh +12 -0
  112. package/scripts/viz-dashboard.html +423 -0
  113. package/scripts/viz-export.ts +703 -0
  114. package/src/__tests__/access-tracker-novelty.test.ts +228 -0
  115. package/src/__tests__/auto-consolidation.test.ts +168 -0
  116. package/src/__tests__/auto-recall.test.ts +131 -0
  117. package/src/__tests__/batch-dedup.test.ts +65 -0
  118. package/src/__tests__/capture-engine.test.ts +1142 -0
  119. package/src/__tests__/capture-heuristic.test.ts +171 -0
  120. package/src/__tests__/cascade-forget.test.ts +210 -0
  121. package/src/__tests__/category-min-scores.test.ts +33 -0
  122. package/src/__tests__/confidence-tracker.test.ts +196 -0
  123. package/src/__tests__/conflict-advisor.test.ts +206 -0
  124. package/src/__tests__/conflict-escalation.test.ts +149 -0
  125. package/src/__tests__/conflict-lifecycle.test.ts +83 -0
  126. package/src/__tests__/conflict-output.test.ts +85 -0
  127. package/src/__tests__/conflict-store.test.ts +374 -0
  128. package/src/__tests__/consolidation-engine.test.ts +181 -0
  129. package/src/__tests__/context-composer-pins.test.ts +64 -0
  130. package/src/__tests__/context-composer-task-selection.test.ts +24 -0
  131. package/src/__tests__/context-renderer.test.ts +91 -0
  132. package/src/__tests__/continuity-eval.test.ts +275 -0
  133. package/src/__tests__/continuity-schema.test.ts +97 -0
  134. package/src/__tests__/core-recall-eval.test.ts +235 -0
  135. package/src/__tests__/core-summary.test.ts +109 -0
  136. package/src/__tests__/dedup-actions.test.ts +58 -0
  137. package/src/__tests__/deterministic-id.test.ts +39 -0
  138. package/src/__tests__/doctor.test.ts +303 -0
  139. package/src/__tests__/drill-down.test.ts +108 -0
  140. package/src/__tests__/embedder.test.ts +122 -0
  141. package/src/__tests__/entity-resolver.test.ts +58 -0
  142. package/src/__tests__/event-segmenter.test.ts +153 -0
  143. package/src/__tests__/hotness-blend.test.ts +76 -0
  144. package/src/__tests__/ingest.test.ts +360 -0
  145. package/src/__tests__/kg-extractor.test.ts +184 -0
  146. package/src/__tests__/kg-store.test.ts +198 -0
  147. package/src/__tests__/llm-consolidation.test.ts +226 -0
  148. package/src/__tests__/memory-boundaries.test.ts +237 -0
  149. package/src/__tests__/memory-health-rebalance.test.ts +144 -0
  150. package/src/__tests__/memory-output.test.ts +215 -0
  151. package/src/__tests__/multi-vector.test.ts +242 -0
  152. package/src/__tests__/ppr-traversal.test.ts +256 -0
  153. package/src/__tests__/preference-guard-smoke.test.ts +211 -0
  154. package/src/__tests__/preference-matcher.test.ts +230 -0
  155. package/src/__tests__/preference-slots.test.ts +106 -0
  156. package/src/__tests__/prospective-memory.test.ts +283 -0
  157. package/src/__tests__/query-entity-detector.test.ts +171 -0
  158. package/src/__tests__/query-expander.test.ts +34 -0
  159. package/src/__tests__/recall-mode.test.ts +64 -0
  160. package/src/__tests__/result-synthesizer.test.ts +198 -0
  161. package/src/__tests__/resume-context.test.ts +4743 -0
  162. package/src/__tests__/retrieval-trace.test.ts +213 -0
  163. package/src/__tests__/retriever-boundary-weight.test.ts +136 -0
  164. package/src/__tests__/retroactive-boost.test.ts +223 -0
  165. package/src/__tests__/scope-inventory.test.ts +200 -0
  166. package/src/__tests__/scope-policy.test.ts +69 -0
  167. package/src/__tests__/session-checkpoint.test.ts +259 -0
  168. package/src/__tests__/session-gc.test.ts +215 -0
  169. package/src/__tests__/store-scope-audit.test.ts +81 -0
  170. package/src/__tests__/temporal-parser.test.ts +241 -0
  171. package/src/__tests__/term-registry.test.ts +121 -0
  172. package/src/__tests__/tool-output-compressor.test.ts +133 -0
  173. package/src/__tests__/version-manager.test.ts +213 -0
  174. package/src/__tests__/workflow-observation.test.ts +400 -0
  175. package/src/access-tracker.ts +316 -0
  176. package/src/adaptive-retrieval.ts +64 -0
  177. package/src/api-server.ts +667 -0
  178. package/src/asset-sync.ts +79 -0
  179. package/src/auto-consolidation.ts +133 -0
  180. package/src/auto-gc.ts +124 -0
  181. package/src/auto-recall.ts +95 -0
  182. package/src/capture-engine.ts +931 -0
  183. package/src/capture-heuristic.ts +177 -0
  184. package/src/cascade-forget.ts +135 -0
  185. package/src/chunker.ts +253 -0
  186. package/src/cli.ts +1917 -0
  187. package/src/confidence-tracker.ts +166 -0
  188. package/src/conflict-advisor.ts +433 -0
  189. package/src/conflict-engine.ts +181 -0
  190. package/src/conflict-escalation.ts +138 -0
  191. package/src/conflict-lifecycle.ts +67 -0
  192. package/src/conflict-output.ts +218 -0
  193. package/src/conflict-schema.ts +130 -0
  194. package/src/conflict-store.ts +127 -0
  195. package/src/consolidation-engine.ts +256 -0
  196. package/src/context-composer-pins.ts +183 -0
  197. package/src/context-composer-queries.ts +121 -0
  198. package/src/context-composer-scope.ts +56 -0
  199. package/src/context-composer-stable-selection.ts +200 -0
  200. package/src/context-composer-stable.ts +217 -0
  201. package/src/context-composer-task-fallbacks.ts +36 -0
  202. package/src/context-composer-task-ranking.ts +197 -0
  203. package/src/context-composer-task-results.ts +137 -0
  204. package/src/context-composer-task-selection.ts +342 -0
  205. package/src/context-composer-text.ts +57 -0
  206. package/src/context-composer.ts +300 -0
  207. package/src/context-renderer.ts +179 -0
  208. package/src/decay-engine.ts +189 -0
  209. package/src/doctor.ts +543 -0
  210. package/src/embedder.ts +557 -0
  211. package/src/entity-resolver.ts +131 -0
  212. package/src/eval.ts +632 -0
  213. package/src/event-segmenter.ts +216 -0
  214. package/src/ingest.ts +1822 -0
  215. package/src/kg-extractor.ts +217 -0
  216. package/src/kg-store.ts +353 -0
  217. package/src/legacy-scope-review.ts +53 -0
  218. package/src/llm-client.ts +629 -0
  219. package/src/llm-consolidation.ts +168 -0
  220. package/src/mcp-server.ts +1337 -0
  221. package/src/memory-assets.ts +475 -0
  222. package/src/memory-boundaries.ts +354 -0
  223. package/src/memory-health-rebalance.ts +220 -0
  224. package/src/memory-output.ts +474 -0
  225. package/src/memory-schema.ts +184 -0
  226. package/src/multi-vector.ts +234 -0
  227. package/src/noise-filter.ts +155 -0
  228. package/src/ppr-traversal.ts +279 -0
  229. package/src/preference-matcher.ts +174 -0
  230. package/src/preference-slots.ts +259 -0
  231. package/src/prospective-memory.ts +198 -0
  232. package/src/query-entity-detector.ts +207 -0
  233. package/src/query-expander.ts +98 -0
  234. package/src/result-synthesizer.ts +114 -0
  235. package/src/retrieval-profiles.ts +101 -0
  236. package/src/retrieval-trace.ts +94 -0
  237. package/src/retriever.ts +1338 -0
  238. package/src/retroactive-boost.ts +154 -0
  239. package/src/rif.ts +73 -0
  240. package/src/runtime-config.ts +172 -0
  241. package/src/schema-utils.ts +56 -0
  242. package/src/scope-inventory.ts +310 -0
  243. package/src/scope-policy.ts +142 -0
  244. package/src/session-engine.ts +168 -0
  245. package/src/session-output.ts +96 -0
  246. package/src/session-schema.ts +60 -0
  247. package/src/session-store.ts +293 -0
  248. package/src/stderr-log.ts +16 -0
  249. package/src/store.ts +903 -0
  250. package/src/temporal-parser.ts +318 -0
  251. package/src/term-registry.ts +791 -0
  252. package/src/tool-output-compressor.ts +115 -0
  253. package/src/tracker.ts +57 -0
  254. package/src/ui-server.ts +430 -0
  255. package/src/version-manager.ts +172 -0
  256. package/src/workflow-observation-engine.ts +316 -0
  257. package/src/workflow-observation-managed.ts +83 -0
  258. package/src/workflow-observation-output.ts +86 -0
  259. package/src/workflow-observation-schema.ts +87 -0
  260. package/src/workflow-observation-scope-review.ts +409 -0
  261. package/src/workflow-observation-store.ts +69 -0
package/README.md ADDED
@@ -0,0 +1,427 @@
1
+ <div align="center">
2
+
3
+ # RecallNest
4
+
5
+ **Shared Memory Layer for Claude Code, Codex, and Gemini CLI**
6
+
7
+ *One memory. Three terminals. Context that survives across windows.*
8
+
9
+ A local-first memory system backed by LanceDB that turns scattered conversation history into reusable knowledge — shared across your coding agents, recalled automatically.
10
+
11
+ [![GitHub](https://img.shields.io/github/stars/AliceLJY/recallnest?style=social)](https://github.com/AliceLJY/recallnest)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
13
+ [![Bun](https://img.shields.io/badge/Runtime-Bun-f9f1e1?logo=bun)](https://bun.sh)
14
+ [![LanceDB](https://img.shields.io/badge/LanceDB-Vector+FTS-orange)](https://lancedb.com)
15
+ [![MCP](https://img.shields.io/badge/MCP-29_tools-blue)](https://modelcontextprotocol.io)
16
+ [![CC Plugin](https://img.shields.io/badge/Claude_Code-Plugin-blueviolet)](https://github.com/AliceLJY/recallnest)
17
+
18
+ **English** | [简体中文](README_CN.md) | [Roadmap](ROADMAP.md)
19
+
20
+ </div>
21
+
22
+ ---
23
+
24
+ ## Why RecallNest?
25
+
26
+ Most coding agents forget everything when you open a new window. Worse — your history is scattered across three different terminals with no shared memory.
27
+
28
+ ### Without RecallNest — every window starts from zero:
29
+
30
+ > **You (Claude Code):** "The Docker config lives at `/opt/app/config.json`, use port 4318."
31
+ >
32
+ > *(switch to Codex)*
33
+ >
34
+ > **You:** "The config is at... wait, let me find it again." 😤
35
+ >
36
+ > *(next day, new Claude Code window)*
37
+ >
38
+ > **You:** "We already fixed this exact bug last week! The solution was..."
39
+ >
40
+ > **Agent:** "I don't have context about previous sessions." 🤷
41
+
42
+ ### With RecallNest — context carries over:
43
+
44
+ > **You (Claude Code):** "The Docker config lives at `/opt/app/config.json`, use port 4318."
45
+ >
46
+ > *(switch to Codex — same memory layer)*
47
+ >
48
+ > **Agent:** *(auto-recalls project entities)* "Using config at `/opt/app/config.json`, port 4318." ✅
49
+ >
50
+ > *(next day, new window)*
51
+ >
52
+ > **Agent:** *(resume_context fires)* "Continuing from yesterday — the Docker port conflict was resolved by..." ✅
53
+
54
+ That's the difference: **one memory shared across terminals**, with context that survives window boundaries.
55
+
56
+ ### What you get
57
+
58
+ | | Capability |
59
+ |---|---|
60
+ | **CC Plugin** | Install in Claude Code with one command — no manual config |
61
+ | **Shared Index** | One LanceDB store for Claude Code, Codex, and Gemini CLI |
62
+ | **Dual Interface** | MCP (stdio) for CLI tools + HTTP API for custom agents |
63
+ | **One-Click Setup** | Integration scripts install MCP access and continuity rules |
64
+ | **Hybrid Retrieval** | Vector + BM25 + reranking + Weibull decay + tier promotion |
65
+ | **Session Continuity** | `checkpoint_session` + `resume_context` for cross-window recovery |
66
+ | **Workflow Observation** | Dedicated append-only workflow health records, outside regular memory |
67
+ | **Structured Assets** | Pins, briefs, and distilled summaries — not just raw logs |
68
+ | **Smart Promotion** | Evidence → durable memory with conflict guards and merge resolution |
69
+ | **6 Categories** | profile, preferences, entities, events, cases, patterns |
70
+ | **4 Retrieval Profiles** | default, writing, debug, fact-check — tuned for different tasks |
71
+ | **Multi-Source Ingest** | Import existing transcripts from all three terminals |
72
+
73
+ ---
74
+
75
+ ## Quick Start
76
+
77
+ ### Option A: Claude Code Plugin (recommended)
78
+
79
+ ```bash
80
+ /plugin marketplace add AliceLJY/recallnest
81
+ /plugin install recallnest@AliceLJY
82
+ ```
83
+
84
+ RecallNest starts automatically with Claude Code. No manual MCP config needed.
85
+
86
+ > **Requires:** [Bun](https://bun.sh) runtime. Dependencies install on first start.
87
+
88
+ ### Option B: Manual setup
89
+
90
+ ```bash
91
+ git clone https://github.com/AliceLJY/recallnest.git
92
+ cd recallnest
93
+ bun install
94
+ cp config.json.example config.json
95
+ cp .env.example .env
96
+ # Edit .env → add your JINA_API_KEY
97
+ ```
98
+
99
+ ### Start the server
100
+
101
+ ```bash
102
+ bun run api
103
+ # → RecallNest API running at http://localhost:4318
104
+ ```
105
+
106
+ ### Try it
107
+
108
+ ```bash
109
+ # Store a memory
110
+ curl -X POST http://localhost:4318/v1/store \
111
+ -H "Content-Type: application/json" \
112
+ -d '{"text": "User prefers dark mode", "category": "preferences"}'
113
+
114
+ # Recall memories
115
+ curl -X POST http://localhost:4318/v1/recall \
116
+ -H "Content-Type: application/json" \
117
+ -d '{"query": "user preferences"}'
118
+
119
+ # Check stats
120
+ curl http://localhost:4318/v1/stats
121
+ ```
122
+
123
+ ### Connect your terminals
124
+
125
+ ```bash
126
+ bash integrations/claude-code/setup.sh
127
+ bash integrations/gemini-cli/setup.sh
128
+ bash integrations/codex/setup.sh
129
+ ```
130
+
131
+ Each script installs MCP access and managed continuity rules, so `resume_context` fires automatically in fresh windows.
132
+
133
+ ### Index existing conversations
134
+
135
+ ```bash
136
+ bun run src/cli.ts ingest --source all
137
+ bun run seed:continuity
138
+ bun run src/cli.ts doctor
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Architecture
144
+
145
+ ```
146
+ ┌──────────────────────────────────────────────────────────┐
147
+ │ Client Layer │
148
+ ├──────────┬──────────┬──────────┬──────────────────────────┤
149
+ │ Claude │ Gemini │ Codex │ Custom Agents / curl │
150
+ │ Code │ CLI │ │ │
151
+ └────┬─────┴────┬─────┴────┬─────┴──────┬──────────────────┘
152
+ │ │ │ │
153
+ └──── MCP (stdio) ───┘ HTTP API (port 4318)
154
+ │ │
155
+ ▼ ▼
156
+ ┌──────────────────────────────────────────────────────────┐
157
+ │ Integration Layer │
158
+ │ ┌─────────────────────┐ ┌────────────────────────────┐ │
159
+ │ │ MCP Server │ │ HTTP API Server │ │
160
+ │ │ 29 tools │ │ 19 endpoints │ │
161
+ │ └─────────┬───────────┘ └──────────┬─────────────────┘ │
162
+ └────────────┼─────────────────────────┼───────────────────┘
163
+ └──────────┬──────────────┘
164
+ ▼
165
+ ┌──────────────────────────────────────────────────────────┐
166
+ │ Core Engine │
167
+ │ │
168
+ │ ┌────────────┐ ┌────────────┐ ┌─────────────────────┐ │
169
+ │ │ Retriever │ │ Classifier │ │ Context Composer │ │
170
+ │ │ (vector + │ │ (6 cats) │ │ (resume_context) │ │
171
+ │ │ BM25 + RRF)│ │ │ │ │ │
172
+ │ └────────────┘ └────────────┘ └──────────────────────┘ │
173
+ │ ┌────────────┐ ┌────────────┐ ┌─────────────────────┐ │
174
+ │ │ Decay │ │ Conflict │ │ Capture Engine │ │
175
+ │ │ Engine │ │ Engine │ │ (evidence → durable) │ │
176
+ │ │ (Weibull) │ │ (audit + │ │ │ │
177
+ │ │ │ │ merge) │ │ │ │
178
+ │ └────────────┘ └────────────┘ └──────────────────────┘ │
179
+ └──────────────────────────┬───────────────────────────────┘
180
+ ▼
181
+ ┌──────────────────────────────────────────────────────────┐
182
+ │ Storage Layer │
183
+ │ ┌─────────────────────┐ ┌────────────────────────────┐ │
184
+ │ │ LanceDB │ │ Jina Embeddings v5 │ │
185
+ │ │ (vector + columnar) │ │ (1024-dim, task-aware) │ │
186
+ │ └─────────────────────┘ └────────────────────────────┘ │
187
+ └──────────────────────────────────────────────────────────┘
188
+ ```
189
+
190
+ > Full architecture deep-dive: [`docs/architecture.md`](docs/architecture.md)
191
+
192
+ ---
193
+
194
+ ## Integrations
195
+
196
+ RecallNest serves two interfaces:
197
+
198
+ - **MCP** — for Claude Code, Gemini CLI, and Codex (native tool access)
199
+ - **HTTP API** — for custom agents, SDK-based apps, and any HTTP client
200
+
201
+ ### Agent framework examples
202
+
203
+ Examples live in [`integrations/examples/`](integrations/examples/):
204
+
205
+ | Framework | Example | Language |
206
+ |-----------|---------|----------|
207
+ | [Claude Agent SDK](integrations/examples/claude-agent-sdk/) | `memory-agent.ts` | TypeScript |
208
+ | [OpenAI Agents SDK](integrations/examples/openai-agents-sdk/) | `memory-agent.py` | Python |
209
+ | [LangChain](integrations/examples/langchain/) | `memory-chain.py` | Python |
210
+
211
+ ---
212
+
213
+ ## Core Features
214
+
215
+ ### Hybrid Retrieval
216
+
217
+ ```
218
+ Query → Embedding ──┐
219
+ ├── Hybrid Fusion → Rerank → Weibull Decay → Filter → Top-K
220
+ Query → BM25 FTS ──┘
221
+ ```
222
+
223
+ - **Vector search** — semantic similarity via LanceDB ANN
224
+ - **BM25 full-text search** — exact keyword matching via LanceDB FTS
225
+ - **Hybrid fusion** — vector + BM25 combined scoring
226
+ - **Reranking** — Jina cross-encoder reranking
227
+ - **Decay + tiering** — Weibull freshness model with Core / Working / Peripheral tiers
228
+
229
+ ### Session Continuity
230
+
231
+ The killer feature for multi-window workflows:
232
+
233
+ - **`checkpoint_session`** — snapshot current work state (decisions, open loops, next actions)
234
+ - **Repo-state guard** — saved checkpoints strip `git status` / modified-file text so volatile repo state does not contaminate later handoffs
235
+ - **`resume_context`** — compose startup context from checkpoints + durable memory + pins
236
+ - **Managed rules** — integration scripts install continuity rules so `resume_context` fires automatically
237
+
238
+ ### Workflow Observation
239
+
240
+ RecallNest now keeps workflow observations in a dedicated append-only store instead of stuffing them into the regular memory index:
241
+
242
+ - **`workflow_observe`** — record whether `resume_context`, `checkpoint_session`, or another workflow primitive succeeded, failed, was corrected, or was missed
243
+ - **`workflow_health`** — aggregate 7d / 30d health for one workflow or show a degraded-workflow dashboard
244
+ - **`workflow_evidence`** — package recent issue observations, top signals, and suggested next actions for debugging
245
+
246
+ These records live under `data/workflow-observations`, not in the 6 memory categories, and they are never composed into `resume_context` as stable recall.
247
+ Managed MCP / HTTP continuity calls now append observations automatically for `resume_context` and `checkpoint_session`, while repo-state sanitization is recorded as a `corrected` checkpoint observation instead of polluting durable memory.
248
+
249
+ ### Memory Promotion & Conflict Resolution
250
+
251
+ Raw transcripts don't silently become long-term memory:
252
+
253
+ - **Evidence → durable** — explicit `promote_memory` with `canonicalKey` and provenance
254
+ - **Conflict guards** — canonical-key collisions surface as conflict candidates
255
+ - **Resolution** — keep existing, accept new, or merge — with advice and cluster views
256
+ - **Audit + escalation** — `conflicts audit --export` for operational review
257
+
258
+ ### Retrieval Profiles
259
+
260
+ | Profile | Best for | Bias |
261
+ |---------|----------|------|
262
+ | `default` | Everyday recall | Balanced |
263
+ | `writing` | Drafting and idea mining | Broader semantic, older material OK |
264
+ | `debug` | Errors, commands, fixes | Keyword-heavy, recency-biased |
265
+ | `fact-check` | Evidence lookup | Tighter cutoff, exact-match bias |
266
+
267
+ ### Memory Categories
268
+
269
+ | Category | Description | Strategy |
270
+ |----------|-------------|----------|
271
+ | `profile` | User identity and background | Merge |
272
+ | `preferences` | Habits, style, dislikes | Merge |
273
+ | `entities` | Projects, tools, people | Merge |
274
+ | `events` | Things that happened | Append |
275
+ | `cases` | Problem → solution pairs | Append |
276
+ | `patterns` | Reusable workflows | Merge |
277
+
278
+ Details: [`docs/memory-categories.md`](docs/memory-categories.md)
279
+
280
+ ---
281
+
282
+ <details>
283
+ <summary><strong>MCP Tools (29 tools)</strong></summary>
284
+
285
+ | Tool | Description |
286
+ |------|-------------|
287
+ | `workflow_observe` | Store an append-only workflow observation outside regular memory |
288
+ | `workflow_health` | Inspect workflow observation health or show a degraded-workflow dashboard |
289
+ | `workflow_evidence` | Build an evidence pack for a workflow primitive |
290
+ | `store_memory` | Store a durable memory for future windows |
291
+ | `store_workflow_pattern` | Store a reusable workflow as durable `patterns` memory |
292
+ | `store_case` | Store a reusable problem-solution pair as durable `cases` memory |
293
+ | `promote_memory` | Explicitly promote evidence into durable memory |
294
+ | `list_conflicts` | List or inspect promotion conflict candidates |
295
+ | `audit_conflicts` | Summarize stale/escalated conflict priorities |
296
+ | `escalate_conflicts` | Preview or apply conflict escalation metadata |
297
+ | `resolve_conflict` | Resolve a stored conflict candidate (keep / accept / merge) |
298
+ | `checkpoint_session` | Store the current active work state outside durable memory |
299
+ | `latest_checkpoint` | Inspect the latest saved checkpoint by session or scope |
300
+ | `resume_context` | Compose startup context for a fresh window |
301
+ | `search_memory` | Proactive recall at task start |
302
+ | `explain_memory` | Explain why memories matched |
303
+ | `distill_memory` | Distill results into a compact briefing |
304
+ | `brief_memory` | Create a structured brief and re-index it |
305
+ | `pin_memory` | Promote a scoped memory into a pinned asset |
306
+ | `export_memory` | Export a distilled memory briefing to disk |
307
+ | `list_pins` | List pinned memories |
308
+ | `list_assets` | List all structured assets |
309
+ | `list_dirty_briefs` | Preview outdated brief assets created before the cleanup rules |
310
+ | `clean_dirty_briefs` | Archive dirty brief assets and remove their indexed rows |
311
+ | `memory_stats` | Show index statistics |
312
+ | `memory_drill_down` | Inspect a specific memory entry with full metadata and provenance |
313
+ | `auto_capture` | Heuristically extract and store memory signals from text (zero LLM calls) |
314
+ | `set_reminder` | Set a prospective memory reminder to surface in a future session |
315
+ | `consolidate_memories` | Cluster near-duplicate memories and merge them (dry-run by default) |
316
+
317
+ </details>
318
+
319
+ <details>
320
+ <summary><strong>HTTP API (19 endpoints)</strong></summary>
321
+
322
+ Base URL: `http://localhost:4318`
323
+
324
+ | Endpoint | Method | Description |
325
+ |----------|--------|-------------|
326
+ | `/v1/recall` | POST | Quick semantic search |
327
+ | `/v1/store` | POST | Store a new memory |
328
+ | `/v1/capture` | POST | Store multiple structured memories |
329
+ | `/v1/pattern` | POST | Store a structured workflow pattern |
330
+ | `/v1/case` | POST | Store a structured problem-solution case |
331
+ | `/v1/promote` | POST | Promote evidence into durable memory |
332
+ | `/v1/conflicts` | GET | List or inspect promotion conflict candidates |
333
+ | `/v1/conflicts/audit` | GET | Summarize stale/escalated conflict priorities |
334
+ | `/v1/conflicts/escalate` | POST | Preview or apply conflict escalation metadata |
335
+ | `/v1/conflicts/resolve` | POST | Resolve a stored conflict candidate (keep / accept / merge) |
336
+ | `/v1/checkpoint` | POST | Store the current work checkpoint |
337
+ | `/v1/workflow-observe` | POST | Store a workflow observation outside durable memory |
338
+ | `/v1/checkpoint/latest` | GET | Fetch the latest checkpoint by session or scope |
339
+ | `/v1/workflow-health` | GET | Inspect workflow health or return a degraded-workflow dashboard |
340
+ | `/v1/workflow-evidence` | GET | Build a workflow evidence pack from recent issue observations |
341
+ | `/v1/resume` | POST | Compose startup context for a fresh window |
342
+ | `/v1/search` | POST | Advanced search with full metadata |
343
+ | `/v1/stats` | GET | Memory statistics |
344
+ | `/v1/health` | GET | Health check |
345
+
346
+ Full documentation: [`docs/api-reference.md`](docs/api-reference.md)
347
+
348
+ </details>
349
+
350
+ <details>
351
+ <summary><strong>CLI Commands</strong></summary>
352
+
353
+ ```bash
354
+ # Search & explore
355
+ bun run src/cli.ts search "your query"
356
+ bun run src/cli.ts explain "your query" --profile debug
357
+ bun run src/cli.ts distill "topic" --profile writing
358
+ bun run src/cli.ts stats
359
+
360
+ # Workflow observation
361
+ bun run src/cli.ts workflow-observe resume_context "Fresh window skipped continuity recovery." --outcome missed --scope project:recallnest
362
+ bun run src/cli.ts workflow-health resume_context --scope project:recallnest
363
+ bun run src/cli.ts workflow-evidence checkpoint_session --scope project:recallnest
364
+
365
+ # Conflict management
366
+ bun run src/cli.ts conflicts list
367
+ bun run src/cli.ts conflicts list --attention resolved
368
+ bun run src/cli.ts conflicts list --group-by cluster --attention resolved
369
+ bun run src/cli.ts conflicts audit
370
+ bun run src/cli.ts conflicts audit --export --format md
371
+ bun run src/cli.ts conflicts escalate --attention stale
372
+ bun run src/cli.ts conflicts show af70545a
373
+ bun run src/cli.ts conflicts resolve af70545a --keep-existing
374
+ bun run src/cli.ts conflicts resolve af70545a --merge
375
+ bun run src/cli.ts conflicts resolve --all --keep-existing --status open
376
+
377
+ # Ingestion & diagnostics
378
+ bun run src/cli.ts ingest --source all
379
+ bun run src/cli.ts doctor
380
+ ```
381
+
382
+ </details>
383
+
384
+ <details>
385
+ <summary><strong>Web UI (debugging)</strong></summary>
386
+
387
+ ```bash
388
+ bun run src/ui-server.ts
389
+ # → http://localhost:4317
390
+ ```
391
+
392
+ The Web UI is for debugging and exploration, not the primary production interface.
393
+
394
+ </details>
395
+
396
+ ---
397
+
398
+ ## Relationship to memory-lancedb-pro
399
+
400
+ RecallNest started as a fork of [memory-lancedb-pro](https://github.com/CortexReach/memory-lancedb-pro) and shares its core ideas around hybrid retrieval, decay modeling, and memory-as-engineering-system. The key difference:
401
+
402
+ - **memory-lancedb-pro** is an OpenClaw plugin — it adds long-term memory to a single OpenClaw agent.
403
+ - **RecallNest** is a standalone memory layer — it serves Claude Code, Codex, and Gemini CLI simultaneously through MCP + HTTP API, with session continuity, structured assets, and conflict management built in.
404
+
405
+ ## Credit
406
+
407
+ | Source | Contribution |
408
+ |--------|-------------|
409
+ | [claude-memory-pro](https://github.com/CortexReach/claude-memory-pro) by [@win4r](https://github.com/win4r) | Retrieval core ideas and implementation base |
410
+ | Claude Code | Foundation and early project scaffolding |
411
+ | OpenAI Codex | Productization and MCP expansion |
412
+
413
+ Special thanks to Qin Chao ([@win4r](https://github.com/win4r)) and the [CortexReach](https://github.com/CortexReach) team for the foundational work.
414
+
415
+ ## Star History
416
+
417
+ <a href="https://star-history.com/#AliceLJY/recallnest&Date">
418
+ <picture>
419
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=AliceLJY/recallnest&type=Date&theme=dark&transparent=true" />
420
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=AliceLJY/recallnest&type=Date&transparent=true" />
421
+ <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=AliceLJY/recallnest&type=Date&transparent=true" />
422
+ </picture>
423
+ </a>
424
+
425
+ ## License
426
+
427
+ MIT