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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# RecallNest Memory Plugin
|
|
2
|
+
|
|
3
|
+
RecallNest is a local-first shared memory layer backed by LanceDB. It stores and recalls context across sessions, terminals, and agents (Claude Code, Codex, Gemini CLI).
|
|
4
|
+
|
|
5
|
+
**Prerequisite**: Requires [Bun](https://bun.sh) runtime. On first start, dependencies install automatically.
|
|
6
|
+
|
|
7
|
+
## Tool Quick Reference
|
|
8
|
+
|
|
9
|
+
| When | Tool | Purpose |
|
|
10
|
+
|------|------|---------|
|
|
11
|
+
| Session opens, user says continue/接着/上个窗口 | `resume_context` | Load stable context, latest checkpoint, recent cases |
|
|
12
|
+
| Before answering about prior work / known facts | `search_memory` | Targeted fact/pattern recall (2-3 key nouns) |
|
|
13
|
+
| After solving something significant | `store_memory` or `store_case` | Persist durable knowledge |
|
|
14
|
+
| Before closing a window with unfinished work | `checkpoint_session` | Save current state for next session |
|
|
15
|
+
| After discovering a reusable workflow | `store_workflow_pattern` | Persist as durable pattern |
|
|
16
|
+
| Memory feels stale or conflicted | `consolidate_memories` | Merge near-duplicates (dry-run by default) |
|
|
17
|
+
|
|
18
|
+
## Continuity Rules
|
|
19
|
+
|
|
20
|
+
- If the user says `continue`, `继续`, `接着`, `刚才`, `上个窗口`, `不要让我重复前情`, or asks where you stopped / what to do next — call `resume_context` before any Bash, Read, or repo exploration.
|
|
21
|
+
- If the user starts a concrete task in an active project or asks for prior implementation detail — do lightweight RecallNest recovery before repo exploration even without an explicit `continue`.
|
|
22
|
+
- Do not substitute `git status`, `git log`, or reading local docs for `resume_context`. Local inspection can validate current code state only **after** continuity has been recovered.
|
|
23
|
+
- When `scope` or `sessionId` is known, pass it into recall tools instead of relying on global recall.
|
|
24
|
+
- If `resume_context` returns a resolved scope or checkpoint scope, reuse that same scope in follow-up `search_memory`, `brief_memory`, `pin_memory` calls.
|
|
25
|
+
- If recalled context mentions repo state (modified files, pending push), treat it as **handoff context only** — do not restate as current state without verifying in this window.
|
|
26
|
+
- Before leaving a window with resumable work, call `checkpoint_session`. Do not include repo state claims unless you actually inspected the repo this window.
|
|
27
|
+
- Use `store_memory` for durable profile, preference, entity, or case knowledge.
|
|
28
|
+
- Use `store_workflow_pattern` for reusable multi-step workflows.
|
|
29
|
+
- If the user explicitly corrects a continuity miss, fix the workflow and call `workflow_observe` with `outcome: corrected`.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "AliceLJY",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "Alice Jin Ye"
|
|
5
|
+
},
|
|
6
|
+
"metadata": {
|
|
7
|
+
"description": "RecallNest — shared memory layer for Claude Code, Codex, and Gemini CLI",
|
|
8
|
+
"homepage": "https://github.com/AliceLJY/recallnest"
|
|
9
|
+
},
|
|
10
|
+
"plugins": [
|
|
11
|
+
{
|
|
12
|
+
"name": "recallnest",
|
|
13
|
+
"version": "1.4.1",
|
|
14
|
+
"source": "./",
|
|
15
|
+
"description": "Local-first memory system: store, search, and recall context across sessions and terminals. Powered by LanceDB with hybrid retrieval."
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/.env.example
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
check:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- uses: oven-sh/setup-bun@v2
|
|
16
|
+
with:
|
|
17
|
+
bun-version: latest
|
|
18
|
+
|
|
19
|
+
- run: bun install
|
|
20
|
+
|
|
21
|
+
- name: Setup config
|
|
22
|
+
run: cp config.json.example config.json
|
|
23
|
+
|
|
24
|
+
- name: Doctor (CI mode)
|
|
25
|
+
run: bun run src/cli.ts doctor --ci
|
|
26
|
+
|
|
27
|
+
- name: TypeScript check
|
|
28
|
+
run: bun build src/cli.ts --target bun --no-bundle --outdir /tmp/check 2>&1 || true
|
package/.mcp.json
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v1.3.1 — Upstream Sync (2026-03-12)
|
|
4
|
+
|
|
5
|
+
Synced with [CortexReach/memory-lancedb-pro](https://github.com/CortexReach/memory-lancedb-pro) master (v1.1.0-beta.6+).
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- **Retriever**: Added `source` field to `RetrievalContext` — access reinforcement now only fires on manual retrieval, preventing auto-recall from strengthening noise memories (synced from upstream beta.2 design).
|
|
10
|
+
- **Noise filter**: Added Chinese meta-question patterns (`你记得`, `记不记得`, `还记得…吗`, `上次…说`, `之前…提到`) and diagnostic artifact filter (synced from upstream beta.3).
|
|
11
|
+
- **README**: Updated upstream credit link from `win4r/memory-lancedb-pro` to `CortexReach/memory-lancedb-pro`, added CortexReach team acknowledgement.
|
|
12
|
+
|
|
13
|
+
## v1.2.0 — First Distributable Release (2026-03-08)
|
|
14
|
+
|
|
15
|
+
The goal of this release: a new user can go from `git clone` to first search result in 15 minutes.
|
|
16
|
+
|
|
17
|
+
### New
|
|
18
|
+
|
|
19
|
+
- **`lm doctor`** — one-command pre-flight check for Bun, config, API key, data directory, transcript paths, and index health. Supports `--ci` mode for GitHub Actions.
|
|
20
|
+
- **`lm demo`** — run sample queries to see RecallNest in action before writing your own.
|
|
21
|
+
- **`config.json.example`** — ships with absolute `~/.recallnest/data/lancedb` path. New users copy this instead of editing the tracked config.
|
|
22
|
+
- **GitHub Actions CI** — runs `doctor --ci` and TypeScript check on every push.
|
|
23
|
+
- **Ingest pre-validation** — embedding API is tested before processing any files. Invalid Jina key now fails fast with a clear message instead of crashing mid-ingest.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **README rewritten** — added Prerequisites table (Bun + Jina key), 5-step quickstart with expected output, Troubleshooting section.
|
|
28
|
+
- **Gemini support marked "coming soon"** — README, config example, and doctor all honestly reflect that Gemini CLI sessions are encrypted protobuf and not yet parseable. The `lm ingest` command prints a clear skip message instead of silently failing.
|
|
29
|
+
- **Config path robustness** — default `dbPath` changed from relative `./data/lancedb` to absolute `~/.recallnest/data/lancedb` in config example. Auto-detect failure messages now include the user's actual home path.
|
|
30
|
+
- **`config.json` untracked** — added to `.gitignore` so user config is not overwritten by `git pull`.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- Auto-detect hint in `doctor` now shows a real example path based on the current user's home directory.
|
|
35
|
+
- `findConfigPath()` error message now suggests `cp config.json.example config.json` when the example file exists.
|
|
36
|
+
|
|
37
|
+
## v1.1.0 — Hybrid Retrieval + MCP + UI (2026-02)
|
|
38
|
+
|
|
39
|
+
- Hybrid retrieval: LanceDB vector + BM25 keyword search with configurable weights
|
|
40
|
+
- Retrieval profiles: `default`, `writing`, `debug`, `fact-check`
|
|
41
|
+
- MCP server with 9 tools: search, explain, distill, brief, pin, list assets/pins, export, stats
|
|
42
|
+
- Local web workbench UI at `http://localhost:4317`
|
|
43
|
+
- Multi-source ingest: Claude Code transcripts, Codex sessions, Gemini sessions, markdown notes
|
|
44
|
+
- Asset system: pin, brief, export with re-indexing
|
|
45
|
+
- Time-aware scoring with configurable decay
|
|
46
|
+
|
|
47
|
+
## v1.0.0 — Initial Release (2026-01)
|
|
48
|
+
|
|
49
|
+
- Basic vector search over Claude Code transcripts
|
|
50
|
+
- LanceDB storage with Jina embeddings
|
|
51
|
+
- CLI interface
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# RecallNest 项目规则
|
|
2
|
+
|
|
3
|
+
## 1. 技术栈约束(强制)
|
|
4
|
+
|
|
5
|
+
- **运行时:Bun**。禁止使用 `npm`、`yarn`、`pnpm`,所有命令走 `bun`
|
|
6
|
+
- **语言:TypeScript strict**。禁止 `any` 类型,复杂接口提取到独立类型文件
|
|
7
|
+
- **向量存储:LanceDB**。不引入其他向量数据库
|
|
8
|
+
- **嵌入模型:Jina v5**。不替换嵌入方案
|
|
9
|
+
- **MCP 协议:`@modelcontextprotocol/sdk`**。MCP tools 统一走 `registerTool()`
|
|
10
|
+
|
|
11
|
+
## 2. 编码规范
|
|
12
|
+
|
|
13
|
+
- 新增 MCP tool 必须同时写测试(`src/__tests__/`)
|
|
14
|
+
- 禁止生成带 `// TODO` 或 `// placeholder` 的半成品代码——缺信息就停下来问
|
|
15
|
+
- 修改已有 tool 的 schema 前,先确认调用方兼容性
|
|
16
|
+
- 脚本放 `scripts/`,不在 `src/` 之外创建业务 `.ts` 文件
|
|
17
|
+
|
|
18
|
+
## 3. Agent 行为准则
|
|
19
|
+
|
|
20
|
+
- **写代码后必须自己跑测试**:执行 `bun test`,读报错,自主修复,直到全绿才交付
|
|
21
|
+
- 实现新功能前,先输出分步计划并等待确认,再进入执行阶段
|
|
22
|
+
- 任务颗粒度过大时,主动拆分子任务逐步推进,不要一口气撸完然后崩溃
|
|
23
|
+
- 禁止用未验证的 `git status` 结果写入 checkpoint
|
|
24
|
+
|
|
25
|
+
## 4. Git Push 规则(重要!)
|
|
26
|
+
|
|
27
|
+
- **所有 push 只推 origin**(`trihippo/recallnest`)
|
|
28
|
+
- **绝对不要 push 到 upstream**(`CortexReach/memory-lancedb-pro`)—— 那是上游公开仓库,推了等于暴露私有改造
|
|
29
|
+
- **绝对不要 push 到 public**(`AliceLJY/recallnest`)—— 除非用户明确要求
|
|
30
|
+
- 默认 `git push` 即可(默认推 origin)
|
|
31
|
+
- 需要给上游提 PR 时,走 fork + PR 流程,不直接 push
|
|
32
|
+
|
|
33
|
+
## 5. Feature Flag
|
|
34
|
+
|
|
35
|
+
- `RECALLNEST_MULTI_VECTOR=true` — 多向量 L0/L1/L2 检索
|
|
36
|
+
- `RECALLNEST_KG_MODE=true` — KG 三元组提取 + 图遍历
|
|
37
|
+
|
|
38
|
+
## 6. 测试基线
|
|
39
|
+
|
|
40
|
+
- 改完代码必须跑 `bun test`,全量通过才能 commit
|
|
41
|
+
- 当前基线:643 tests / 0 fail
|
|
42
|
+
- 新增功能必须配套测试,基线只能涨不能降
|
package/DEMO.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# RecallNest 30-Second Demo
|
|
2
|
+
|
|
3
|
+
Use this script when you want to explain RecallNest fast on GitHub, X, Telegram, or in a live screen recording.
|
|
4
|
+
|
|
5
|
+
## Demo Goal
|
|
6
|
+
|
|
7
|
+
Show three things in one pass:
|
|
8
|
+
|
|
9
|
+
| What to prove | What the viewer should understand |
|
|
10
|
+
|------|------|
|
|
11
|
+
| Recall | old AI conversations can be found quickly |
|
|
12
|
+
| Explainability | hits are not opaque |
|
|
13
|
+
| Reusability | useful context can become a long-lived asset |
|
|
14
|
+
|
|
15
|
+
## Fast Setup
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
cd /Users/anxianjingya/recallnest
|
|
19
|
+
bun run src/ui-server.ts
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Open:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
http://localhost:4317
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Recommended Demo Query
|
|
29
|
+
|
|
30
|
+
Use:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
telegram bridge
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Reason:
|
|
37
|
+
|
|
38
|
+
| Why this query works | Result |
|
|
39
|
+
|------|------|
|
|
40
|
+
| already appears in the current dataset | likely to return hits immediately |
|
|
41
|
+
| has operational context | good for showing explainability |
|
|
42
|
+
| already has assets | good for showing reuse |
|
|
43
|
+
|
|
44
|
+
## 30-Second Talk Track
|
|
45
|
+
|
|
46
|
+
### Version A
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
This is RecallNest, a local-first memory workbench for AI conversations.
|
|
50
|
+
It turns Claude Code, Codex, Gemini, and notes into a recall layer.
|
|
51
|
+
I can search an old topic, inspect why it matched, then pin useful context back into memory so it can be recalled again later.
|
|
52
|
+
The same memory layer is exposed through MCP, so an agent can use it and I can still verify it in the UI.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Version B
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
RecallNest is not just transcript search.
|
|
59
|
+
It lets me search, explain, distill, and reuse past AI conversations.
|
|
60
|
+
The key idea is that useful hits do not disappear again: I can turn them into assets and feed them back into recall.
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Demo Click Path
|
|
64
|
+
|
|
65
|
+
| Step | UI action | What to say |
|
|
66
|
+
|------|------|------|
|
|
67
|
+
| 1 | show the loaded `telegram bridge` query | "This starts from a real transcript topic." |
|
|
68
|
+
| 2 | click `Search` | "I can recall the relevant conversation history." |
|
|
69
|
+
| 3 | click `Details` on one result | "The hit is inspectable, not a black box." |
|
|
70
|
+
| 4 | click `Pin` or `Brief` | "Useful context becomes a reusable asset." |
|
|
71
|
+
| 5 | switch to `Assets` | "Assets stay visible and can be recalled later." |
|
|
72
|
+
|
|
73
|
+
## Screenshot Rules
|
|
74
|
+
|
|
75
|
+
| Rule | Why |
|
|
76
|
+
|------|------|
|
|
77
|
+
| keep the browser crop tight | the product, not Chrome, should dominate the frame |
|
|
78
|
+
| show real hits in the result area | empty states spread poorly |
|
|
79
|
+
| keep `Trace Output` collapsed unless you are explaining it | it distracts from the main product story |
|
|
80
|
+
| prefer one strong screenshot over many average ones | easier to share and understand |
|
|
81
|
+
|
|
82
|
+
## If The UI Opens Empty
|
|
83
|
+
|
|
84
|
+
Check:
|
|
85
|
+
|
|
86
|
+
1. the server is running
|
|
87
|
+
2. the current dataset was ingested
|
|
88
|
+
3. the page has been refreshed after startup
|
|
89
|
+
|
|
90
|
+
If needed, re-run:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
bun run src/ui-server.ts
|
|
94
|
+
```
|
package/EVAL.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# RecallNest Eval Memo
|
|
2
|
+
|
|
3
|
+
This file is the operator memo for improving retrieval quality without relying on intuition.
|
|
4
|
+
|
|
5
|
+
## Why this exists
|
|
6
|
+
|
|
7
|
+
RecallNest will keep evolving with:
|
|
8
|
+
- upstream retrieval changes from `memory-lancedb-pro`
|
|
9
|
+
- local tuning for your own workflows
|
|
10
|
+
- new asset behavior (`pin`, `brief`, cleanup rules)
|
|
11
|
+
|
|
12
|
+
Without a repeatable eval, it is impossible to tell whether recall actually improved.
|
|
13
|
+
|
|
14
|
+
## Core files
|
|
15
|
+
|
|
16
|
+
| File | Purpose |
|
|
17
|
+
|------|---------|
|
|
18
|
+
| `eval/cases.json` | real-world recall cases to protect |
|
|
19
|
+
| `src/eval.ts` | eval runner |
|
|
20
|
+
| `eval/reports/` | saved baselines to compare across upgrades |
|
|
21
|
+
|
|
22
|
+
## What to evaluate
|
|
23
|
+
|
|
24
|
+
Use queries that matter in real usage:
|
|
25
|
+
- bot / bridge maintenance
|
|
26
|
+
- OpenClaw memory architecture
|
|
27
|
+
- writing style and user preference recall
|
|
28
|
+
- visual style preference recall
|
|
29
|
+
- AWS / config operations
|
|
30
|
+
|
|
31
|
+
Important:
|
|
32
|
+
- prefer the wording the operator actually types
|
|
33
|
+
- do not invent a cleaner label if the real query is messier but more common
|
|
34
|
+
- if `aws ssh` is what gets used in practice, benchmark `aws ssh`, not `aws bot config`
|
|
35
|
+
- abstract, summarized queries are valid benchmarks if that is how the operator naturally searches
|
|
36
|
+
- protect both query styles: exact operational wording and high-level conceptual wording
|
|
37
|
+
|
|
38
|
+
Each case should define:
|
|
39
|
+
- `query`
|
|
40
|
+
- `profile`
|
|
41
|
+
- optional `scope`
|
|
42
|
+
- `expectAny`
|
|
43
|
+
- `expectAll`
|
|
44
|
+
- `expectScopePrefixes`
|
|
45
|
+
- optional `forbid`
|
|
46
|
+
|
|
47
|
+
## Recommended workflow
|
|
48
|
+
|
|
49
|
+
### Before changing retrieval
|
|
50
|
+
|
|
51
|
+
Run:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
bun run src/eval.ts --output eval/reports/latest.md
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
If the change is important, also save a dated snapshot:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
bun run src/eval.ts --output eval/reports/2026-03-06-baseline.md
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### After changing retrieval
|
|
64
|
+
|
|
65
|
+
Run the same eval again and compare:
|
|
66
|
+
- pass count
|
|
67
|
+
- average score
|
|
68
|
+
- top scopes
|
|
69
|
+
- top snippet quality
|
|
70
|
+
|
|
71
|
+
## What counts as a good change
|
|
72
|
+
|
|
73
|
+
Good:
|
|
74
|
+
- relevant source scopes move up
|
|
75
|
+
- user preference memories stay stable
|
|
76
|
+
- bridge / ops / config queries become easier to recover
|
|
77
|
+
- `pin` and `brief` behave differently on purpose
|
|
78
|
+
|
|
79
|
+
Bad:
|
|
80
|
+
- asset recursion comes back
|
|
81
|
+
- old noisy `brief` objects dominate retrieval
|
|
82
|
+
- exact operational queries stop surfacing recent config changes
|
|
83
|
+
- writing/style queries drift away from user preference memories
|
|
84
|
+
|
|
85
|
+
## Maintenance note
|
|
86
|
+
|
|
87
|
+
Whenever a new recurring workflow appears, add it to `eval/cases.json`.
|
|
88
|
+
|
|
89
|
+
That turns “I hope this still works” into “I can prove it still works.”
|
package/FAILURES.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# RecallNest Failure Notebook
|
|
2
|
+
|
|
3
|
+
Use this file to record misses, weak hits, and noisy hits.
|
|
4
|
+
|
|
5
|
+
Do not rely on memory when retrieval quality changes. Add an entry, then update `eval/cases.json` if the failure should become a permanent benchmark.
|
|
6
|
+
|
|
7
|
+
## How To Use
|
|
8
|
+
|
|
9
|
+
| Step | Action |
|
|
10
|
+
|------|------|
|
|
11
|
+
| 1 | Record the exact query you ran |
|
|
12
|
+
| 2 | Note the mode, scope, and surface (`UI`, `MCP`, or `CLI`) |
|
|
13
|
+
| 3 | Write what you expected to see |
|
|
14
|
+
| 4 | Write what actually happened |
|
|
15
|
+
| 5 | Make one concrete hypothesis, not five vague ones |
|
|
16
|
+
| 6 | After a fix, record whether the issue moved into `eval/cases.json` |
|
|
17
|
+
|
|
18
|
+
## Entry Template
|
|
19
|
+
|
|
20
|
+
```md
|
|
21
|
+
## YYYY-MM-DD - short_name
|
|
22
|
+
|
|
23
|
+
| Field | Value |
|
|
24
|
+
|------|------|
|
|
25
|
+
| Query | `...` |
|
|
26
|
+
| Profile | `default / writing / debug / fact-check` |
|
|
27
|
+
| Scope | `...` |
|
|
28
|
+
| Surface | `UI / MCP / CLI` |
|
|
29
|
+
| Expected | ... |
|
|
30
|
+
| Actual | ... |
|
|
31
|
+
| Failure Type | `miss / weak hit / noisy hit / asset pollution / bad ranking` |
|
|
32
|
+
| Hypothesis | ... |
|
|
33
|
+
| Fix | ... |
|
|
34
|
+
| Eval Case Added | `yes / no` |
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Current Known Weak Spots
|
|
38
|
+
|
|
39
|
+
| Query family | Current issue | Status |
|
|
40
|
+
|------|------|------|
|
|
41
|
+
| `aws ssh` | needs to stay strong because this is the real operator wording | watch |
|
|
42
|
+
| abstract relationship queries | must keep working without exact keywords | watch |
|
|
43
|
+
| asset-heavy topics | old briefs can pollute recall if asset hygiene is ignored | mitigated, keep watching |
|
|
44
|
+
|
|
45
|
+
## Entries
|
|
46
|
+
|
|
47
|
+
## 2026-03-06 - aws_query_wording
|
|
48
|
+
|
|
49
|
+
| Field | Value |
|
|
50
|
+
|------|------|
|
|
51
|
+
| Query | `aws bot config` vs `aws ssh` |
|
|
52
|
+
| Profile | `debug` |
|
|
53
|
+
| Scope | `cc / codex / gemini / memory` |
|
|
54
|
+
| Surface | `UI` |
|
|
55
|
+
| Expected | the AWS access path should be easy to recover using the wording the operator naturally types |
|
|
56
|
+
| Actual | `aws ssh` returns stronger and more directly useful hits than `aws bot config` |
|
|
57
|
+
| Failure Type | `bad ranking` |
|
|
58
|
+
| Hypothesis | the earlier eval case used an artificial wording closer to a label than a real operator query |
|
|
59
|
+
| Fix | replace the eval case with `aws ssh` and treat operator wording as the benchmark source of truth |
|
|
60
|
+
| Eval Case Added | `yes` |
|
|
61
|
+
|
|
62
|
+
## 2026-03-06 - working_relationship_positive
|
|
63
|
+
|
|
64
|
+
| Field | Value |
|
|
65
|
+
|------|------|
|
|
66
|
+
| Query | `我们相处态度` |
|
|
67
|
+
| Profile | `default` |
|
|
68
|
+
| Scope | `cc / codex / gemini / memory` |
|
|
69
|
+
| Surface | `UI` |
|
|
70
|
+
| Expected | abstract relationship and collaboration preferences should still surface the right context |
|
|
71
|
+
| Actual | user reported the result felt right; eval later passed at `73%`, which means it works but is still weaker than exact operational queries |
|
|
72
|
+
| Failure Type | `weak hit / positive signal` |
|
|
73
|
+
| Hypothesis | semantic recall is working for summarized wording, but abstract preference queries still need stronger ranking and cleaner memory prioritization |
|
|
74
|
+
| Fix | keep this query as a protected eval case and treat it as a primary target for future retrieval tuning |
|
|
75
|
+
| Eval Case Added | `yes` |
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AliceLJY
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/OPERATIONS.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# RecallNest Operations
|
|
2
|
+
|
|
3
|
+
This file is the short operator memo for common actions.
|
|
4
|
+
|
|
5
|
+
## Open The UI
|
|
6
|
+
|
|
7
|
+
### Manual
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cd /Users/anxianjingya/recallnest
|
|
11
|
+
bun run src/ui-server.ts
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Then open:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
http://localhost:4317
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Ask Codex
|
|
21
|
+
|
|
22
|
+
Use either of these:
|
|
23
|
+
|
|
24
|
+
- `帮我启动 RecallNest UI`
|
|
25
|
+
- `帮我打开 RecallNest 记忆工作台`
|
|
26
|
+
- `帮我把 RecallNest 的本地界面跑起来`
|
|
27
|
+
|
|
28
|
+
Expected result:
|
|
29
|
+
- local UI server starts
|
|
30
|
+
- browser target is `http://localhost:4317`
|
|
31
|
+
|
|
32
|
+
## Quick Intent Phrases
|
|
33
|
+
|
|
34
|
+
### Search
|
|
35
|
+
- `帮我在 RecallNest 里搜 telegram bridge`
|
|
36
|
+
- `帮我查一下过去关于 OpenClaw memory 的记录`
|
|
37
|
+
|
|
38
|
+
### Distill
|
|
39
|
+
- `帮我把 OpenClaw 记忆系统蒸馏成 briefing`
|
|
40
|
+
|
|
41
|
+
### Brief
|
|
42
|
+
- `帮我把这个主题做成一个 brief asset`
|
|
43
|
+
|
|
44
|
+
### Assets
|
|
45
|
+
- `帮我打开 Assets 视图`
|
|
46
|
+
- `帮我看一下有哪些 memory assets`
|
|
47
|
+
|
|
48
|
+
### Cleanup
|
|
49
|
+
- `帮我检查有没有 dirty briefs`
|
|
50
|
+
- `帮我清理旧的脏 brief`
|
|
51
|
+
|
|
52
|
+
## Product Position
|
|
53
|
+
|
|
54
|
+
RecallNest should be operated primarily through:
|
|
55
|
+
|
|
56
|
+
1. MCP
|
|
57
|
+
2. UI
|
|
58
|
+
|
|
59
|
+
CLI is an implementation layer, not the main product surface.
|