tr-plugin-embeddings 0.1.0 → 0.2.5

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/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "tr-plugin-embeddings",
3
- "version": "0.1.0",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "description": "Local embedding model management: provider/model status, benchmark, index build and coverage",
6
6
  "scripts": {
7
- "test": "node --test test/*.test.mjs"
7
+ "test": "node --test test/*.test.mjs",
8
+ "ssss": "ssss"
8
9
  },
9
10
  "devDependencies": {
10
- "total-recall-brain": "3.40.3"
11
+ "total-recall-brain": "3.52.20"
11
12
  },
12
13
  "license": "MIT",
13
14
  "files": [
@@ -15,6 +16,14 @@
15
16
  "plugin.json",
16
17
  "README.md",
17
18
  "LICENSE",
18
- "ui/"
19
- ]
19
+ "DESIGN.md",
20
+ "ui/",
21
+ "skills/"
22
+ ],
23
+ "dependencies": {
24
+ "@gregiteen/ssss-cli": "0.14.8"
25
+ },
26
+ "overrides": {
27
+ "@ssss/cli": "npm:@gregiteen/ssss-cli@0.14.8"
28
+ }
20
29
  }
package/plugin.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://github.com/gregiteen/total-recall/blob/main/metadata.plugin.schema.json",
3
3
  "id": "embeddings",
4
4
  "name": "Embeddings",
5
- "version": "0.1.0",
5
+ "version": "0.2.5",
6
6
  "description": "Local embedding model management: provider/model status, benchmark, index build and coverage",
7
7
  "license": "MIT",
8
8
  "branding": {
@@ -15,7 +15,15 @@
15
15
  "operations",
16
16
  "ai"
17
17
  ],
18
+ "gate": {
19
+ "tasks": [
20
+ "Check embedding models and index coverage",
21
+ "Pull or benchmark a local embedding model"
22
+ ],
23
+ "owned_commands": []
24
+ },
18
25
  "cli": {
26
+ "answers_help": true,
19
27
  "command": "embeddings",
20
28
  "handler": "./cli.mjs",
21
29
  "subcommands": [
@@ -33,30 +41,63 @@
33
41
  },
34
42
  {
35
43
  "name": "pull",
36
- "description": "Pull an embedding model (default nomic-embed-text)",
44
+ "description": "Pull an explicitly named local model onto the configured loopback endpoint",
37
45
  "effect": "write",
38
- "output": "json"
46
+ "output": "json",
47
+ "timeout_ms": 600000
39
48
  },
40
49
  {
41
50
  "name": "benchmark",
42
- "description": "Measure ms per embedding and project full-vault time",
51
+ "description": "Measure latency per verified local embedding and project full-vault time",
43
52
  "effect": "read",
44
- "output": "json"
53
+ "output": "json",
54
+ "timeout_ms": 300000
45
55
  },
46
56
  {
47
57
  "name": "coverage",
48
- "description": "How much of the vault has vectors, and which model produced them",
58
+ "description": "How many vault nodes have a current, correct-width vector, and why the rest do not",
49
59
  "effect": "read",
50
60
  "output": "json"
51
61
  }
52
62
  ]
53
63
  },
54
- "card": {
55
- "handler": "./ui/card.js",
56
- "element": "tr-embeddings-card"
64
+ "ui": {
65
+ "home": "home",
66
+ "design_tokens": "DESIGN.md",
67
+ "elements": [
68
+ {
69
+ "id": "home",
70
+ "kind": "panel",
71
+ "tag": "tr-embeddings-home",
72
+ "module": "ui/home.js",
73
+ "description": "Embeddings page: provider and locality, vault coverage, model roster, credentials ownership, benchmark and pull"
74
+ }
75
+ ]
76
+ },
77
+ "auth": {
78
+ "plugin": "auth",
79
+ "methods": [
80
+ "passkey",
81
+ "google-oauth2"
82
+ ],
83
+ "session_verification": true
57
84
  },
58
85
  "status": {
59
86
  "command": "status",
60
87
  "refresh_seconds": 60
61
- }
88
+ },
89
+ "reuse": {
90
+ "commands": [
91
+ "total-recall auth secret",
92
+ "total-recall ssss status"
93
+ ],
94
+ "owned": "Local embedding provider/model status, Ollama model pulls, latency benchmarks, and vault vector coverage."
95
+ },
96
+ "skills": [
97
+ {
98
+ "id": "embeddings",
99
+ "path": "./skills/embeddings/SKILL.md",
100
+ "description": "Local embedding model management: provider/model status, benchmark, index build and coverage"
101
+ }
102
+ ]
62
103
  }
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: embeddings
3
+ description: "Local embedding model management: provider/model status, benchmark, index build and coverage"
4
+ version: 0.2.5
5
+ repo_scoped: false
6
+ ---
7
+
8
+ # Embeddings
9
+
10
+ Local embedding model management: provider/model status, benchmark, index build and coverage
11
+
12
+ ## When to Use
13
+
14
+ Use the `embeddings` Total Recall plugin (`total-recall embeddings`) instead of ad-hoc scripts or raw commands whenever working on embeddings tasks.
15
+
16
+ ## Commands
17
+
18
+ ```bash
19
+ total-recall embeddings --help
20
+ total-recall embeddings status # Provider, model, locality and vault coverage in one view
21
+ total-recall embeddings models # List models on the endpoint and which can produce embeddings
22
+ total-recall embeddings pull # Pull an explicitly named local model onto the configured loopback endpoint
23
+ total-recall embeddings benchmark # Measure latency per verified local embedding and project full-vault time
24
+ total-recall embeddings coverage # How many vault nodes have a current, correct-width vector, and why the rest do not
25
+ ```
@@ -0,0 +1,49 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: embeddings
4
+ id: benchmark
5
+ title: Embedding benchmark
6
+ description: Measures milliseconds per embedding for the selected local model using a neutral sentence, verifies each vector is 768 wide, and projects the time to embed the whole vault.
7
+ timestamp: '2026-11-08T08:12:00Z'
8
+ intents:
9
+ - benchmark embedding speed
10
+ - estimate time to embed the vault
11
+ surfaces:
12
+ - page
13
+ operations:
14
+ - benchmark
15
+ data:
16
+ - benchmark:/ok
17
+ - benchmark:/reason
18
+ - benchmark:/url
19
+ - benchmark:/locality
20
+ - benchmark:/model
21
+ - benchmark:/dims
22
+ - benchmark:/samples
23
+ - benchmark:/ms_per_embedding
24
+ - benchmark:/min_ms
25
+ - benchmark:/max_ms
26
+ - benchmark:/vault_nodes
27
+ - benchmark:/projected_minutes
28
+ - benchmark:/completed
29
+ panel: home
30
+ ---
31
+ <style>
32
+ .emb-benchmark { color: var(--colors-text, #ecfeff); background: var(--colors-surface, #0e2a35); border: 1px solid var(--colors-line, #164e63); border-radius: var(--rounded-md, 6px); padding: var(--spacing-md, 12px); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 13px; }
33
+ .emb-benchmark h3 { margin: 0 0 var(--spacing-sm, 8px); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--colors-muted, #67e8f9); }
34
+ .emb-benchmark dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--spacing-xs, 4px) var(--spacing-md, 12px); margin: 0; }
35
+ .emb-benchmark dt { color: var(--colors-muted, #67e8f9); }
36
+ .emb-benchmark dd { margin: 0; }
37
+ .emb-benchmark code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; }
38
+ .emb-benchmark p { margin: var(--spacing-sm, 8px) 0 0; color: var(--colors-muted, #67e8f9); }
39
+ </style>
40
+ <section class="emb-benchmark" data-design-component="section">
41
+ <h3>Embedding benchmark</h3>
42
+ <dl>
43
+ <dt>Reports</dt><dd>Average, minimum and maximum milliseconds per embedding, the sample count, and the model and endpoint measured.</dd>
44
+ <dt>Projection</dt><dd>Average time multiplied by the vault node count, in minutes.</dd>
45
+ <dt>Bounds</dt><dd>1 to 20 samples (default 10), within a 280-second deadline.</dd>
46
+ <dt>Refuses</dt><dd>A remote, upstream or missing model. No vault text is sent.</dd>
47
+ </dl>
48
+ <p>Run it from the Embeddings page. It never runs on its own.</p>
49
+ </section>
@@ -0,0 +1,53 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: embeddings
4
+ id: coverage
5
+ title: Vault vector coverage
6
+ description: How many vault nodes have a current, correct-width vector in the index, and why the rest are not usable. Reads the index without modifying it.
7
+ timestamp: '2026-11-08T08:12:00Z'
8
+ intents:
9
+ - check vault vector coverage
10
+ - find stale or missing embeddings
11
+ surfaces:
12
+ - page
13
+ operations:
14
+ - coverage
15
+ data:
16
+ - coverage:/ok
17
+ - coverage:/brain
18
+ - coverage:/state
19
+ - coverage:/reason
20
+ - coverage:/vault_nodes
21
+ - coverage:/parse_errors
22
+ - coverage:/rows
23
+ - coverage:/embedded
24
+ - coverage:/stale
25
+ - coverage:/mismatched
26
+ - coverage:/orphaned
27
+ - coverage:/missing
28
+ - coverage:/percent
29
+ - coverage:/model
30
+ - coverage:/models
31
+ - coverage:/db_bytes
32
+ panel: home
33
+ ---
34
+ <style>
35
+ .emb-coverage { color: var(--colors-text, #ecfeff); background: var(--colors-surface, #0e2a35); border: 1px solid var(--colors-line, #164e63); border-radius: var(--rounded-md, 6px); padding: var(--spacing-md, 12px); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 13px; }
36
+ .emb-coverage h3 { margin: 0 0 var(--spacing-sm, 8px); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--colors-muted, #67e8f9); }
37
+ .emb-coverage ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--spacing-xs, 4px); }
38
+ .emb-coverage li { display: flex; justify-content: space-between; gap: var(--spacing-md, 12px); font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; color: var(--colors-muted, #67e8f9); }
39
+ .emb-coverage li span:first-child { color: var(--colors-text, #ecfeff); }
40
+ .emb-coverage code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; }
41
+ .emb-coverage p { margin: var(--spacing-sm, 8px) 0 0; color: var(--colors-muted, #67e8f9); }
42
+ </style>
43
+ <section class="emb-coverage" data-design-component="section">
44
+ <h3>Vault vector coverage</h3>
45
+ <ul>
46
+ <li data-design-component="count-row"><span>usable</span><span>current text hash, 768 finite numbers</span></li>
47
+ <li data-design-component="count-row"><span>stale</span><span>the node changed after it was embedded</span></li>
48
+ <li data-design-component="count-row"><span>wrong width</span><span>the vector is not 768 numbers</span></li>
49
+ <li data-design-component="count-row"><span>missing</span><span>the node has no row</span></li>
50
+ <li data-design-component="count-row"><span>orphaned</span><span>the row has no active node</span></li>
51
+ </ul>
52
+ <p>The percentage counts usable vectors out of all <code>memory</code> and <code>plugin_record</code> nodes. A missing or unreadable index is reported by its state, not as 0%. Rebuild with <code>total-recall compile</code>.</p>
53
+ </section>
@@ -0,0 +1,43 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: embeddings
4
+ id: models
5
+ title: Embedding models
6
+ description: Every model on the resolved Ollama endpoint, with its declared embedding capability, vector width, vault compatibility, upstream flag and which one is selected.
7
+ timestamp: '2026-11-08T08:12:00Z'
8
+ intents:
9
+ - list embedding models
10
+ - see which model can embed the vault
11
+ surfaces:
12
+ - page
13
+ operations:
14
+ - models
15
+ data:
16
+ - models:/url
17
+ - models:/reachable
18
+ - models:/locality
19
+ - models:/vault_dims
20
+ - models:/selected
21
+ - models:/models
22
+ - models:/attempts
23
+ panel: home
24
+ ---
25
+ <style>
26
+ .emb-models { color: var(--colors-text, #ecfeff); background: var(--colors-surface, #0e2a35); border: 1px solid var(--colors-line, #164e63); border-radius: var(--rounded-md, 6px); padding: var(--spacing-md, 12px); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 13px; }
27
+ .emb-models h3 { margin: 0 0 var(--spacing-sm, 8px); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--colors-muted, #67e8f9); }
28
+ .emb-models ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--spacing-xs, 4px); }
29
+ .emb-models li { background: var(--colors-background, #07171d); border: 1px solid var(--colors-line, #164e63); border-radius: var(--rounded-sm, 4px); padding: var(--spacing-sm, 8px); }
30
+ .emb-models code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; }
31
+ .emb-models .ok { color: var(--colors-ok, #10b981); }
32
+ .emb-models .warn { color: var(--colors-warn, #f59e0b); }
33
+ .emb-models p { margin: var(--spacing-sm, 8px) 0 0; color: var(--colors-muted, #67e8f9); }
34
+ </style>
35
+ <section class="emb-models" data-design-component="section">
36
+ <h3>Embedding models</h3>
37
+ <ul>
38
+ <li data-design-component="model-row"><span class="ok">vault-compatible</span>: the model declares the <code>embedding</code> capability, and its family width is 768.</li>
39
+ <li data-design-component="model-row"><span class="ok">selected</span>: the pinned <code>TR_OLLAMA_EMBED_MODEL</code> when compatible, otherwise the smallest compatible model.</li>
40
+ <li data-design-component="model-row"><span class="warn">upstream</span>: the service relays the model from another machine, so it does not count as local.</li>
41
+ </ul>
42
+ <p>When no endpoint answers, the endpoints tried are reported instead of a model list. The Embeddings page shows the live roster.</p>
43
+ </section>
@@ -0,0 +1,41 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: embeddings
4
+ id: pull
5
+ title: Pull an embedding model
6
+ description: Downloads an explicitly named local model onto the configured loopback Ollama endpoint. Refuses non-loopback endpoints and cloud or upstream models.
7
+ timestamp: '2026-11-08T08:12:00Z'
8
+ intents:
9
+ - install a local embedding model
10
+ - pull an embedding model
11
+ surfaces:
12
+ - page
13
+ operations:
14
+ - pull
15
+ data:
16
+ - pull:/ok
17
+ - pull:/model
18
+ - pull:/url
19
+ - pull:/locality
20
+ - pull:/reason
21
+ - pull:/status
22
+ panel: home
23
+ ---
24
+ <style>
25
+ .emb-pull { color: var(--colors-text, #ecfeff); background: var(--colors-surface, #0e2a35); border: 1px solid var(--colors-line, #164e63); border-radius: var(--rounded-md, 6px); padding: var(--spacing-md, 12px); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 13px; }
26
+ .emb-pull h3 { margin: 0 0 var(--spacing-sm, 8px); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--colors-muted, #67e8f9); }
27
+ .emb-pull ol { margin: 0; padding-left: 1.25em; display: grid; gap: var(--spacing-xs, 4px); }
28
+ .emb-pull code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; }
29
+ .emb-pull .warn { color: var(--colors-warn, #f59e0b); }
30
+ .emb-pull p { margin: var(--spacing-sm, 8px) 0 0; color: var(--colors-muted, #67e8f9); }
31
+ </style>
32
+ <section class="emb-pull" data-design-component="section">
33
+ <h3>Pull an embedding model</h3>
34
+ <ol>
35
+ <li>Name the model exactly. Nothing is pulled by default.</li>
36
+ <li>The target is <code>TR_OLLAMA_URL</code>, <code>OLLAMA_HOST</code> or <code>127.0.0.1:11434</code>, and it must be loopback.</li>
37
+ <li><span class="warn">Refused:</span> models that are cloud-hosted or relayed from another machine.</li>
38
+ <li>The download may take up to ten minutes. The result names the model and endpoint, or the reason for failure.</li>
39
+ </ol>
40
+ <p>This changes the endpoint's model store. Start it from the Embeddings page.</p>
41
+ </section>
@@ -0,0 +1,59 @@
1
+ ---
2
+ type: ui-chunk:chunk
3
+ plugin: embeddings
4
+ id: status
5
+ title: Embedding provider status
6
+ description: Which provider and model serve vectors for this brain, whether text sent for embedding stays on this machine, and how much of the vault has a usable vector.
7
+ timestamp: '2026-11-08T08:12:00Z'
8
+ intents:
9
+ - check which embedding model is active
10
+ - check whether embeddings run locally
11
+ - check vault vector coverage
12
+ surfaces:
13
+ - page
14
+ operations:
15
+ - status
16
+ data:
17
+ - status:/provider
18
+ - status:/endpoint
19
+ - status:/locality
20
+ - status:/local
21
+ - status:/selected_model
22
+ - status:/embedding_dims
23
+ - status:/hosted_fallback
24
+ - status:/reason
25
+ - status:/attempts
26
+ - status:/brain/state
27
+ - status:/brain/reason
28
+ - status:/brain/vault_nodes
29
+ - status:/brain/embedded
30
+ - status:/brain/percent
31
+ - status:/brain/stale
32
+ - status:/brain/mismatched
33
+ - status:/brain/missing
34
+ - status:/brain/orphaned
35
+ - status:/brain/model
36
+ panel: home
37
+ ---
38
+ <style>
39
+ .emb-status { color: var(--colors-text, #ecfeff); background: var(--colors-surface, #0e2a35); border: 1px solid var(--colors-line, #164e63); border-radius: var(--rounded-md, 6px); padding: var(--spacing-md, 12px); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 13px; }
40
+ .emb-status h3 { margin: 0 0 var(--spacing-sm, 8px); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--colors-muted, #67e8f9); }
41
+ .emb-status dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--spacing-xs, 4px) var(--spacing-md, 12px); margin: 0; }
42
+ .emb-status dt { color: var(--colors-muted, #67e8f9); }
43
+ .emb-status dd { margin: 0; }
44
+ .emb-status code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 12px; }
45
+ .emb-status .local { color: var(--colors-ok, #10b981); }
46
+ .emb-status .away { color: var(--colors-warn, #f59e0b); }
47
+ .emb-status p { margin: var(--spacing-sm, 8px) 0 0; color: var(--colors-muted, #67e8f9); }
48
+ </style>
49
+ <section class="emb-status" data-design-component="section">
50
+ <h3>Embedding provider status</h3>
51
+ <dl>
52
+ <dt>Provider</dt><dd><code>ollama</code> or <code>hosted-fallback</code></dd>
53
+ <dt>Locality</dt><dd><span class="local" data-design-component="locality-chip">local</span> only when a loopback endpoint serves a non-upstream model. Otherwise <span class="away">remote</span> or <span class="away">unknown</span>.</dd>
54
+ <dt>Model</dt><dd>The selected model and its vector width. The vault requires 768 dimensions.</dd>
55
+ <dt>Coverage</dt><dd>Usable vectors out of vault nodes, with stale, wrong-width, missing and orphaned counts.</dd>
56
+ <dt>Credentials</dt><dd>Hosted fallback keys stay with the Auth owner and are reported as <code>unknown</code>, never read here.</dd>
57
+ </dl>
58
+ <p>Open the Embeddings page for the live reading, the endpoints that were tried, and refresh.</p>
59
+ </section>