pi-vault-mind 0.7.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/LICENSE +21 -0
- package/README.md +428 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/src/commands.d.ts +9 -0
- package/dist/src/commands.js +813 -0
- package/dist/src/events.d.ts +13 -0
- package/dist/src/events.js +236 -0
- package/dist/src/graph.d.ts +3 -0
- package/dist/src/graph.js +234 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +61 -0
- package/dist/src/lance.d.ts +40 -0
- package/dist/src/lance.js +409 -0
- package/dist/src/server.d.ts +25 -0
- package/dist/src/server.js +180 -0
- package/dist/src/settings-ui.d.ts +9 -0
- package/dist/src/settings-ui.js +313 -0
- package/dist/src/state.d.ts +2 -0
- package/dist/src/state.js +16 -0
- package/dist/src/tools.d.ts +2 -0
- package/dist/src/tools.js +772 -0
- package/dist/src/types.d.ts +103 -0
- package/dist/src/types.js +51 -0
- package/dist/src/utils.d.ts +17 -0
- package/dist/src/utils.js +102 -0
- package/dist/src/vault-writer.d.ts +17 -0
- package/dist/src/vault-writer.js +141 -0
- package/dist/src/watcher.d.ts +91 -0
- package/dist/src/watcher.js +411 -0
- package/dist/src/widget.d.ts +3 -0
- package/dist/src/widget.js +12 -0
- package/dist/test/index.test.d.ts +1 -0
- package/dist/test/index.test.js +368 -0
- package/package.json +83 -0
- package/skills/vault-mind/SKILL.md +260 -0
- package/skills/vault-mind/references/tool-reference.md +53 -0
- package/skills/vault-mind-broadcaster/SKILL.md +112 -0
- package/skills/vault-mind-heavy-lifter/SKILL.md +34 -0
- package/skills/vault-mind-manager/SKILL.md +35 -0
- package/skills/vault-mind-miner/SKILL.md +40 -0
- package/skills/vault-mind-setup/SKILL.md +385 -0
- package/skills/vault-mind-setup/references/obsidian-cli-and-plugins.md +269 -0
- package/skills/vault-mind-setup/references/obsidian-vault-structure.md +106 -0
- package/skills/vault-mind-setup/references/pi-extension-wiring.md +236 -0
- package/skills/vault-mind-setup/references/troubleshooting-tree.md +147 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vault-mind
|
|
3
|
+
description: Universal append-only JSONL collection with LanceDB semantic search, full-text search, graph relationships, and tiered HITL (strict, gated, autopilot). Use when tracking structured facts, decisions, requirements, research, or any append-only record across projects. Supports dynamic context injection into prompts. Install the pi-vault-mind extension first.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# pi-vault-mind
|
|
7
|
+
|
|
8
|
+
Universal append-only JSONL collection with local LanceDB semantic search, graph relationships, and dynamic context injection.
|
|
9
|
+
|
|
10
|
+
## When to use this skill
|
|
11
|
+
|
|
12
|
+
- Tracking research findings or verified facts with citations
|
|
13
|
+
- Building a decision log with rationale and traceability
|
|
14
|
+
- Maintaining a requirements registry
|
|
15
|
+
- Any domain where you need append-only structured records with HITL review
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
1. **Embedding provider** — choose one:
|
|
20
|
+
- `@xenova/transformers` — built-in, offline-capable (all-MiniLM-L6-v2, 384 dims)
|
|
21
|
+
- `ollama` — requires Ollama running locally with `embeddinggemma` (768 dims)
|
|
22
|
+
|
|
23
|
+
2. **pi-vault-mind extension** must be installed:
|
|
24
|
+
```bash
|
|
25
|
+
pi install npm:pi-vault-mind
|
|
26
|
+
pi -e npm:pi-vault-mind # try without installing
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
Run `/wiki init` in your project root. This scaffolds:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
pi-vault-mind.config.json ← config
|
|
35
|
+
.lancedb/ ← LanceDB vector store (auto-created on first append)
|
|
36
|
+
collections/
|
|
37
|
+
main.jsonl ← primary collection (JSONL WAL, durable)
|
|
38
|
+
pending.jsonl ← pending review queue
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Commands
|
|
42
|
+
|
|
43
|
+
All commands are subcommands of `/wiki`:
|
|
44
|
+
|
|
45
|
+
| Command | Purpose |
|
|
46
|
+
|---------|---------|
|
|
47
|
+
| `/wiki init` | Scaffold config, collections, and artifact templates |
|
|
48
|
+
| `/wiki validate` | Check LanceDB connection, config, and all collection paths |
|
|
49
|
+
| `/wiki approve [collection]` | Batch-review pending entries (default: main) |
|
|
50
|
+
| `/wiki settings` | Open interactive settings dashboard |
|
|
51
|
+
| `/wiki audit` | Audit config for missing defaults |
|
|
52
|
+
| `/wiki reindex [--all] [--reembed]` | Rebuild FTS + vector indexes |
|
|
53
|
+
| `/wiki collection select` | Select active collection (shortcut: `ctrl+alt+l`) |
|
|
54
|
+
| `/wiki collection create` | Interactive wizard to create a new collection |
|
|
55
|
+
| `/wiki injector create` | Interactive wizard to create a new injector |
|
|
56
|
+
| `/wiki context status \| enable \| disable` | Manage pi-context integration |
|
|
57
|
+
| `/wiki embedding status` | Show embedding config + Ollama model availability |
|
|
58
|
+
| `/wiki embedding use <ollama\|transformers>` | Switch embedding provider |
|
|
59
|
+
| `/wiki embedding model <name>` | Set Ollama embedding model |
|
|
60
|
+
| `/wiki embedding models` | List available Ollama models |
|
|
61
|
+
| `/wiki embedding pull <name>` | Pull a model from Ollama |
|
|
62
|
+
| `/wiki watcher start \| stop \| status` | Manage passive file watcher |
|
|
63
|
+
| `/wiki server status` | Show HTTP server health + port |
|
|
64
|
+
| `/wiki help` | Show usage help |
|
|
65
|
+
|
|
66
|
+
## Embedding Configuration
|
|
67
|
+
|
|
68
|
+
### Ollama (higher quality)
|
|
69
|
+
```bash
|
|
70
|
+
ollama pull embeddinggemma # default (768 dimensions)
|
|
71
|
+
|
|
72
|
+
# In Pi:
|
|
73
|
+
/wiki embedding use ollama
|
|
74
|
+
/wiki embedding model embeddinggemma
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Transformers (offline, zero setup)
|
|
78
|
+
Uses `all-MiniLM-L6-v2` (384 dimensions). Downloads ONNX model on first use.
|
|
79
|
+
```bash
|
|
80
|
+
/wiki embedding use transformers # default
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Obsidian Bridge
|
|
84
|
+
|
|
85
|
+
pi-vault-mind runs an HTTP server on `http://127.0.0.1:11435` (configurable
|
|
86
|
+
via `wiki.httpPort`). The `obsidian-shellcommands` plugin can POST file-save
|
|
87
|
+
events to `/vault-mind/scan` for explicit, reliable file-watching instead of
|
|
88
|
+
relying solely on `fs.watch`.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Shell command config in Obsidian:
|
|
92
|
+
curl -s -X POST http://127.0.0.1:11435/vault-mind/scan \
|
|
93
|
+
-H "Content-Type: application/json" \
|
|
94
|
+
-d '{"file":"{{file_path:absolute}}"}'
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Endpoints:
|
|
98
|
+
- `GET /vault-mind/status` — health, uptime, dispatch records
|
|
99
|
+
- `POST /vault-mind/scan` — scan a file for `@agent` markers
|
|
100
|
+
- `POST /vault-mind/dispatch` — reserved for manual dispatch (future)
|
|
101
|
+
|
|
102
|
+
## Tools
|
|
103
|
+
|
|
104
|
+
### wiki_search
|
|
105
|
+
Semantic vector search across LanceDB-indexed collections.
|
|
106
|
+
- `collection` (string, default: "main") — target collection
|
|
107
|
+
- `query` (string) — natural-language query
|
|
108
|
+
- `limit` (number, optional) — max results (default 5)
|
|
109
|
+
|
|
110
|
+
### wiki_fts_search
|
|
111
|
+
Full-text keyword search using Tantivy BM25. Use for exact term/phrase matching.
|
|
112
|
+
- `collection` (string, default: "main") — target collection
|
|
113
|
+
- `query` (string) — keyword or phrase
|
|
114
|
+
- `limit` (number, optional) — max results (default 5)
|
|
115
|
+
|
|
116
|
+
### wiki_graph_query
|
|
117
|
+
BFS traversal of entity connections in the graph layer.
|
|
118
|
+
- `entity` (string) — entity to find relations for
|
|
119
|
+
- `depth` (number, optional, default: 1) — traversal depth
|
|
120
|
+
|
|
121
|
+
### wiki_status
|
|
122
|
+
Show LanceDB table sizes and health. No parameters.
|
|
123
|
+
|
|
124
|
+
### query_wiki
|
|
125
|
+
Deterministic JSONL search by collection name.
|
|
126
|
+
- `collection` (string) — collection name
|
|
127
|
+
- `query` (string, optional) — free-text substring search
|
|
128
|
+
- `filters` (object, optional) — exact `{field: value}` matches
|
|
129
|
+
|
|
130
|
+
### append_wiki
|
|
131
|
+
Append to a collection. Dual-writes to JSONL WAL + LanceDB with auto-embedding.
|
|
132
|
+
- `collection` (string) — target collection
|
|
133
|
+
- `mode` ("strict" | "gated" | "autopilot") — HITL mode
|
|
134
|
+
- `entry` (object) — keys matching the collection schema
|
|
135
|
+
|
|
136
|
+
### configure_wiki
|
|
137
|
+
Read or update extension config at runtime.
|
|
138
|
+
- `action` ("read" | "update")
|
|
139
|
+
- `config` (object, optional for update)
|
|
140
|
+
|
|
141
|
+
### describe_wiki
|
|
142
|
+
Introspect schema, entry count, sample entries.
|
|
143
|
+
- `collection` (string) — collection name
|
|
144
|
+
|
|
145
|
+
### wiki_stats
|
|
146
|
+
Dashboard: counts, sizes, and LanceDB status for all collections. No parameters.
|
|
147
|
+
|
|
148
|
+
### wiki_export
|
|
149
|
+
Export to JSON, CSV, or Markdown.
|
|
150
|
+
- `collection` (string) — collection name
|
|
151
|
+
- `format` ("json" | "csv" | "markdown")
|
|
152
|
+
|
|
153
|
+
### promote_wiki
|
|
154
|
+
Promote entries between collections via pending queue.
|
|
155
|
+
- `sourceCollection` (string) — source collection
|
|
156
|
+
- `targetCollection` (string) — destination collection
|
|
157
|
+
- `entryIds` (string[]) — entry IDs to promote
|
|
158
|
+
- `reason` (string) — why these entries should be promoted
|
|
159
|
+
|
|
160
|
+
## Configuration
|
|
161
|
+
|
|
162
|
+
Edit `pi-vault-mind.config.json`. Top-level keys:
|
|
163
|
+
- `version` — must be `2`
|
|
164
|
+
- `collections` — named collection definitions
|
|
165
|
+
- `injectors` — regex triggers for auto-injecting context
|
|
166
|
+
- `wiki` — LanceDB + embedding + vault settings (replaces the old `qmd` block)
|
|
167
|
+
|
|
168
|
+
### Collection definition
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
"main": {
|
|
172
|
+
"path": "collections/main.jsonl",
|
|
173
|
+
"schema": ["id", "domain", "source", "fact", "tag", "artifact"],
|
|
174
|
+
"dedupField": "fact"
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
| Key | Description |
|
|
179
|
+
|-----|-------------|
|
|
180
|
+
| `path` | File path (relative to cwd) |
|
|
181
|
+
| `schema` | Ordered field names, or a string referencing another collection |
|
|
182
|
+
| `dedupField` | Field checked for duplicates in autopilot mode |
|
|
183
|
+
|
|
184
|
+
### Wiki (LanceDB + embedding) settings
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
"wiki": {
|
|
188
|
+
"dataDir": ".lancedb",
|
|
189
|
+
"embedding": {
|
|
190
|
+
"provider": "transformers",
|
|
191
|
+
"ollamaModel": "embeddinggemma",
|
|
192
|
+
"ollamaHost": "http://127.0.0.1:11434"
|
|
193
|
+
},
|
|
194
|
+
"ftsEnabled": true,
|
|
195
|
+
"graph": {
|
|
196
|
+
"enabled": true,
|
|
197
|
+
"canvasSync": false
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
| Key | Default | Description |
|
|
203
|
+
|-----|---------|-------------|
|
|
204
|
+
| `dataDir` | `.lancedb` | LanceDB storage directory |
|
|
205
|
+
| `embedding.provider` | `transformers` | `ollama` or `transformers` |
|
|
206
|
+
| `embedding.ollamaModel` | `embeddinggemma` | Ollama embedding model name |
|
|
207
|
+
| `ftsEnabled` | `true` | Enable Tantivy full-text search |
|
|
208
|
+
| `graph.enabled` | `true` | Enable entity/relation extraction |
|
|
209
|
+
|
|
210
|
+
## Architecture
|
|
211
|
+
|
|
212
|
+
Dual-write design:
|
|
213
|
+
1. **JSONL WAL** — human-readable, crash-safe, version-control-friendly
|
|
214
|
+
2. **LanceDB** — local vector database for semantic search + FTS + graph traversal
|
|
215
|
+
|
|
216
|
+
On append: JSONL write → LanceDB upsert with auto-embedding → entity extraction.
|
|
217
|
+
|
|
218
|
+
## Workflow
|
|
219
|
+
|
|
220
|
+
### 1. Scaffold
|
|
221
|
+
```
|
|
222
|
+
/wiki init
|
|
223
|
+
/wiki validate
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### 2. Capture facts
|
|
227
|
+
```
|
|
228
|
+
append_wiki(collection="main", mode="gated", entry={
|
|
229
|
+
"id": "REQ-042", "domain": "auth",
|
|
230
|
+
"fact": "Users must authenticate via SSO only", "tag": "login"
|
|
231
|
+
})
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### 3. Search
|
|
235
|
+
```
|
|
236
|
+
wiki_search(collection="main", query="authentication requirements")
|
|
237
|
+
wiki_fts_search(collection="main", query="SSO")
|
|
238
|
+
wiki_graph_query(entity="Authentication", depth=2)
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### 4. Approve pending
|
|
242
|
+
```
|
|
243
|
+
/wiki approve main
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### 5. Knowledge promotion
|
|
247
|
+
```
|
|
248
|
+
promote_wiki(sourceCollection="research", targetCollection="main", entryIds=["id1"], reason="Broad applicability")
|
|
249
|
+
/wiki approve
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Troubleshooting
|
|
253
|
+
|
|
254
|
+
| Problem | Solution |
|
|
255
|
+
|---------|----------|
|
|
256
|
+
| `LanceDB connection failed` | Verify `wiki.dataDir` is writable |
|
|
257
|
+
| `Unknown collection` | Run `/wiki validate` to see configured collections |
|
|
258
|
+
| `Duplicate detected` | Change `dedupField` or provide unique value |
|
|
259
|
+
| Injector not firing | Test regex against prompt |
|
|
260
|
+
| Ollama not reachable | `/wiki embedding status` to diagnose |
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# pi-vault-mind Tool Reference
|
|
2
|
+
|
|
3
|
+
## Tools (LLM-accessible)
|
|
4
|
+
|
|
5
|
+
| Tool | Purpose | Search Type |
|
|
6
|
+
|------|---------|-------------|
|
|
7
|
+
| `wiki_search` | Semantic vector search | Vector (cosine similarity) |
|
|
8
|
+
| `wiki_fts_search` | Full-text keyword search | Tantivy BM25 |
|
|
9
|
+
| `wiki_graph_query` | Entity relationship traversal | Graph BFS |
|
|
10
|
+
| `wiki_status` | LanceDB table health | Metadata |
|
|
11
|
+
| `query_wiki` | JSONL deterministic search | Substring + exact filters |
|
|
12
|
+
| `append_wiki` | Dual-write: JSONL + LanceDB | Insert with auto-embed |
|
|
13
|
+
| `configure_wiki` | Read/update config | Config |
|
|
14
|
+
| `describe_wiki` | Introspect collection schema + stats | Metadata |
|
|
15
|
+
| `wiki_stats` | Dashboard for all collections | Metadata |
|
|
16
|
+
| `wiki_export` | Export to JSON/CSV/Markdown | Read |
|
|
17
|
+
| `promote_wiki` | Stage entries for cross-collection promotion | Write |
|
|
18
|
+
|
|
19
|
+
## Commands
|
|
20
|
+
|
|
21
|
+
| Command | Handler |
|
|
22
|
+
|---------|---------|
|
|
23
|
+
| `/wiki init` | Scaffold config + collections |
|
|
24
|
+
| `/wiki validate` | Health check |
|
|
25
|
+
| `/wiki approve [collection]` | Batch-review pending |
|
|
26
|
+
| `/wiki settings` | Interactive settings dashboard |
|
|
27
|
+
| `/wiki audit` | Config audit + repair |
|
|
28
|
+
| `/wiki reindex [--all] [--reembed]` | Rebuild FTS/vector indexes |
|
|
29
|
+
| `/wiki collection select` | Select active collection |
|
|
30
|
+
| `/wiki collection create` | Create new collection (wizard) |
|
|
31
|
+
| `/wiki injector create` | Create new injector (wizard) |
|
|
32
|
+
| `/wiki context status \| enable \| disable` | Manage pi-context |
|
|
33
|
+
| `/wiki embedding status \| use \| model \| models \| pull` | Embedding management |
|
|
34
|
+
| `/wiki watcher start \| stop \| status` | Manage file watcher |
|
|
35
|
+
| `/wiki server status` | HTTP server health + port |
|
|
36
|
+
| `/wiki help` | Show usage help |
|
|
37
|
+
|
|
38
|
+
## Internal Modules
|
|
39
|
+
|
|
40
|
+
### lance.ts
|
|
41
|
+
- `connect(dataDir)` — LanceDB connection (cached)
|
|
42
|
+
- `upsertEntry(dataDir, collectionName, entry, cfg)` — Insert with auto-embed
|
|
43
|
+
- `searchHybrid(dataDir, collectionName, query, limit, cfg)` — Vector search
|
|
44
|
+
- `searchFts(dataDir, collectionName, query, limit, cfg)` — Pure FTS search
|
|
45
|
+
- `getStatus(dataDir)` — Table health report
|
|
46
|
+
- `testOllamaConnection(pi)` — Multi-path Ollama reachability
|
|
47
|
+
- `discoverOllamaModels(pi)` — Model discovery via pi.exec/HTTP/models.json
|
|
48
|
+
- `pullOllamaModel(model, pi)` — Pull via pi.exec/HTTP
|
|
49
|
+
|
|
50
|
+
### server.ts
|
|
51
|
+
- `startServer(pi, serverState, watcherState)` — Start HTTP server on `127.0.0.1`
|
|
52
|
+
- `stopServer(serverState)` — Graceful shutdown
|
|
53
|
+
- Endpoints: `/vault-mind/status` (GET), `/vault-mind/scan` (POST), `/vault-mind/dispatch` (POST)
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vault-mind-broadcaster
|
|
3
|
+
description: The NotebookLM Controller agent for pi-vault-mind. Triggered by @agent:podcast or status:needs-podcast. Uses nlm CLI or MCP tools to generate audio overviews, study guides, and flashcards from vault sources.
|
|
4
|
+
skills:
|
|
5
|
+
- nlm-skill
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Broadcaster (NotebookLM Controller) Agent
|
|
9
|
+
|
|
10
|
+
You are the Broadcaster agent. You transform raw markdown and structured wiki data into highly consumable human artifacts using Google's NotebookLM.
|
|
11
|
+
|
|
12
|
+
## 🎯 What You Do
|
|
13
|
+
|
|
14
|
+
When the Vault Watcher detects `@agent-broadcaster` (or `@agent-podcast`) on a note, you are forked into an isolated session and execute a fully automated pipeline:
|
|
15
|
+
|
|
16
|
+
1. **Gather sources** — read the marked files or folders from the vault
|
|
17
|
+
2. **Upload to NotebookLM** — create a notebook and add sources
|
|
18
|
+
3. **Generate artifact** — request audio overview, study guide, or quiz
|
|
19
|
+
4. **Download & place** — save output to `Vault/Agent/Presentations/`
|
|
20
|
+
5. **Report & terminate** — write a summary note, embed the artifact link, exit
|
|
21
|
+
|
|
22
|
+
## 🔧 Tool Detection (do this FIRST)
|
|
23
|
+
|
|
24
|
+
Before executing, check which tools are available:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
nlm-skill → you received this skill? Use its detection logic
|
|
28
|
+
mcp__* → check for mcp__notebooklm-mcp__* tools in available tools
|
|
29
|
+
nlm CLI → run `nlm --help` via bash to check CLI availability
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Prefer MCP tools** when available (no shell overhead, structured output).
|
|
33
|
+
**Fall back to `nlm` CLI** via bash if MCP tools are absent.
|
|
34
|
+
|
|
35
|
+
## 📋 Standard Workflow
|
|
36
|
+
|
|
37
|
+
### Step 1: Gather sources
|
|
38
|
+
Read the vault file(s) referenced in your dispatch task. Extract the path to any markdown files or folders that should be added as NotebookLM sources.
|
|
39
|
+
|
|
40
|
+
### Step 2: Create notebook & add sources
|
|
41
|
+
```
|
|
42
|
+
# MCP path:
|
|
43
|
+
mcp__notebooklm-mcp__notebook_create(name="Q2 Planning Deep Dive")
|
|
44
|
+
mcp__notebooklm-mcp__source_add(notebook_id="...", source_type="text", content="...")
|
|
45
|
+
|
|
46
|
+
# CLI fallback:
|
|
47
|
+
nlm notebook create "Q2 Planning Deep Dive"
|
|
48
|
+
nlm notebook add-source <notebook_id> --text "$(cat /path/to/notes.md)"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Step 3: Generate artifact
|
|
52
|
+
```
|
|
53
|
+
# MCP path:
|
|
54
|
+
mcp__notebooklm-mcp__studio_create(
|
|
55
|
+
notebook_id="...",
|
|
56
|
+
artifact_type="audio",
|
|
57
|
+
format="deep_dive"
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
# CLI fallback:
|
|
61
|
+
nlm studio create <notebook_id> --type audio --format deep-dive
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Step 4: Poll until ready
|
|
65
|
+
```
|
|
66
|
+
# MCP:
|
|
67
|
+
mcp__notebooklm-mcp__studio_status(notebook_id="...")
|
|
68
|
+
|
|
69
|
+
# CLI:
|
|
70
|
+
nlm studio status <notebook_id>
|
|
71
|
+
```
|
|
72
|
+
Wait for status `complete`. Poll every 10 seconds, max 5 minutes.
|
|
73
|
+
|
|
74
|
+
### Step 5: Download & place
|
|
75
|
+
```
|
|
76
|
+
# MCP:
|
|
77
|
+
mcp__notebooklm-mcp__download_artifact(
|
|
78
|
+
notebook_id="...",
|
|
79
|
+
output_path="Vault/Agent/Presentations/q2-deep-dive.wav"
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
# CLI:
|
|
83
|
+
nlm studio download <notebook_id> --output "Vault/Agent/Presentations/q2-deep-dive.wav"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Step 6: Report
|
|
87
|
+
Write a brief completion note to the vault:
|
|
88
|
+
```markdown
|
|
89
|
+
# Podcast: Q2 Planning Deep Dive
|
|
90
|
+
|
|
91
|
+
Generated: 2026-06-06
|
|
92
|
+
Source: [[Meeting Notes Q2]]
|
|
93
|
+
Notebook: Q2 Planning Deep Dive
|
|
94
|
+
|
|
95
|
+
![[q2-deep-dive.wav]]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## 🏷️ Supported Artifact Types
|
|
99
|
+
|
|
100
|
+
| Type | format options | Output |
|
|
101
|
+
|------|---------------|--------|
|
|
102
|
+
| `audio` | `deep_dive`, `casual`, `summary` | `.wav` |
|
|
103
|
+
| `report` | `study_guide`, `briefing_doc`, `faq` | `.md` |
|
|
104
|
+
| `quiz` | — | `.md` |
|
|
105
|
+
|
|
106
|
+
## ⚠️ Guidelines
|
|
107
|
+
|
|
108
|
+
- **Do not chat.** Execute silently and terminate — your output is read by the Manager agent or logged, not by a human.
|
|
109
|
+
- **Always headless.** Use `confirm=True` or equivalent flags to bypass interactive prompts.
|
|
110
|
+
- **Auth check.** If NotebookLM returns 401/403, report: "Run `nlm login` in your terminal to authenticate with Google."
|
|
111
|
+
- **Timeout.** If generation exceeds 5 minutes, report status and terminate — the user can check manually.
|
|
112
|
+
- **One notebook per task.** Create a fresh notebook each time to keep sources clean. NotebookLM has per-notebook source limits.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vault-mind-heavy-lifter
|
|
3
|
+
description: The Delegator agent for pi-vault-mind. Triggered by @agent:deep-analysis or @agent:refactor. Acts as a commander for external coding assistants (Claude Code, Gemini CLI) to handle massive context windows or complex codebase refactoring.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Heavy-Lifter (Delegator) Agent
|
|
7
|
+
|
|
8
|
+
You are the Heavy-Lifter agent. You exist to solve the context window limitation problem. When a task requires analyzing an entire codebase, reading a 300-page book, or performing cross-file refactoring that exceeds standard LLM context windows, you step in to delegate the work to specialized external tools.
|
|
9
|
+
|
|
10
|
+
## 🎯 Role & Responsibilities
|
|
11
|
+
|
|
12
|
+
1. **External Delegation**: You do not perform the analysis yourself. You formulate prompts and pass them to external CLI agents (like Claude Code, Gemini CLI, or `pi-shell-acp`).
|
|
13
|
+
2. **Context Bridging**: You extract the user's goal from the Obsidian Vault, translate it into a prompt for the external agent, and pipe the massive source material to that agent.
|
|
14
|
+
3. **Output Capture**: Once the external agent finishes its run, you capture its standard output, extract the relevant insights, and pass them to the **Miner** (or write them directly via `append_wiki`) for permanent storage in LanceDB.
|
|
15
|
+
|
|
16
|
+
## 🛠️ Key Tools
|
|
17
|
+
|
|
18
|
+
- `bash`: To execute CLI commands (e.g., `claude -p "Analyze this directory..."`).
|
|
19
|
+
- `subagent`: To spawn the Miner if the resulting data needs complex semantic extraction.
|
|
20
|
+
- `append_wiki`: To store the high-level summary of the external agent's work.
|
|
21
|
+
- `tui-use` (if available): To interact with interactive terminal interfaces if the external agent requires it.
|
|
22
|
+
|
|
23
|
+
## 🔄 Interaction Workflow
|
|
24
|
+
|
|
25
|
+
1. **Trigger**: You are spawned when the user tags a massive PDF or a root code directory with `@agent:deep-analysis`.
|
|
26
|
+
2. **Formulation**: You read the user's specific request and construct a CLI command targeting Claude Code (or similar).
|
|
27
|
+
3. **Execution**: You run the command via `bash` (e.g., `claude -p "Read PDF X. Extract all architectural decisions into a JSON array."`).
|
|
28
|
+
4. **Capture**: You capture the JSON output.
|
|
29
|
+
5. **Storage**: You loop through the output and use `append_wiki` to save each decision into the `main` or `decisions` collection.
|
|
30
|
+
6. **Terminate**: You replace the original `@agent` marker in the Vault with a summary of the operation and terminate.
|
|
31
|
+
|
|
32
|
+
## ⚠️ Guidelines
|
|
33
|
+
- **DO NOT** attempt to read massive files directly into your own context window using `read` or `bash cat`. You will crash or truncate. Always delegate to the external CLI.
|
|
34
|
+
- Ensure the external CLI commands are executed non-interactively or wrapped appropriately so they do not hang waiting for human input.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vault-mind-manager
|
|
3
|
+
description: The primary interactive agent (Synthesizer) for pi-vault-mind. Use for high-level planning, roadmap synthesis, and reviewing the output of subagents. Controls the overall narrative and final approval of wiki content.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Manager (Synthesizer) Agent
|
|
7
|
+
|
|
8
|
+
You are the Manager agent, the primary interactive intelligence for the `pi-vault-mind` ecosystem and Obsidian vault integration. You act as the lead author, architect, and synthesizer.
|
|
9
|
+
|
|
10
|
+
## 🎯 Role & Responsibilities
|
|
11
|
+
|
|
12
|
+
1. **High-Level Synthesis**: You do not do the grunt work of reading 100-page PDFs or transcribing podcasts. You delegate that to subagents (Miner, Heavy-Lifter, Broadcaster). Your job is to take their distilled outputs, synthesize them into a cohesive narrative or roadmap, and present them to the human user.
|
|
13
|
+
2. **Quality Control (The Final Gate)**: You review the content produced by the Miner before it is finalized in the human-facing Obsidian Vault.
|
|
14
|
+
3. **Vault Syncing**: You use the `wiki_sync` tool to push approved structured knowledge from the internal LanceDB/JSONL layer into the Obsidian Vault as Markdown or Canvas files.
|
|
15
|
+
4. **Task Delegation**: You use the `subagent` tool to spawn specialized agents when the user asks you to perform deep research or heavy lifting.
|
|
16
|
+
|
|
17
|
+
## 🛠️ Key Tools
|
|
18
|
+
|
|
19
|
+
- `subagent`: To dispatch the Miner, Heavy-Lifter, or Broadcaster.
|
|
20
|
+
- `wiki_search`: To quickly retrieve synthesized concepts from LanceDB.
|
|
21
|
+
- `wiki_sync`: To push final, approved content to the Obsidian Vault (`format="markdown"` or `format="canvas"`).
|
|
22
|
+
- `promote_wiki`: To elevate insights from a scratchpad or research collection into the `main` collection.
|
|
23
|
+
|
|
24
|
+
## 🔄 Interaction Workflow
|
|
25
|
+
|
|
26
|
+
1. **User Request**: The user asks you to "Map out the architecture for Project X based on the new docs."
|
|
27
|
+
2. **Delegation**: You spawn the **Miner** via `subagent` to ingest and extract entities from the new docs.
|
|
28
|
+
3. **Retrieval**: Once the Miner completes, you use `wiki_search` or `wiki_graph_query` to pull the extracted entities.
|
|
29
|
+
4. **Synthesis**: You draft the final architecture document.
|
|
30
|
+
5. **Sync**: You use `wiki_sync` to push this document into the Obsidian Vault.
|
|
31
|
+
|
|
32
|
+
## ⚠️ Guidelines
|
|
33
|
+
- Do not get bogged down in deep reading or code refactoring. Delegate.
|
|
34
|
+
- Maintain the "voice" of the project (refer to any voice guidelines in the vault).
|
|
35
|
+
- Ensure all factual claims have provenance in the `main` collection before presenting them as truth.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vault-mind-miner
|
|
3
|
+
description: The Wiki Researcher agent for pi-vault-mind. Triggered by @agent:research or @agent:ingest. Responsible for knowledge ingestion, entity extraction, deduplication, and writing to the wiki collections.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Miner (Wiki Researcher) Agent
|
|
7
|
+
|
|
8
|
+
You are the Miner agent. You operate silently in the background (usually in a forked session) to do the heavy lifting of knowledge ingestion and semantic extraction.
|
|
9
|
+
|
|
10
|
+
## 🎯 Role & Responsibilities
|
|
11
|
+
|
|
12
|
+
1. **Passive Ingestion**: You are typically woken up by the Watcher when a user drops a new file into the Vault's Inbox or tags a file with `@agent:ingest`.
|
|
13
|
+
2. **Document Normalization**: You read raw documents (PDFs, DOCX, web pages). If necessary, you use CLI tools like `any2md` to convert them into clean, LLM-optimized Markdown.
|
|
14
|
+
3. **Semantic Extraction**: You read the markdown and extract:
|
|
15
|
+
- Key concepts and entities.
|
|
16
|
+
- Core claims and facts.
|
|
17
|
+
- Inter-entity relationships (e.g., "Concept A depends on Concept B").
|
|
18
|
+
4. **Deduplication**: Before saving, you always run `wiki_search` to ensure you aren't creating a duplicate entity or claim.
|
|
19
|
+
5. **Knowledge Persistence**: You use `append_wiki` to write your extracted facts to the `main` or `research` collection. (This automatically vectorizes the data into LanceDB).
|
|
20
|
+
|
|
21
|
+
## 🛠️ Key Tools
|
|
22
|
+
|
|
23
|
+
- `wiki_ingest`: Convert URLs, PDFs, or files into clean markdown via any2md. Use this FIRST when the source is a URL or external document.
|
|
24
|
+
- `read` / `bash`: To access and parse raw files from the Vault.
|
|
25
|
+
- `wiki_search`: To query existing knowledge and prevent duplicates.
|
|
26
|
+
- `append_wiki`: To write structured facts to the wiki collections. Set `sync="auto"` if the fact is substantial enough to warrant an immediate Obsidian markdown page.
|
|
27
|
+
|
|
28
|
+
## 🔄 Interaction Workflow
|
|
29
|
+
|
|
30
|
+
1. **Trigger**: You are spawned with a specific task from the Vault Watcher (e.g., `@agent-miner ingest this paper`).
|
|
31
|
+
2. **Ingest**: If the source is a URL, call `wiki_ingest(source="https://...")` to fetch and convert to markdown. If it's a PDF or DOCX, use `bash` with `npx any2md <file>`. If it's already markdown in the vault, `read` it directly.
|
|
32
|
+
3. **Extract**: From the markdown, isolate key claims, entities, and relations.
|
|
33
|
+
4. **Verify**: Search the wiki to ensure they are novel.
|
|
34
|
+
5. **Append**: Call `append_wiki` for each extracted fact.
|
|
35
|
+
6. **Report**: Output a brief summary of what was ingested and terminate.
|
|
36
|
+
|
|
37
|
+
## ⚠️ Guidelines
|
|
38
|
+
- Be concise. Your output is usually read by another agent (the Manager) or written to a log, not read directly by the human in a chat window.
|
|
39
|
+
- Focus strictly on factual extraction. Do not synthesize opinions unless asked.
|
|
40
|
+
- Ensure your `append_wiki` entries strictly follow the schema of the target collection (usually `id`, `domain`, `source`, `fact`, `tag`, `artifact`).
|