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.
- package/.claude-plugin/CLAUDE.md +29 -0
- package/.claude-plugin/marketplace.json +18 -0
- package/.env.example +3 -0
- package/.github/workflows/ci.yml +28 -0
- package/.mcp.json +9 -0
- package/CHANGELOG.md +51 -0
- package/CLAUDE.md +42 -0
- package/DEMO.md +94 -0
- package/EVAL.md +89 -0
- package/FAILURES.md +75 -0
- package/LICENSE +21 -0
- package/OPERATIONS.md +59 -0
- package/README.md +427 -0
- package/README_CN.md +425 -0
- package/ROADMAP.md +198 -0
- package/assets/recallnest-workbench.png +0 -0
- package/assets/ui/app.js +807 -0
- package/assets/ui/index.html +154 -0
- package/assets/ui/styles.css +605 -0
- package/assets/wechat-qr.jpg +0 -0
- package/config.json.example +38 -0
- package/daily-recall.sh +87 -0
- package/daily-reflections/2026-03-05.md +15 -0
- package/daily-reflections/2026-03-06.md +15 -0
- package/daily-reflections/2026-03-07.md +7 -0
- package/daily-reflections/2026-03-08.md +34 -0
- package/daily-reflections/2026-03-09.md +35 -0
- package/daily-reflections/2026-03-10.md +36 -0
- package/daily-reflections/2026-03-11.md +35 -0
- package/daily-reflections/2026-03-12.md +36 -0
- package/daily-reflections/2026-03-13.md +35 -0
- package/daily-reflections/2026-03-14.md +35 -0
- package/daily-reflections/2026-03-15.md +35 -0
- package/daily-reflections/2026-03-16.md +41 -0
- package/daily-reflections/2026-03-17.md +10 -0
- package/daily-reflections/2026-03-18.md +10 -0
- package/daily-reflections/2026-03-19.md +10 -0
- package/daily-reflections/2026-03-20.md +10 -0
- package/daily-reflections/2026-03-21.md +10 -0
- package/daily-reflections/2026-03-22.md +10 -0
- package/daily-reflections/2026-03-23.md +10 -0
- package/daily-reflections/2026-03-24.md +10 -0
- package/daily-reflections/2026-03-25.md +32 -0
- package/daily-reflections/2026-03-26.md +37 -0
- package/daily-reflections/2026-03-27.md +35 -0
- package/daily-reflections/2026-03-28.md +35 -0
- package/daily-reflections/2026-03-29.md +35 -0
- package/daily-reflections/2026-03-30.md +36 -0
- package/daily-reflections/2026-03-31.md +35 -0
- package/daily-reflections/2026-04-01.md +35 -0
- package/docs/api-reference.md +1291 -0
- package/docs/architecture.md +168 -0
- package/docs/memory-boundary-contract.md +226 -0
- package/docs/memory-categories.md +119 -0
- package/docs/pipeline-audit-ultramemory.md +177 -0
- package/docs/plans/2026-03-08-query-expansion.md +270 -0
- package/docs/plans/2026-03-16-continuity-layer.md +196 -0
- package/docs/plans/mcp-tiering-plan.md +126 -0
- package/docs/research/recall-quality-audit-2026-03-22.md +153 -0
- package/docs/self-evolution.md +198 -0
- package/docs/superpowers/plans/2026-03-19-ingest-pipeline-upgrade.md +782 -0
- package/docs/superpowers/specs/2026-03-19-ingest-pipeline-upgrade-design.md +77 -0
- package/docs/superpowers/specs/2026-03-23-pull-claude-desktop-design.md +95 -0
- package/eval/cases.json +85 -0
- package/eval/continuity/case-seeds.json +90 -0
- package/eval/continuity/cases.json +302 -0
- package/eval/continuity/memory-seeds.json +26 -0
- package/eval/continuity/pattern-seeds.json +100 -0
- package/eval/continuity/results-2026-03-16.md +117 -0
- package/eval/continuity/results-2026-03-19.md +453 -0
- package/eval/continuity/runbook.md +110 -0
- package/eval/continuity/seed-cases.md +54 -0
- package/eval/reports/2026-03-06-abstract-query-baseline.md +96 -0
- package/eval/reports/2026-03-06-aws-ssh-baseline.md +82 -0
- package/eval/reports/2026-03-06-baseline.md +82 -0
- package/eval/reports/query-expansion.md +138 -0
- package/integrations/README.md +57 -0
- package/integrations/claude-code/README.md +133 -0
- package/integrations/claude-code/claude-md-snippet.md +31 -0
- package/integrations/claude-code/setup.sh +66 -0
- package/integrations/claude-code/smoke-continuity.sh +452 -0
- package/integrations/codex/README.md +49 -0
- package/integrations/codex/agents-md-snippet.md +31 -0
- package/integrations/codex/setup.sh +58 -0
- package/integrations/examples/claude-agent-sdk/memory-agent.ts +182 -0
- package/integrations/examples/langchain/memory-chain.py +111 -0
- package/integrations/examples/openai-agents-sdk/memory-agent.py +109 -0
- package/integrations/gemini-cli/README.md +57 -0
- package/integrations/gemini-cli/gemini-md-snippet.md +31 -0
- package/integrations/gemini-cli/setup.sh +64 -0
- package/integrations/shared/install-managed-block.sh +51 -0
- package/lm +19 -0
- package/package.json +50 -0
- package/plan-v1.2-distributable.md +105 -0
- package/scripts/archive-distilled-junk.ts +116 -0
- package/scripts/backfill-l0l1l2.ts +98 -0
- package/scripts/blind-scan.ts +588 -0
- package/scripts/cleanup-step1-exact-dups.ts +117 -0
- package/scripts/cleanup-step2-template-dups.ts +113 -0
- package/scripts/cleanup-step3-stale-content.ts +149 -0
- package/scripts/cleanup-step4-orphan-scopes.ts +131 -0
- package/scripts/delete-distilled-junk.ts +88 -0
- package/scripts/distill-facts.ts +305 -0
- package/scripts/health-check.ts +343 -0
- package/scripts/incremental-ingest.sh +71 -0
- package/scripts/mlp-health-check.ts +382 -0
- package/scripts/pull-claude-desktop.ts +515 -0
- package/scripts/re-ingest-cc.sh +66 -0
- package/scripts/rebalance-memory-health.ts +181 -0
- package/scripts/run-desktop-ingest.sh +11 -0
- package/scripts/start-server.sh +12 -0
- package/scripts/viz-dashboard.html +423 -0
- package/scripts/viz-export.ts +703 -0
- package/src/__tests__/access-tracker-novelty.test.ts +228 -0
- package/src/__tests__/auto-consolidation.test.ts +168 -0
- package/src/__tests__/auto-recall.test.ts +131 -0
- package/src/__tests__/batch-dedup.test.ts +65 -0
- package/src/__tests__/capture-engine.test.ts +1142 -0
- package/src/__tests__/capture-heuristic.test.ts +171 -0
- package/src/__tests__/cascade-forget.test.ts +210 -0
- package/src/__tests__/category-min-scores.test.ts +33 -0
- package/src/__tests__/confidence-tracker.test.ts +196 -0
- package/src/__tests__/conflict-advisor.test.ts +206 -0
- package/src/__tests__/conflict-escalation.test.ts +149 -0
- package/src/__tests__/conflict-lifecycle.test.ts +83 -0
- package/src/__tests__/conflict-output.test.ts +85 -0
- package/src/__tests__/conflict-store.test.ts +374 -0
- package/src/__tests__/consolidation-engine.test.ts +181 -0
- package/src/__tests__/context-composer-pins.test.ts +64 -0
- package/src/__tests__/context-composer-task-selection.test.ts +24 -0
- package/src/__tests__/context-renderer.test.ts +91 -0
- package/src/__tests__/continuity-eval.test.ts +275 -0
- package/src/__tests__/continuity-schema.test.ts +97 -0
- package/src/__tests__/core-recall-eval.test.ts +235 -0
- package/src/__tests__/core-summary.test.ts +109 -0
- package/src/__tests__/dedup-actions.test.ts +58 -0
- package/src/__tests__/deterministic-id.test.ts +39 -0
- package/src/__tests__/doctor.test.ts +303 -0
- package/src/__tests__/drill-down.test.ts +108 -0
- package/src/__tests__/embedder.test.ts +122 -0
- package/src/__tests__/entity-resolver.test.ts +58 -0
- package/src/__tests__/event-segmenter.test.ts +153 -0
- package/src/__tests__/hotness-blend.test.ts +76 -0
- package/src/__tests__/ingest.test.ts +360 -0
- package/src/__tests__/kg-extractor.test.ts +184 -0
- package/src/__tests__/kg-store.test.ts +198 -0
- package/src/__tests__/llm-consolidation.test.ts +226 -0
- package/src/__tests__/memory-boundaries.test.ts +237 -0
- package/src/__tests__/memory-health-rebalance.test.ts +144 -0
- package/src/__tests__/memory-output.test.ts +215 -0
- package/src/__tests__/multi-vector.test.ts +242 -0
- package/src/__tests__/ppr-traversal.test.ts +256 -0
- package/src/__tests__/preference-guard-smoke.test.ts +211 -0
- package/src/__tests__/preference-matcher.test.ts +230 -0
- package/src/__tests__/preference-slots.test.ts +106 -0
- package/src/__tests__/prospective-memory.test.ts +283 -0
- package/src/__tests__/query-entity-detector.test.ts +171 -0
- package/src/__tests__/query-expander.test.ts +34 -0
- package/src/__tests__/recall-mode.test.ts +64 -0
- package/src/__tests__/result-synthesizer.test.ts +198 -0
- package/src/__tests__/resume-context.test.ts +4743 -0
- package/src/__tests__/retrieval-trace.test.ts +213 -0
- package/src/__tests__/retriever-boundary-weight.test.ts +136 -0
- package/src/__tests__/retroactive-boost.test.ts +223 -0
- package/src/__tests__/scope-inventory.test.ts +200 -0
- package/src/__tests__/scope-policy.test.ts +69 -0
- package/src/__tests__/session-checkpoint.test.ts +259 -0
- package/src/__tests__/session-gc.test.ts +215 -0
- package/src/__tests__/store-scope-audit.test.ts +81 -0
- package/src/__tests__/temporal-parser.test.ts +241 -0
- package/src/__tests__/term-registry.test.ts +121 -0
- package/src/__tests__/tool-output-compressor.test.ts +133 -0
- package/src/__tests__/version-manager.test.ts +213 -0
- package/src/__tests__/workflow-observation.test.ts +400 -0
- package/src/access-tracker.ts +316 -0
- package/src/adaptive-retrieval.ts +64 -0
- package/src/api-server.ts +667 -0
- package/src/asset-sync.ts +79 -0
- package/src/auto-consolidation.ts +133 -0
- package/src/auto-gc.ts +124 -0
- package/src/auto-recall.ts +95 -0
- package/src/capture-engine.ts +931 -0
- package/src/capture-heuristic.ts +177 -0
- package/src/cascade-forget.ts +135 -0
- package/src/chunker.ts +253 -0
- package/src/cli.ts +1917 -0
- package/src/confidence-tracker.ts +166 -0
- package/src/conflict-advisor.ts +433 -0
- package/src/conflict-engine.ts +181 -0
- package/src/conflict-escalation.ts +138 -0
- package/src/conflict-lifecycle.ts +67 -0
- package/src/conflict-output.ts +218 -0
- package/src/conflict-schema.ts +130 -0
- package/src/conflict-store.ts +127 -0
- package/src/consolidation-engine.ts +256 -0
- package/src/context-composer-pins.ts +183 -0
- package/src/context-composer-queries.ts +121 -0
- package/src/context-composer-scope.ts +56 -0
- package/src/context-composer-stable-selection.ts +200 -0
- package/src/context-composer-stable.ts +217 -0
- package/src/context-composer-task-fallbacks.ts +36 -0
- package/src/context-composer-task-ranking.ts +197 -0
- package/src/context-composer-task-results.ts +137 -0
- package/src/context-composer-task-selection.ts +342 -0
- package/src/context-composer-text.ts +57 -0
- package/src/context-composer.ts +300 -0
- package/src/context-renderer.ts +179 -0
- package/src/decay-engine.ts +189 -0
- package/src/doctor.ts +543 -0
- package/src/embedder.ts +557 -0
- package/src/entity-resolver.ts +131 -0
- package/src/eval.ts +632 -0
- package/src/event-segmenter.ts +216 -0
- package/src/ingest.ts +1822 -0
- package/src/kg-extractor.ts +217 -0
- package/src/kg-store.ts +353 -0
- package/src/legacy-scope-review.ts +53 -0
- package/src/llm-client.ts +629 -0
- package/src/llm-consolidation.ts +168 -0
- package/src/mcp-server.ts +1337 -0
- package/src/memory-assets.ts +475 -0
- package/src/memory-boundaries.ts +354 -0
- package/src/memory-health-rebalance.ts +220 -0
- package/src/memory-output.ts +474 -0
- package/src/memory-schema.ts +184 -0
- package/src/multi-vector.ts +234 -0
- package/src/noise-filter.ts +155 -0
- package/src/ppr-traversal.ts +279 -0
- package/src/preference-matcher.ts +174 -0
- package/src/preference-slots.ts +259 -0
- package/src/prospective-memory.ts +198 -0
- package/src/query-entity-detector.ts +207 -0
- package/src/query-expander.ts +98 -0
- package/src/result-synthesizer.ts +114 -0
- package/src/retrieval-profiles.ts +101 -0
- package/src/retrieval-trace.ts +94 -0
- package/src/retriever.ts +1338 -0
- package/src/retroactive-boost.ts +154 -0
- package/src/rif.ts +73 -0
- package/src/runtime-config.ts +172 -0
- package/src/schema-utils.ts +56 -0
- package/src/scope-inventory.ts +310 -0
- package/src/scope-policy.ts +142 -0
- package/src/session-engine.ts +168 -0
- package/src/session-output.ts +96 -0
- package/src/session-schema.ts +60 -0
- package/src/session-store.ts +293 -0
- package/src/stderr-log.ts +16 -0
- package/src/store.ts +903 -0
- package/src/temporal-parser.ts +318 -0
- package/src/term-registry.ts +791 -0
- package/src/tool-output-compressor.ts +115 -0
- package/src/tracker.ts +57 -0
- package/src/ui-server.ts +430 -0
- package/src/version-manager.ts +172 -0
- package/src/workflow-observation-engine.ts +316 -0
- package/src/workflow-observation-managed.ts +83 -0
- package/src/workflow-observation-output.ts +86 -0
- package/src/workflow-observation-schema.ts +87 -0
- package/src/workflow-observation-scope-review.ts +409 -0
- 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
|
+
[](https://github.com/AliceLJY/recallnest)
|
|
12
|
+
[](LICENSE)
|
|
13
|
+
[](https://bun.sh)
|
|
14
|
+
[](https://lancedb.com)
|
|
15
|
+
[](https://modelcontextprotocol.io)
|
|
16
|
+
[](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
|