@strvmarv/total-recall 0.1.0
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/plugin.json +18 -0
- package/.copilot-plugin/plugin.json +12 -0
- package/.cursor-plugin/plugin.json +13 -0
- package/.opencode/INSTALL.md +24 -0
- package/CONTRIBUTING.md +295 -0
- package/LICENSE +21 -0
- package/README.md +239 -0
- package/agents/compactor.md +47 -0
- package/dist/index.js +2554 -0
- package/eval/benchmarks/retrieval.jsonl +20 -0
- package/eval/corpus/memories.jsonl +20 -0
- package/hooks/hooks-cursor.json +16 -0
- package/hooks/hooks.json +16 -0
- package/hooks/session-end/run.sh +5 -0
- package/hooks/session-start/run.sh +11 -0
- package/package.json +78 -0
- package/skills/forget/SKILL.md +23 -0
- package/skills/ingest/SKILL.md +20 -0
- package/skills/memory/SKILL.md +60 -0
- package/skills/search/SKILL.md +19 -0
- package/skills/status/SKILL.md +32 -0
- package/src/defaults.toml +28 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{"query":"which package manager should I use","expected_content_contains":"pnpm","expected_tier":"warm"}
|
|
2
|
+
{"query":"testing strategy database mocking","expected_content_contains":"integration tests","expected_tier":"warm"}
|
|
3
|
+
{"query":"how does authentication work","expected_content_contains":"Passport","expected_tier":"warm"}
|
|
4
|
+
{"query":"deployment pipeline process","expected_content_contains":"staging","expected_tier":"warm"}
|
|
5
|
+
{"query":"test runner framework","expected_content_contains":"vitest","expected_tier":"warm"}
|
|
6
|
+
{"query":"database ORM setup","expected_content_contains":"Drizzle","expected_tier":"warm"}
|
|
7
|
+
{"query":"API error format","expected_content_contains":"RFC 7807","expected_tier":"warm"}
|
|
8
|
+
{"query":"which endpoints need auth","expected_content_contains":"/health","expected_tier":"warm"}
|
|
9
|
+
{"query":"input validation library","expected_content_contains":"zod","expected_tier":"warm"}
|
|
10
|
+
{"query":"what is redis used for","expected_content_contains":"session","expected_tier":"warm"}
|
|
11
|
+
{"query":"git branch naming convention","expected_content_contains":"feat/","expected_tier":"warm"}
|
|
12
|
+
{"query":"environment variable security","expected_content_contains":".env","expected_tier":"warm"}
|
|
13
|
+
{"query":"frontend framework","expected_content_contains":"React","expected_tier":"warm"}
|
|
14
|
+
{"query":"styling approach","expected_content_contains":"Tailwind","expected_tier":"warm"}
|
|
15
|
+
{"query":"how to run migrations","expected_content_contains":"Drizzle Kit","expected_tier":"warm"}
|
|
16
|
+
{"query":"logging format","expected_content_contains":"pino","expected_tier":"warm"}
|
|
17
|
+
{"query":"file upload architecture","expected_content_contains":"S3","expected_tier":"warm"}
|
|
18
|
+
{"query":"background job queue","expected_content_contains":"BullMQ","expected_tier":"warm"}
|
|
19
|
+
{"query":"realtime communication","expected_content_contains":"socket.io","expected_tier":"warm"}
|
|
20
|
+
{"query":"user communication preferences","expected_content_contains":"terse","expected_tier":"warm"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{"content":"User prefers pnpm over npm for package management","type":"correction","tags":["tooling","packages"]}
|
|
2
|
+
{"content":"Always use integration tests with real databases, never mock the data layer","type":"preference","tags":["testing","databases"]}
|
|
3
|
+
{"content":"Auth system uses Passport.js with JWT tokens","type":"decision","tags":["auth","architecture"]}
|
|
4
|
+
{"content":"Deploy to staging first via GitHub Actions, production requires manual approval","type":"preference","tags":["deployment","ci"]}
|
|
5
|
+
{"content":"Use vitest as the test runner, not jest","type":"correction","tags":["testing","tooling"]}
|
|
6
|
+
{"content":"Project uses PostgreSQL with Drizzle ORM","type":"decision","tags":["database","orm"]}
|
|
7
|
+
{"content":"Error responses should use RFC 7807 Problem Details format","type":"preference","tags":["api","errors"]}
|
|
8
|
+
{"content":"All API endpoints require authentication except /health and /docs","type":"decision","tags":["api","auth"]}
|
|
9
|
+
{"content":"Use zod for runtime schema validation at API boundaries","type":"preference","tags":["validation","api"]}
|
|
10
|
+
{"content":"Redis is used for session storage and rate limiting only","type":"decision","tags":["redis","architecture"]}
|
|
11
|
+
{"content":"Feature branches should be named feat/TICKET-description","type":"preference","tags":["git","workflow"]}
|
|
12
|
+
{"content":"Never commit .env files, use .env.example as template","type":"correction","tags":["security","git"]}
|
|
13
|
+
{"content":"The frontend uses React with TanStack Router","type":"decision","tags":["frontend","react"]}
|
|
14
|
+
{"content":"CSS uses Tailwind with the project's custom design tokens","type":"decision","tags":["frontend","css"]}
|
|
15
|
+
{"content":"All database migrations go through Drizzle Kit","type":"preference","tags":["database","migrations"]}
|
|
16
|
+
{"content":"Logging uses structured JSON via pino","type":"decision","tags":["logging","observability"]}
|
|
17
|
+
{"content":"User prefers terse responses without trailing summaries","type":"preference","tags":["communication"]}
|
|
18
|
+
{"content":"WebSocket connections use socket.io with Redis adapter for scaling","type":"decision","tags":["websockets","architecture"]}
|
|
19
|
+
{"content":"File uploads go to S3 with presigned URLs, never through the API server","type":"decision","tags":["files","architecture"]}
|
|
20
|
+
{"content":"Cron jobs are managed by BullMQ with Redis backend","type":"decision","tags":["jobs","architecture"]}
|
package/hooks/hooks.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# total-recall SessionStart hook
|
|
3
|
+
# Injects the core memory skill into the session
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
|
+
PLUGIN_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
7
|
+
SKILL_FILE="$PLUGIN_ROOT/skills/memory/SKILL.md"
|
|
8
|
+
|
|
9
|
+
if [ -f "$SKILL_FILE" ]; then
|
|
10
|
+
cat "$SKILL_FILE"
|
|
11
|
+
fi
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@strvmarv/total-recall",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Multi-tiered memory and knowledge base plugin for TUI coding assistants",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"total-recall": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsup",
|
|
12
|
+
"dev": "tsup --watch",
|
|
13
|
+
"test": "vitest run",
|
|
14
|
+
"test:watch": "vitest",
|
|
15
|
+
"typecheck": "tsc --noEmit",
|
|
16
|
+
"prepublishOnly": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist/",
|
|
20
|
+
"skills/",
|
|
21
|
+
"agents/",
|
|
22
|
+
"hooks/",
|
|
23
|
+
"eval/",
|
|
24
|
+
"src/defaults.toml",
|
|
25
|
+
".claude-plugin/",
|
|
26
|
+
".copilot-plugin/",
|
|
27
|
+
".cursor-plugin/",
|
|
28
|
+
".opencode/",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE",
|
|
31
|
+
"CONTRIBUTING.md"
|
|
32
|
+
],
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/strvmarv/total-recall.git"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/strvmarv/total-recall",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/strvmarv/total-recall/issues"
|
|
43
|
+
},
|
|
44
|
+
"author": "strvmarv",
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"keywords": [
|
|
47
|
+
"mcp",
|
|
48
|
+
"memory",
|
|
49
|
+
"knowledge-base",
|
|
50
|
+
"claude-code",
|
|
51
|
+
"copilot-cli",
|
|
52
|
+
"opencode",
|
|
53
|
+
"cline",
|
|
54
|
+
"cursor",
|
|
55
|
+
"sqlite",
|
|
56
|
+
"vector-search",
|
|
57
|
+
"embeddings",
|
|
58
|
+
"ai-coding",
|
|
59
|
+
"tui"
|
|
60
|
+
],
|
|
61
|
+
"engines": {
|
|
62
|
+
"node": ">=20.0.0"
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@iarna/toml": "^2.2.5",
|
|
66
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
67
|
+
"better-sqlite3": "^11.0.0",
|
|
68
|
+
"onnxruntime-node": "^1.20.0",
|
|
69
|
+
"sqlite-vec": "^0.1.0"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@types/better-sqlite3": "^7.6.0",
|
|
73
|
+
"@types/node": "^22.0.0",
|
|
74
|
+
"tsup": "^8.0.0",
|
|
75
|
+
"typescript": "^5.0.0",
|
|
76
|
+
"vitest": "^2.0.0"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: forget
|
|
3
|
+
description: Use when user says "/memory forget", "remove that memory", "delete memory about", or asks to remove specific entries from total-recall.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory Deletion
|
|
7
|
+
|
|
8
|
+
User-controlled deletion with transparency and confirmation.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
1. Call `memory_search` with the user's query to find matching entries
|
|
13
|
+
2. Present matches with: ID, content preview, tier, source, access count
|
|
14
|
+
3. If source is from a host tool import, note that the original file is NOT touched
|
|
15
|
+
4. Ask user which entries to delete (by number or "all")
|
|
16
|
+
5. Call `memory_delete` for each selected entry with a reason
|
|
17
|
+
6. Confirm deletion
|
|
18
|
+
|
|
19
|
+
## Safety
|
|
20
|
+
|
|
21
|
+
- Never auto-delete without user confirmation
|
|
22
|
+
- Never modify host tool source files
|
|
23
|
+
- Always log the deletion reason
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ingest
|
|
3
|
+
description: Use when user says "/memory ingest", "add to knowledge base", "ingest these docs", or asks to import files or directories into total-recall.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Knowledge Base Ingestion
|
|
7
|
+
|
|
8
|
+
Add files or directories to the knowledge base for semantic retrieval.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
1. Determine if the path is a file or directory
|
|
13
|
+
2. For files: call `kb_ingest_file` with the path
|
|
14
|
+
3. For directories: call `kb_ingest_dir` with the path
|
|
15
|
+
4. Report: collection name, document count, chunk count, validation results
|
|
16
|
+
5. Suggest a test query to verify ingestion worked
|
|
17
|
+
|
|
18
|
+
## Supported Formats
|
|
19
|
+
|
|
20
|
+
Markdown, TypeScript, JavaScript, Python, Go, Rust, JSON, YAML, plain text. Code files are split on function/class boundaries. Markdown is split on headings.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory
|
|
3
|
+
description: Use at every session start to enable automatic memory capture, retrieval, and context injection. Triggers on SessionStart, detects corrections and preferences during conversation, queries warm tier on user messages, and compacts at session end.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Automatic Memory Management
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
This skill governs total-recall's always-on memory behavior. It runs silently, capturing corrections, preferences, and decisions into the hot tier, retrieving relevant warm memories per query, and compacting at session end.
|
|
11
|
+
|
|
12
|
+
## At Session Start
|
|
13
|
+
|
|
14
|
+
1. Call the `session_start` MCP tool. It will:
|
|
15
|
+
- Sync any new imports from detected host tools
|
|
16
|
+
- Assemble the hot tier (carry-forwards + relevant warm memories + pinned knowledge)
|
|
17
|
+
- Return injectable context
|
|
18
|
+
|
|
19
|
+
2. Silently incorporate the returned context into your working memory. Do not announce what was loaded unless the user asks.
|
|
20
|
+
|
|
21
|
+
## During Conversation
|
|
22
|
+
|
|
23
|
+
### Capture (automatic, silent)
|
|
24
|
+
|
|
25
|
+
When you detect any of these patterns in the user's message, call `memory_store`:
|
|
26
|
+
|
|
27
|
+
- **Correction**: User says "no", "not that", "actually", "use X instead" -> store with type "correction"
|
|
28
|
+
- **Preference**: User expresses how they want things done -> store with type "preference"
|
|
29
|
+
- **Decision**: A non-obvious architectural or design choice is made -> store with type "decision"
|
|
30
|
+
|
|
31
|
+
Do NOT announce that you stored a memory. Do NOT ask permission. Just store it.
|
|
32
|
+
|
|
33
|
+
### Retrieve (automatic, silent)
|
|
34
|
+
|
|
35
|
+
On each user message, if the message is a question or task request:
|
|
36
|
+
|
|
37
|
+
1. Call `memory_search` with the user's message as query, searching warm tier, scoped to the current project
|
|
38
|
+
2. If warm results are insufficient (top score < 0.5), also search cold/knowledge tier
|
|
39
|
+
3. Use retrieved context to inform your response
|
|
40
|
+
4. Do NOT announce what you retrieved unless the user asks "what do you remember about X"
|
|
41
|
+
|
|
42
|
+
### When User Asks About Memory
|
|
43
|
+
|
|
44
|
+
If the user asks "what do you know about...", "what do you remember...", or "show me memories about...":
|
|
45
|
+
- Call `memory_search` explicitly with their query
|
|
46
|
+
- Present results transparently with tier, score, and source
|
|
47
|
+
|
|
48
|
+
## At Session End
|
|
49
|
+
|
|
50
|
+
Call `session_end` MCP tool. It will:
|
|
51
|
+
- Run hot tier compaction (decay-scored promotion/discard)
|
|
52
|
+
- Log compaction events
|
|
53
|
+
- Update retrieval event outcomes
|
|
54
|
+
|
|
55
|
+
## Key Rules
|
|
56
|
+
|
|
57
|
+
- NEVER announce memory operations unless asked
|
|
58
|
+
- ALWAYS store corrections -- they are the highest-value memories
|
|
59
|
+
- ALWAYS search warm tier before answering questions about the project
|
|
60
|
+
- NEVER modify the user's host tool memory files (Claude Code memory/, CLAUDE.md, etc.)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: search
|
|
3
|
+
description: Use when user says "/memory search", "search my memory", "what do I know about", "find in knowledge base", or asks to look up something in their stored context.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory Search
|
|
7
|
+
|
|
8
|
+
Explicit user-initiated search across all tiers and content types.
|
|
9
|
+
|
|
10
|
+
## Process
|
|
11
|
+
|
|
12
|
+
1. Call `memory_search` with the user's query, all tiers enabled, top_k=10
|
|
13
|
+
2. Format results grouped by tier, then by content type
|
|
14
|
+
3. Show: content preview (first 100 chars), similarity score, source, tags
|
|
15
|
+
4. Offer actions: "/memory promote <id>" or "/memory forget <id>"
|
|
16
|
+
|
|
17
|
+
## Output Format
|
|
18
|
+
|
|
19
|
+
Group results by tier (hot first, then warm, then cold). Show scores rounded to 2 decimal places. Include source attribution for imported entries.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: status
|
|
3
|
+
description: Use when user says "/memory status", "/memory eval", "how is memory performing", "show memory dashboard", or asks about total-recall health or metrics.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Memory Status & Evaluation
|
|
7
|
+
|
|
8
|
+
Show the TUI dashboard or detailed evaluation metrics.
|
|
9
|
+
|
|
10
|
+
## For /memory status
|
|
11
|
+
|
|
12
|
+
Call the `status` MCP tool and format the response as a dashboard showing:
|
|
13
|
+
- Tier sizes (hot/warm/cold with counts)
|
|
14
|
+
- Knowledge base stats (collections, documents, chunks)
|
|
15
|
+
- DB size and embedding model info
|
|
16
|
+
- Session activity summary
|
|
17
|
+
|
|
18
|
+
## For /memory eval
|
|
19
|
+
|
|
20
|
+
Call `eval_report` for live metrics. Show:
|
|
21
|
+
- Precision@3, hit rate, miss rate, MRR (7-day rolling)
|
|
22
|
+
- Breakdown by tier and content type
|
|
23
|
+
- Top misses and false positives
|
|
24
|
+
- Compaction health
|
|
25
|
+
|
|
26
|
+
## For /memory eval --benchmark
|
|
27
|
+
|
|
28
|
+
Call `eval_benchmark`. Show synthetic benchmark results with pass/fail thresholds.
|
|
29
|
+
|
|
30
|
+
## For /memory eval --compare <name>
|
|
31
|
+
|
|
32
|
+
Call `eval_report` with the named config snapshot for comparison. Show side-by-side metrics with deltas and trend arrows.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# total-recall default configuration
|
|
2
|
+
# Copy to ~/.total-recall/config.toml to override
|
|
3
|
+
|
|
4
|
+
[tiers.hot]
|
|
5
|
+
max_entries = 50
|
|
6
|
+
token_budget = 4000
|
|
7
|
+
carry_forward_threshold = 0.7
|
|
8
|
+
|
|
9
|
+
[tiers.warm]
|
|
10
|
+
max_entries = 10000
|
|
11
|
+
retrieval_top_k = 5
|
|
12
|
+
similarity_threshold = 0.65
|
|
13
|
+
cold_decay_days = 30
|
|
14
|
+
|
|
15
|
+
[tiers.cold]
|
|
16
|
+
chunk_max_tokens = 512
|
|
17
|
+
chunk_overlap_tokens = 50
|
|
18
|
+
lazy_summary_threshold = 5
|
|
19
|
+
|
|
20
|
+
[compaction]
|
|
21
|
+
decay_half_life_hours = 168
|
|
22
|
+
warm_threshold = 0.3
|
|
23
|
+
promote_threshold = 0.7
|
|
24
|
+
warm_sweep_interval_days = 7
|
|
25
|
+
|
|
26
|
+
[embedding]
|
|
27
|
+
model = "all-MiniLM-L6-v2"
|
|
28
|
+
dimensions = 384
|