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,106 @@
|
|
|
1
|
+
# Obsidian Vault Structure
|
|
2
|
+
|
|
3
|
+
Recommended layout for a vault used with pi-vault-mind. Combines **PARA method** + **Johnny Decimal organization** + **LLM Wiki structure** for a workspace that works for both humans and agents.
|
|
4
|
+
|
|
5
|
+
## The Folder Tree
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Vault/
|
|
9
|
+
├── 00 - System/ ← Templates, inbox, daily notes, meta-configuration
|
|
10
|
+
├── 10 - Projects/ ← Active projects (PARA)
|
|
11
|
+
├── 20 - Areas/ ← Ongoing domains (PARA)
|
|
12
|
+
├── 30 - Resources/ ← Reference material (PARA)
|
|
13
|
+
│ ├── Inbox/ ← 📥 Drop files here for passive agent ingestion
|
|
14
|
+
│ ├── Sources/ ← any2md-processed documents (immutable sources)
|
|
15
|
+
│ └── Articles/ ← External references
|
|
16
|
+
├── 40 - Archive/ ← Completed/archived items (PARA)
|
|
17
|
+
│
|
|
18
|
+
├── Agent/ ← 🤖 Agent-Collaborative Workspace
|
|
19
|
+
│ ├── Inbox/ ← Human drops tasks/requests for agents (@agent-*)
|
|
20
|
+
│ ├── Wiki/ ← Agent-curated structured knowledge
|
|
21
|
+
│ │ ├── Concepts/ ← Agent-written concept pages with typed edges
|
|
22
|
+
│ │ ├── Entities/ ← People/orgs/systems with `agent:derived-from` links
|
|
23
|
+
│ │ ├── Syntheses/ ← Cross-topic analysis pages
|
|
24
|
+
│ │ └── Summaries/ ← Source document summaries
|
|
25
|
+
│ ├── Journal/ ← Agent activity log (timestamped, append-only)
|
|
26
|
+
│ ├── Tasks/ ← Agent task boards (Kanban markdown or Bases)
|
|
27
|
+
│ └── Presentations/ ← NotebookLM-generated podcasts, slides, quizzes
|
|
28
|
+
│
|
|
29
|
+
├── index.md ← Master routing table (agent + human navigable)
|
|
30
|
+
└── CLAUDE.md ← Agent instructions + domain constraints
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Why this structure
|
|
34
|
+
|
|
35
|
+
### PARA for humans
|
|
36
|
+
- **Projects** (10-) have a deadline
|
|
37
|
+
- **Areas** (20-) are ongoing responsibilities
|
|
38
|
+
- **Resources** (30-) are topics of interest
|
|
39
|
+
- **Archive** (40-) is everything completed
|
|
40
|
+
|
|
41
|
+
### Agent/ for subagents
|
|
42
|
+
This is the shared workspace where agents read, write, and produce. Each subfolder has a specific role:
|
|
43
|
+
- `Inbox/` — human drops `@agent-XXX` markers here. Watcher detects them.
|
|
44
|
+
- `Wiki/Concepts/` — Miner writes concept pages here with frontmatter
|
|
45
|
+
- `Wiki/Entities/` — entity pages (people, systems) with `agent:derived-from` typed edges
|
|
46
|
+
- `Wiki/Syntheses/` — cross-topic analysis from the Broadcaster
|
|
47
|
+
- `Journal/` — append-only activity log, useful for `/wiki journal` queries
|
|
48
|
+
- `Tasks/` — agent-maintained task boards (Kanban markdown or `.base` files)
|
|
49
|
+
- `Presentations/` — NotebookLM outputs (audio, video, slides)
|
|
50
|
+
|
|
51
|
+
### Johnny Decimal for navigation
|
|
52
|
+
- `00-09` — System/meta
|
|
53
|
+
- `10-19` — Active projects
|
|
54
|
+
- `20-29` — Ongoing areas
|
|
55
|
+
- `30-39` — Reference resources
|
|
56
|
+
- `40-49` — Archive
|
|
57
|
+
|
|
58
|
+
Each folder has an `index.md` for routing.
|
|
59
|
+
|
|
60
|
+
## Required frontmatter
|
|
61
|
+
|
|
62
|
+
All agent-written pages should have strict YAML frontmatter:
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
---
|
|
66
|
+
title: "RLHF"
|
|
67
|
+
domain: "alignment" # or "research", "decision", "experiment"
|
|
68
|
+
source: "arxiv.org/abs/..." # or "user-prompt", "notebook"
|
|
69
|
+
status: "draft" # or "needs-review", "approved"
|
|
70
|
+
created: 2026-06-06
|
|
71
|
+
tags: ["reinforcement-learning", "alignment", "ppo"]
|
|
72
|
+
agent:related-to: "[[Reward_Modeling]]"
|
|
73
|
+
agent:derived-from: "[[Constitutional_AI]]"
|
|
74
|
+
---
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The `agent:related-to`, `agent:derived-from`, etc. are **typed edges** that Breadcrumbs parses.
|
|
78
|
+
|
|
79
|
+
## Sync strategy
|
|
80
|
+
|
|
81
|
+
### Obsidian Sync (primary)
|
|
82
|
+
For real-time sync across the user's devices. Handles 99% of human interaction.
|
|
83
|
+
|
|
84
|
+
### Git (long-term + agent work)
|
|
85
|
+
- **`obsidian-git` plugin** — auto-commits every X minutes
|
|
86
|
+
- **Git worktrees** for Heavy-Lifter — large refactors in isolated branches, then merged
|
|
87
|
+
|
|
88
|
+
## Recommended Obsidian settings
|
|
89
|
+
|
|
90
|
+
In `Settings → Files & Links`:
|
|
91
|
+
- **New link format**: Shortest possible (when possible)
|
|
92
|
+
- **Use [[Wikilinks]]**: ON
|
|
93
|
+
- **Always update internal links**: ON
|
|
94
|
+
|
|
95
|
+
In `Settings → Core Plugins`:
|
|
96
|
+
- ✅ Backlinks
|
|
97
|
+
- ✅ Outline
|
|
98
|
+
- ✅ Word count
|
|
99
|
+
- ✅ File recovery
|
|
100
|
+
|
|
101
|
+
Community plugins to install:
|
|
102
|
+
- `obsidian-git` — auto-commit
|
|
103
|
+
- `Breadcrumbs` — typed-edge graph
|
|
104
|
+
- `Graph Analysis` — co-citation discovery
|
|
105
|
+
- `Actions URI` — cross-app automation
|
|
106
|
+
- `obsidian-shellcommands` — bridge to pi
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# pi Extension Wiring
|
|
2
|
+
|
|
3
|
+
This document describes every pi extension and external tool that **pi-vault-mind** integrates with.
|
|
4
|
+
|
|
5
|
+
## Required Extensions
|
|
6
|
+
|
|
7
|
+
### pi-subagents
|
|
8
|
+
|
|
9
|
+
**What it provides:** The `subagent()` tool — used by the Manager agent to fork isolated worker sessions for the Miner, Broadcaster, and Heavy-Lifter.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pi install npm:pi-subagents
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**How we use it:**
|
|
16
|
+
- Vault Watcher detects `@agent-miner` → sends task to Manager
|
|
17
|
+
- Manager calls `subagent({ agent: "vault-mind-miner", context: "fork", async: true })`
|
|
18
|
+
- Miner runs in isolated session, writes results to LanceDB + Vault, terminates
|
|
19
|
+
- No chat pollution, clean context per task
|
|
20
|
+
|
|
21
|
+
**Configuration:** None required. Works out of the box.
|
|
22
|
+
|
|
23
|
+
### pi-context
|
|
24
|
+
|
|
25
|
+
**What it provides:** Context management tools (`context_tag`, `context_log`, `context_checkout`) for clean session hygiene during long orchestration sessions.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pi install npm:pi-context
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**How we use it:**
|
|
32
|
+
- Manager tags milestones (`watcher-build-start`, `research-phase`) to create rollback points
|
|
33
|
+
- Before risky operations, checks `context_log` to understand current session state
|
|
34
|
+
- After noisy research: squashes history with `context_checkout` to keep context window clean
|
|
35
|
+
|
|
36
|
+
**Configuration in `pi-vault-mind.config.json`:**
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"extensionCompatibility": {
|
|
40
|
+
"pi-context": {
|
|
41
|
+
"enabled": true,
|
|
42
|
+
"tagPatterns": [],
|
|
43
|
+
"enhanceInjectors": false,
|
|
44
|
+
"autoEnableAcm": true,
|
|
45
|
+
"indexContextEvents": true
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Enable/disable via:
|
|
52
|
+
```
|
|
53
|
+
/wiki context enable
|
|
54
|
+
/wiki context disable
|
|
55
|
+
/wiki context status
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Optional Extensions
|
|
59
|
+
|
|
60
|
+
### NotebookLM CLI (`nlm`)
|
|
61
|
+
|
|
62
|
+
**What it provides:** Command-line interface to Google NotebookLM for programmatic podcast generation, study guides, quizzes, and audio overviews.
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Install globally (not a pi extension):
|
|
66
|
+
npm install -g notebooklm-cli
|
|
67
|
+
|
|
68
|
+
# Or use the MCP server (preferred):
|
|
69
|
+
# Add to ~/.pi/agent/mcp.json:
|
|
70
|
+
# { "notebooklm-mcp": { "command": "npx", "args": ["-y", "notebooklm-mcp-cli"] } }
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**How we use it (Broadcaster agent):**
|
|
74
|
+
- User drops `@agent-broadcaster` on meeting notes
|
|
75
|
+
- Broadcaster creates NotebookLM notebook from vault markdown files
|
|
76
|
+
- Generates "Deep Dive" audio overview
|
|
77
|
+
- Downloads `.wav` to `Vault/Agent/Presentations/`
|
|
78
|
+
|
|
79
|
+
**Required skill:** `nlm-skill` — auto-loaded by pi when `nlm` or `notebooklm` keywords are detected.
|
|
80
|
+
|
|
81
|
+
**Authentication:** Requires Google account login. Run once:
|
|
82
|
+
```bash
|
|
83
|
+
nlm login
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### any2md
|
|
87
|
+
|
|
88
|
+
**What it provides:** Converts URLs, PDFs, and other formats to clean markdown. Used by the Miner for passive document ingestion.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Available via npx (no global install needed):
|
|
92
|
+
npx any2md https://arxiv.org/abs/... > paper.md
|
|
93
|
+
|
|
94
|
+
# Or install globally:
|
|
95
|
+
npm install -g any2md
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**How we use it (Miner agent):**
|
|
99
|
+
- User drops a PDF URL or file reference with `@agent-miner ingest`
|
|
100
|
+
- Miner calls `npx any2md <source>` to convert to markdown
|
|
101
|
+
- Extracts entities and appends to LanceDB
|
|
102
|
+
- Writes converted markdown to `Vault/Agent/Inbox/`
|
|
103
|
+
|
|
104
|
+
### kepano/obsidian-skills
|
|
105
|
+
|
|
106
|
+
**What it provides:** Five pi skills that teach agents Obsidian-specific formats.
|
|
107
|
+
|
|
108
|
+
Install via:
|
|
109
|
+
```bash
|
|
110
|
+
# Clone or copy to ~/.pi/agent/skills/
|
|
111
|
+
git clone https://github.com/kepano/obsidian-skills ~/.pi/agent/skills/obsidian-skills
|
|
112
|
+
|
|
113
|
+
# Or install individual skills as pi packages
|
|
114
|
+
pi install git:https://github.com/kepano/obsidian-skills
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The 5 skills:
|
|
118
|
+
- `obsidian-markdown` — Obsidian-flavored markdown syntax
|
|
119
|
+
- `obsidian-bases` — `.base` file format (database views)
|
|
120
|
+
- `json-canvas` — Canvas JSON format
|
|
121
|
+
- `obsidian-cli` — official Obsidian CLI
|
|
122
|
+
- `defuddle` — cleaner markdown extraction from web pages
|
|
123
|
+
|
|
124
|
+
**Why required:** Without these skills, agents generate technically-valid markdown that Obsidian doesn't render correctly. The skills teach them wikilinks, embeds, callouts, Bases, and Canvas.
|
|
125
|
+
|
|
126
|
+
## Extension Dependency Graph
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
pi-vault-mind
|
|
130
|
+
├── REQUIRED: pi-subagents → subagent() tool for forked dispatch
|
|
131
|
+
├── REQUIRED: pi-context → context_tag/log/checkout for session hygiene
|
|
132
|
+
├── OPTIONAL: notebooklm-mcp-cli → Broadcaster audio generation (nlm-skill)
|
|
133
|
+
├── OPTIONAL: any2md → Miner passive document ingestion
|
|
134
|
+
├── OPTIONAL: pi-intercom → inter-agent coordination channel
|
|
135
|
+
└── OPTIONAL: kepano/obsidian-skills → agents learn Obsidian formats
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Quick Install (all at once)
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Core (required)
|
|
142
|
+
pi install npm:pi-vault-mind
|
|
143
|
+
pi install npm:pi-subagents
|
|
144
|
+
pi install npm:pi-context
|
|
145
|
+
|
|
146
|
+
# Optional quality-of-life
|
|
147
|
+
npm install -g notebooklm-cli # or configure MCP server
|
|
148
|
+
npm install -g any2md # or use npx any2md
|
|
149
|
+
|
|
150
|
+
# Obsidian skills (agents learn Obsidian format)
|
|
151
|
+
git clone https://github.com/kepano/obsidian-skills ~/.pi/agent/skills/obsidian-skills
|
|
152
|
+
|
|
153
|
+
# Verify
|
|
154
|
+
pi -e npm:pi-vault-mind
|
|
155
|
+
/wiki validate
|
|
156
|
+
/wiki watcher status
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Global Config Template
|
|
160
|
+
|
|
161
|
+
After installing all extensions, create `~/.pi/agent/pi-vault-mind.config.json`:
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"version": 2,
|
|
166
|
+
"wiki": {
|
|
167
|
+
"dataDir": ".lancedb",
|
|
168
|
+
"embedding": {
|
|
169
|
+
"provider": "transformers",
|
|
170
|
+
"ollamaModel": "embeddinggemma",
|
|
171
|
+
"ollamaHost": "http://127.0.0.1:11434"
|
|
172
|
+
},
|
|
173
|
+
"graph": {
|
|
174
|
+
"enabled": true,
|
|
175
|
+
"canvasSync": true
|
|
176
|
+
},
|
|
177
|
+
"vaults": {
|
|
178
|
+
"default": {
|
|
179
|
+
"path": "/home/YOU/Obsidian/YOUR_VAULT",
|
|
180
|
+
"autoSync": true,
|
|
181
|
+
"autoSyncTags": ["decision", "insight", "requirement"],
|
|
182
|
+
"autoSyncMinLength": 200
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"extensionCompatibility": {
|
|
187
|
+
"pi-context": {
|
|
188
|
+
"enabled": true,
|
|
189
|
+
"tagPatterns": [],
|
|
190
|
+
"autoEnableAcm": true
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"collections": {},
|
|
194
|
+
"injectors": []
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## How Extensions Wire Together at Runtime
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
1. pi starts with pi-vault-mind loaded
|
|
202
|
+
├── Discovers skills/ directory → Manager, Miner, Broadcaster, Heavy-Lifter prompts
|
|
203
|
+
├── Registers 12 wiki tools (wiki_search, append_wiki, wiki_sync, etc.)
|
|
204
|
+
├── Registers /wiki commands (init, validate, watcher, etc.)
|
|
205
|
+
└── Auto-starts Vault Watcher if wiki.vaults is configured
|
|
206
|
+
|
|
207
|
+
2. User saves @agent-miner in Obsidian
|
|
208
|
+
├── Vault Watcher (src/watcher.ts) detects marker via fs.watch
|
|
209
|
+
├── Groups markers, debounces 1s
|
|
210
|
+
└── Calls pi.sendUserMessage() with dispatch instruction
|
|
211
|
+
|
|
212
|
+
3. Manager agent receives message
|
|
213
|
+
├── Recognizes dispatch request
|
|
214
|
+
├── Calls subagent({ agent: "vault-mind-miner", context: "fork", async: true })
|
|
215
|
+
│ └── pi-subagents extension handles forking, session isolation
|
|
216
|
+
└── pi-context tools available for session hygiene (context_tag, etc.)
|
|
217
|
+
|
|
218
|
+
4. Miner subagent executes in isolation
|
|
219
|
+
├── Reads the vault file (instruction + context)
|
|
220
|
+
├── If URL/PDF detected: calls npx any2md to convert
|
|
221
|
+
├── Extracts entities via regex (src/graph.ts)
|
|
222
|
+
├── Calls append_wiki() → JSONL WAL + LanceDB
|
|
223
|
+
├── Calls wiki_sync() → markdown in Vault/Agent/Inbox/
|
|
224
|
+
└── Terminates — context doesn't pollute Manager session
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Troubleshooting
|
|
228
|
+
|
|
229
|
+
| Symptom | Check |
|
|
230
|
+
|---|---|
|
|
231
|
+
| `subagent is not defined` | Install pi-subagents: `pi install npm:pi-subagents` |
|
|
232
|
+
| `context_tag is not defined` | Install pi-context: `pi install npm:pi-context` |
|
|
233
|
+
| Watcher doesn't start | Vaults not configured: add `wiki.vaults` to config |
|
|
234
|
+
| Subagent doesn't run | Check `/wiki watcher status` — is it RUNNING? Check vault path |
|
|
235
|
+
| NotebookLM fails | `nlm login` to authenticate Google account |
|
|
236
|
+
| any2md fails | Use `npx any2md` or install globally: `npm install -g any2md` |
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Troubleshooting Tree
|
|
2
|
+
|
|
3
|
+
When something is wrong, follow this decision tree. **Read the error message first — it usually tells you which branch to take.**
|
|
4
|
+
|
|
5
|
+
## Step 1: Identify the layer
|
|
6
|
+
|
|
7
|
+
| Symptom category | Likely layer | First check |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| "command not found", "is not defined" | pi extension not installed | `pi list` |
|
|
10
|
+
| "connection refused", "ECONNREFUSED" | External service down (Ollama, LanceDB) | `ollama list`, `ls $dataDir` |
|
|
11
|
+
| "permission denied" | Filesystem permissions | `ls -la $path` |
|
|
12
|
+
| Watcher doesn't fire | File watcher / config | `/wiki watcher status` |
|
|
13
|
+
| Subagent hangs/never returns | Subagent context / model | check `~/.pi/agent/sessions/` |
|
|
14
|
+
| Embedding dimension mismatch | Config schema change | `/wiki reindex --reembed` |
|
|
15
|
+
| Search returns nothing | Empty index or wrong collection | `wiki_status` |
|
|
16
|
+
|
|
17
|
+
## Step 2: Decision tree per category
|
|
18
|
+
|
|
19
|
+
### "command not found" / "is not defined"
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
Is the extension listed in `pi list`?
|
|
23
|
+
├── NO → install it
|
|
24
|
+
│ ├── `pi install npm:pi-vault-mind`
|
|
25
|
+
│ ├── `pi install npm:pi-subagents`
|
|
26
|
+
│ └── `pi install npm:pi-context`
|
|
27
|
+
└── YES → is it enabled in this session?
|
|
28
|
+
├── Check settings.json packages array
|
|
29
|
+
└── Try `pi -e npm:pi-vault-mind` to force-load
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### "connection refused"
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
What service?
|
|
36
|
+
├── Ollama → `ollama list`
|
|
37
|
+
│ ├── works → check `wiki.embedding.ollamaHost` in config (default http://127.0.0.1:11434)
|
|
38
|
+
│ └── fails → `ollama serve` or install Ollama
|
|
39
|
+
└── LanceDB → `ls $wiki.dataDir`
|
|
40
|
+
├── exists but unreadable → check permissions
|
|
41
|
+
└── doesn't exist → run `/wiki init` to scaffold
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### "permission denied"
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
Path is to a file or directory?
|
|
48
|
+
├── file → `ls -la $file` — does the user own it?
|
|
49
|
+
│ └── chown or chmod as appropriate
|
|
50
|
+
└── directory → `ls -ld $dir` — does the user have +x (traverse)?
|
|
51
|
+
└── `chmod +x $dir` or fix ownership
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Watcher doesn't fire on save
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
Is the watcher running?
|
|
58
|
+
├── `/wiki watcher status` says STOPPED
|
|
59
|
+
│ └── `/wiki watcher start`
|
|
60
|
+
└── RUNNING but not detecting
|
|
61
|
+
├── Is the vault path correct?
|
|
62
|
+
│ └── check `wiki.vaults` in config
|
|
63
|
+
├── Is the file inside a watched dir?
|
|
64
|
+
│ └── .obsidian/ and .git/ are auto-ignored
|
|
65
|
+
├── Did the file have a recognized marker?
|
|
66
|
+
│ └── format: `@agent-Role[:id] instruction`
|
|
67
|
+
└── Check debounce — 1s after save before processing
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Subagent hangs or never returns
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
Check the child session file
|
|
74
|
+
├── ls ~/.pi/agent/sessions/ | tail -5
|
|
75
|
+
├── Find the most recent forked session
|
|
76
|
+
├── Open the .jsonl — look for "needs_attention" or "interrupted"
|
|
77
|
+
└── If needs_attention:
|
|
78
|
+
├── The child is waiting for input
|
|
79
|
+
├── Resume: subagent({ action: "resume", id: "..." })
|
|
80
|
+
└── Or interrupt: subagent({ action: "interrupt", id: "..." })
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Embedding dimension mismatch
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
Did you switch embedding provider?
|
|
87
|
+
├── transformers (384d) → ollama embeddinggemma (768d)
|
|
88
|
+
│ └── `/wiki reindex --reembed` (drops and recreates tables)
|
|
89
|
+
└── ollama (768d) → transformers (384d)
|
|
90
|
+
└── same fix: `/wiki reindex --reembed`
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Search returns no results
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Is the index populated?
|
|
97
|
+
├── wiki_status shows 0 rows
|
|
98
|
+
│ └── Append a test fact first: `append_wiki(...)`
|
|
99
|
+
│ └── Tables are created lazily on first write
|
|
100
|
+
└── wiki_status shows N rows but search is empty
|
|
101
|
+
├── Wrong collection? `wiki_status` shows per-collection counts
|
|
102
|
+
├── Wrong query? Try broader keywords
|
|
103
|
+
└── Try wiki_fts_search (Tantivy BM25) for exact keyword
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Step 3: Nuclear options
|
|
107
|
+
|
|
108
|
+
When nothing else works, in order of destructiveness:
|
|
109
|
+
|
|
110
|
+
1. **`/wiki validate`** — health check, lists everything that's wrong
|
|
111
|
+
2. **`/wiki reindex --reembed`** — rebuild indexes (slow but safe)
|
|
112
|
+
3. **`/wiki setup` (reconfigure)** — overwrites config (keeps data)
|
|
113
|
+
4. **Delete `$wiki.dataDir`** — DESTROYS all indexed data. JSONL WAL is preserved.
|
|
114
|
+
5. **Reinstall the extension** — `pi remove npm:pi-vault-mind && pi install npm:pi-vault-mind`
|
|
115
|
+
|
|
116
|
+
Always check the JSONL WAL first — that's the source of truth and can be re-indexed from scratch.
|
|
117
|
+
|
|
118
|
+
## Common error messages decoded
|
|
119
|
+
|
|
120
|
+
| Error | What it means | Fix |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| `ENOSPC: no space left on device` | Disk full | Free space, then `/wiki reindex --all` |
|
|
123
|
+
| `EMFILE: too many open files` | `fs.watch` hitting OS limit | `ulimit -n 1024` and restart |
|
|
124
|
+
| `EACCES: permission denied` | Filesystem permissions | `chown` or `chmod` |
|
|
125
|
+
| `ENOTDIR: not a directory` | Path points to a file | Fix the path in config |
|
|
126
|
+
| `Cannot find module '@lancedb/lancedb'` | npm deps not installed | `pnpm install` in extension dir |
|
|
127
|
+
| `EADDRINUSE` (Ollama) | Port 11434 already in use | Kill the other process or change `ollamaHost` |
|
|
128
|
+
| `index out of range` | LanceDB table corruption | `/wiki reindex --all` |
|
|
129
|
+
| `LanceDB version mismatch` | Old data on disk | Delete `$wiki.dataDir` and reindex from JSONL |
|
|
130
|
+
|
|
131
|
+
## Where to find logs
|
|
132
|
+
|
|
133
|
+
| Component | Log location |
|
|
134
|
+
|---|---|
|
|
135
|
+
| pi-vault-mind | `console.log` from extension (visible in pi session) |
|
|
136
|
+
| Watcher | same |
|
|
137
|
+
| LanceDB | `~/.lancedb/` or `$wiki.dataDir/` |
|
|
138
|
+
| Subagent | `~/.pi/agent/sessions/<session-id>.jsonl` |
|
|
139
|
+
| Ollama | `journalctl -u ollama` or `~/.ollama/logs/` |
|
|
140
|
+
| Obsidian | Obsidian console: Ctrl+Shift+I |
|
|
141
|
+
|
|
142
|
+
## When all else fails
|
|
143
|
+
|
|
144
|
+
1. Read the error message slowly
|
|
145
|
+
2. Check `TROUBLESHOOTING.md` in the repo
|
|
146
|
+
3. Run `/wiki validate` and read its output
|
|
147
|
+
4. File an issue: https://github.com/kylebrodeur/pi-vault-mind/issues
|