pi-para 0.5.2 → 0.6.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/ARCHITECTURE.md +160 -0
- package/CHANGELOG.md +51 -0
- package/CONFIGURATION.md +243 -0
- package/README.md +140 -237
- package/SETUP.md +196 -112
- package/STRUCTURE.md +140 -0
- package/package.json +86 -18
- package/scripts/build-assets.mjs +29 -0
- package/scripts/install.ps1 +55 -0
- package/scripts/install.sh +63 -0
- package/scripts/smoke-install.mjs +63 -0
- package/skills/para/SKILL.md +1 -1
- package/skills/setup/SKILL.md +1 -1
- package/src/atomic-write.ts +17 -0
- package/src/capture.ts +4 -4
- package/src/cli-legacy.ts +43 -0
- package/src/cli.ts +133 -28
- package/src/commands.ts +203 -243
- package/src/config.ts +355 -0
- package/src/context.ts +29 -14
- package/src/credentials.ts +100 -0
- package/src/daemon.ts +1 -1
- package/src/doctor.ts +209 -0
- package/src/gepa/index.ts +1 -1
- package/src/index.ts +119 -40
- package/src/maintainer.ts +4 -4
- package/src/model-resolver.ts +96 -0
- package/src/paths.ts +48 -0
- package/src/processor.ts +4 -4
- package/src/qmd-providers.ts +63 -0
- package/src/query.ts +15 -1
- package/src/repair.ts +49 -0
- package/src/scheduler/controls.ts +125 -0
- package/src/scheduler/index.ts +210 -0
- package/src/scheduler/leases.ts +98 -0
- package/src/scheduler/session-capture.ts +146 -0
- package/src/scheduler/state.ts +304 -0
- package/src/session-tools.ts +1 -1
- package/src/settings.ts +126 -0
- package/src/setup.ts +116 -0
- package/src/status.ts +115 -0
- package/src/store.ts +116 -31
- package/src/summarize.ts +72 -16
- package/src/templates/prompts.ts +1 -1
- package/src/tools.ts +280 -90
- package/src/wiki-tool-guidance.ts +84 -0
- package/src/wiki.ts +98 -26
- package/dist/capture.d.ts +0 -34
- package/dist/capture.d.ts.map +0 -1
- package/dist/capture.js +0 -461
- package/dist/capture.js.map +0 -1
- package/dist/cli.d.ts +0 -15
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -405
- package/dist/cli.js.map +0 -1
- package/dist/commands.d.ts +0 -15
- package/dist/commands.d.ts.map +0 -1
- package/dist/commands.js +0 -786
- package/dist/commands.js.map +0 -1
- package/dist/context.d.ts +0 -61
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -289
- package/dist/context.js.map +0 -1
- package/dist/daemon.d.ts +0 -49
- package/dist/daemon.d.ts.map +0 -1
- package/dist/daemon.js +0 -226
- package/dist/daemon.js.map +0 -1
- package/dist/frontmatter.d.ts +0 -59
- package/dist/frontmatter.d.ts.map +0 -1
- package/dist/frontmatter.js +0 -170
- package/dist/frontmatter.js.map +0 -1
- package/dist/gepa/dataset.d.ts +0 -36
- package/dist/gepa/dataset.d.ts.map +0 -1
- package/dist/gepa/dataset.js +0 -148
- package/dist/gepa/dataset.js.map +0 -1
- package/dist/gepa/evaluator.d.ts +0 -51
- package/dist/gepa/evaluator.d.ts.map +0 -1
- package/dist/gepa/evaluator.js +0 -317
- package/dist/gepa/evaluator.js.map +0 -1
- package/dist/gepa/index.d.ts +0 -66
- package/dist/gepa/index.d.ts.map +0 -1
- package/dist/gepa/index.js +0 -240
- package/dist/gepa/index.js.map +0 -1
- package/dist/gepa/llm.d.ts +0 -35
- package/dist/gepa/llm.d.ts.map +0 -1
- package/dist/gepa/llm.js +0 -268
- package/dist/gepa/llm.js.map +0 -1
- package/dist/gepa/optimized/capture-prompt.txt +0 -65
- package/dist/gepa/optimizer.d.ts +0 -29
- package/dist/gepa/optimizer.d.ts.map +0 -1
- package/dist/gepa/optimizer.js +0 -249
- package/dist/gepa/optimizer.js.map +0 -1
- package/dist/gepa/targets.d.ts +0 -39
- package/dist/gepa/targets.d.ts.map +0 -1
- package/dist/gepa/targets.js +0 -326
- package/dist/gepa/targets.js.map +0 -1
- package/dist/gepa/types.d.ts +0 -168
- package/dist/gepa/types.d.ts.map +0 -1
- package/dist/gepa/types.js +0 -124
- package/dist/gepa/types.js.map +0 -1
- package/dist/index.d.ts +0 -21
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -294
- package/dist/index.js.map +0 -1
- package/dist/ingest.d.ts +0 -88
- package/dist/ingest.d.ts.map +0 -1
- package/dist/ingest.js +0 -105
- package/dist/ingest.js.map +0 -1
- package/dist/link-discovery.d.ts +0 -40
- package/dist/link-discovery.d.ts.map +0 -1
- package/dist/link-discovery.js +0 -122
- package/dist/link-discovery.js.map +0 -1
- package/dist/link-utils.d.ts +0 -30
- package/dist/link-utils.d.ts.map +0 -1
- package/dist/link-utils.js +0 -145
- package/dist/link-utils.js.map +0 -1
- package/dist/lint.d.ts +0 -39
- package/dist/lint.d.ts.map +0 -1
- package/dist/lint.js +0 -827
- package/dist/lint.js.map +0 -1
- package/dist/maintainer.d.ts +0 -24
- package/dist/maintainer.d.ts.map +0 -1
- package/dist/maintainer.js +0 -358
- package/dist/maintainer.js.map +0 -1
- package/dist/processor.d.ts +0 -14
- package/dist/processor.d.ts.map +0 -1
- package/dist/processor.js +0 -361
- package/dist/processor.js.map +0 -1
- package/dist/query.d.ts +0 -69
- package/dist/query.d.ts.map +0 -1
- package/dist/query.js +0 -107
- package/dist/query.js.map +0 -1
- package/dist/raw.d.ts +0 -57
- package/dist/raw.d.ts.map +0 -1
- package/dist/raw.js +0 -219
- package/dist/raw.js.map +0 -1
- package/dist/redact.d.ts +0 -21
- package/dist/redact.d.ts.map +0 -1
- package/dist/redact.js +0 -143
- package/dist/redact.js.map +0 -1
- package/dist/scope.d.ts +0 -54
- package/dist/scope.d.ts.map +0 -1
- package/dist/scope.js +0 -161
- package/dist/scope.js.map +0 -1
- package/dist/scripts/bulk-link-fix.d.ts +0 -9
- package/dist/scripts/bulk-link-fix.d.ts.map +0 -1
- package/dist/scripts/bulk-link-fix.js +0 -106
- package/dist/scripts/bulk-link-fix.js.map +0 -1
- package/dist/session-tools.d.ts +0 -33
- package/dist/session-tools.d.ts.map +0 -1
- package/dist/session-tools.js +0 -211
- package/dist/session-tools.js.map +0 -1
- package/dist/state.d.ts +0 -54
- package/dist/state.d.ts.map +0 -1
- package/dist/state.js +0 -176
- package/dist/state.js.map +0 -1
- package/dist/store.d.ts +0 -56
- package/dist/store.d.ts.map +0 -1
- package/dist/store.js +0 -227
- package/dist/store.js.map +0 -1
- package/dist/summarize.d.ts +0 -56
- package/dist/summarize.d.ts.map +0 -1
- package/dist/summarize.js +0 -231
- package/dist/summarize.js.map +0 -1
- package/dist/tag-registry.d.ts +0 -56
- package/dist/tag-registry.d.ts.map +0 -1
- package/dist/tag-registry.js +0 -146
- package/dist/tag-registry.js.map +0 -1
- package/dist/templates/prompts.d.ts +0 -63
- package/dist/templates/prompts.d.ts.map +0 -1
- package/dist/templates/prompts.js +0 -260
- package/dist/templates/prompts.js.map +0 -1
- package/dist/tools.d.ts +0 -26
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -1033
- package/dist/tools.js.map +0 -1
- package/dist/watcher.d.ts +0 -25
- package/dist/watcher.d.ts.map +0 -1
- package/dist/watcher.js +0 -84
- package/dist/watcher.js.map +0 -1
- package/dist/webui/client/dist/index.html +0 -1885
- package/dist/webui/server.d.ts +0 -31
- package/dist/webui/server.d.ts.map +0 -1
- package/dist/webui/server.js +0 -566
- package/dist/webui/server.js.map +0 -1
- package/dist/wiki.d.ts +0 -103
- package/dist/wiki.d.ts.map +0 -1
- package/dist/wiki.js +0 -428
- package/dist/wiki.js.map +0 -1
- package/scripts/gepa/__pycache__/dataset.cpython-313.pyc +0 -0
- package/scripts/gepa/__pycache__/lm_providers.cpython-313.pyc +0 -0
- package/scripts/gepa/__pycache__/metric.cpython-313.pyc +0 -0
- package/scripts/gepa/__pycache__/program.cpython-313.pyc +0 -0
- package/scripts/gepa/__pycache__/wiki_reader.cpython-313.pyc +0 -0
- package/scripts/gepa/uv.lock +0 -2241
package/README.md
CHANGED
|
@@ -1,287 +1,184 @@
|
|
|
1
1
|
# pi-para
|
|
2
2
|
|
|
3
|
-
A [pi](https://github.com/badlogic/pi-mono) extension that maintains a persistent, LLM-curated personal knowledge base structured by the [PARA method](https://fortelabs.com/blog/para/)
|
|
3
|
+
A [pi](https://github.com/badlogic/pi-mono) extension that maintains a persistent, LLM-curated personal knowledge base structured by the [PARA method](https://fortelabs.com/blog/para/) — Projects, Areas, Resources, Archives.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
pi-para runs as a normal Pi extension: no required daemon, no `systemd`, and no global QMD CLI. Search/indexing uses the embedded QMD SDK, and background capture/maintenance is coordinated by an in-process scheduler while Pi is open.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
pi install
|
|
10
|
+
pi install pi-para
|
|
11
|
+
# or, for npm/npx setup flows:
|
|
12
|
+
npx pi-para@latest setup
|
|
11
13
|
```
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
POSIX one-liner:
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
```bash
|
|
18
|
+
curl -fsSL https://raw.githubusercontent.com/picassio/pi-para/main/scripts/install.sh | bash
|
|
19
|
+
```
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
Windows PowerShell:
|
|
18
22
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
| `wiki_query` | Search the wiki with scope filtering, graph boost, freshness indicators |
|
|
23
|
-
| `wiki_write` | Create or update wiki pages |
|
|
24
|
-
| `wiki_read` | Read a specific wiki page + freshness indicator |
|
|
25
|
-
| `wiki_move` | Move pages between PARA categories |
|
|
26
|
-
| `wiki_lint` | Run health checks and auto-fix |
|
|
27
|
-
| `wiki_summarize` | Summarize pages, categories, or entire wiki |
|
|
28
|
-
| `wiki_migrate` | Batch-migrate all pages to current schema version |
|
|
29
|
-
|
|
30
|
-
### Commands (11)
|
|
31
|
-
|
|
32
|
-
| Command | Description |
|
|
33
|
-
|---------|-------------|
|
|
34
|
-
| `/wiki` | Status overview (scope, pages, log) |
|
|
35
|
-
| `/wiki-search <query>` | Search the wiki |
|
|
36
|
-
| `/wiki-ingest <url>` | Quick ingest |
|
|
37
|
-
| `/wiki-capture [topic]` | Ask LLM to save knowledge via wiki_write |
|
|
38
|
-
| `/wiki-scope` | Show or override project scope |
|
|
39
|
-
| `/wiki-lint` | Run health checks |
|
|
40
|
-
| `/wiki-summarize [target]` | Summarize wiki content |
|
|
41
|
-
| `/wiki-settings` | Interactive settings (search, context, daemon, web UI, providers) |
|
|
42
|
-
| `/wiki-daemon <cmd>` | Manage background capture daemon |
|
|
43
|
-
| `/wiki-migrate` | Migrate all pages to current schema version |
|
|
44
|
-
| `/wiki-project <name> <goal>` | Create or archive (`done`) a project page |
|
|
23
|
+
```powershell
|
|
24
|
+
irm https://raw.githubusercontent.com/picassio/pi-para/main/scripts/install.ps1 | iex
|
|
25
|
+
```
|
|
45
26
|
|
|
46
|
-
|
|
27
|
+
Restart Pi after installing or changing extension registration.
|
|
47
28
|
|
|
48
|
-
|
|
29
|
+
Then run:
|
|
49
30
|
|
|
31
|
+
```bash
|
|
32
|
+
pi-para doctor
|
|
50
33
|
```
|
|
51
|
-
|
|
34
|
+
|
|
35
|
+
## What pi-para creates
|
|
36
|
+
|
|
37
|
+
Default user files:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
~/.pi/para/config.jsonc # canonical pi-para config
|
|
41
|
+
~/.pi/para/secrets.json # optional local secrets, chmod 0600
|
|
42
|
+
~/.pi/wiki/ # PARA markdown wiki
|
|
43
|
+
~/.pi/wiki/.pi-para.sqlite # scheduler queue/history/leases
|
|
44
|
+
~/.pi/wiki/.qmd.sqlite # QMD SDK search index
|
|
52
45
|
```
|
|
53
46
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
- Inline page editor
|
|
58
|
-
- D3 force-directed graph view (page relationships)
|
|
59
|
-
- Search
|
|
60
|
-
- Move pages between categories
|
|
61
|
-
- Activity log and session digests
|
|
62
|
-
- Mobile-first responsive design, dark/light theme
|
|
47
|
+
Legacy files such as `~/.pi/wiki/config.json`, `~/.pi/wiki/.daemon.sqlite`, and `~/.config/qmd/index.yml` are still read for migration/compatibility.
|
|
48
|
+
|
|
49
|
+
## Core commands
|
|
63
50
|
|
|
64
|
-
###
|
|
51
|
+
### Pi slash commands
|
|
65
52
|
|
|
66
|
-
|
|
53
|
+
| Command | Description |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `/wiki` | Wiki status, current scope, page counts, recent log |
|
|
56
|
+
| `/wiki-search <query>` | Search the wiki |
|
|
57
|
+
| `/wiki-ingest <url-or-path-or-text>` | Ingest a source into `raw/` and synthesize pages |
|
|
58
|
+
| `/wiki-capture [topic]` | Queue/capture current session knowledge |
|
|
59
|
+
| `/wiki-scope [scope]` | Show or override current project scope |
|
|
60
|
+
| `/wiki-lint [--report-only]` | Run wiki health checks |
|
|
61
|
+
| `/wiki-summarize [target]` | Summarize a page/category/all |
|
|
62
|
+
| `/wiki-settings` | Interactive settings for config/providers/scheduler |
|
|
63
|
+
| `/wiki-scheduler [status\|queue\|history\|capture-history]` | Scheduler/capture observability |
|
|
64
|
+
| `/wiki-daemon ...` | Compatibility alias for `/wiki-scheduler` |
|
|
65
|
+
| `/wiki-migrate` | Batch-migrate pages to current schema |
|
|
66
|
+
| `/wiki-project <name> <goal>` | Create/archive project pages |
|
|
67
|
+
|
|
68
|
+
### CLI
|
|
67
69
|
|
|
68
70
|
```bash
|
|
69
|
-
|
|
70
|
-
pi-para
|
|
71
|
+
pi-para setup [--yes] [--dry-run] [--local PATH]
|
|
72
|
+
pi-para doctor [--fix] [--json] [--test-capture-model]
|
|
73
|
+
pi-para tasks [--status queued|running|done|failed]
|
|
74
|
+
pi-para tasks show <id>
|
|
75
|
+
pi-para tasks history [--task NAME] [--limit N]
|
|
76
|
+
pi-para tasks retry [--task NAME]
|
|
77
|
+
pi-para status [--json]
|
|
78
|
+
pi-para capture-recent --hours 24
|
|
79
|
+
pi-para providers
|
|
80
|
+
pi-para providers set-secret <name> <value>
|
|
81
|
+
pi-para providers remove-secret <name>
|
|
82
|
+
pi-para gepa optimize --target capture-prompt
|
|
83
|
+
```
|
|
71
84
|
|
|
72
|
-
|
|
73
|
-
pi-para-daemon gepa optimize --target capture-prompt
|
|
85
|
+
`pi-para-daemon` remains as a temporary compatibility binary, but the primary runtime is the in-process scheduler. Legacy daemon status is available as `pi-para legacy-status` for troubleshooting old installs.
|
|
74
86
|
|
|
75
|
-
|
|
76
|
-
bash scripts/gepa/run-all.sh
|
|
87
|
+
## Tools available to agents
|
|
77
88
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
| Tool | Description |
|
|
90
|
+
|---|---|
|
|
91
|
+
| `wiki_ingest` | Ingest URL/file/text into the wiki |
|
|
92
|
+
| `wiki_query` | Search with scope/category/freshness context |
|
|
93
|
+
| `wiki_edit` | Atomic exact `oldText → newText` page edits |
|
|
94
|
+
| `wiki_write` | Create/append/replace pages, or legacy edit mode |
|
|
95
|
+
| `wiki_read` | Read a page with freshness indicator |
|
|
96
|
+
| `wiki_move` | Move a page between PARA categories |
|
|
97
|
+
| `wiki_lint` | Run health checks and optional autofix |
|
|
98
|
+
| `wiki_migrate` | Batch-migrate pages to current schema |
|
|
99
|
+
| `wiki_summarize` | Summarize pages/categories/all |
|
|
83
100
|
|
|
84
|
-
|
|
85
|
-
pi-para-daemon gepa optimize --model anthropic/claude-sonnet-4-20250514 --reflection-model anthropic/claude-opus-4-6
|
|
101
|
+
Prefer `wiki_edit` for surgical updates to existing pages.
|
|
86
102
|
|
|
87
|
-
|
|
88
|
-
pi-para-daemon gepa list
|
|
103
|
+
## Configuration
|
|
89
104
|
|
|
90
|
-
|
|
91
|
-
pi-para-daemon gepa compare --target capture-prompt
|
|
92
|
-
```
|
|
105
|
+
Use `/wiki-settings` or edit:
|
|
93
106
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
1. TypeScript extracts all prompt/tool/skill texts from source files
|
|
97
|
-
2. Calls `uv run scripts/gepa/optimize.py` with API keys from `~/.pi/agent/auth.json`
|
|
98
|
-
3. Python builds a trainset from real wiki pages (93 pages → 30 train / 20 val)
|
|
99
|
-
4. DSPy GEPA evolves each instruction using a lightweight proxy module (1 LLM call per eval, not 10-50)
|
|
100
|
-
5. **Teacher** (Opus) proposes instruction mutations based on metric feedback
|
|
101
|
-
6. **Student** (Sonnet) runs the proxy to generate output from the instruction
|
|
102
|
-
7. **Judge** (Sonnet) scores on 6 dimensions: structure, PARA compliance, cross-references, security, completeness, actionability
|
|
103
|
-
8. Optimized prompts saved to `~/.pi/wiki/gepa/optimized/`
|
|
104
|
-
|
|
105
|
-
**Teacher/Student/Judge pattern** (DSPy GEPA):
|
|
106
|
-
|
|
107
|
-
| Role | Default Model | What It Does | Calls/target |
|
|
108
|
-
|------|---------------|--------------|--------|
|
|
109
|
-
| **Student** | `claude-sonnet-4` | Runs proxy (generates wiki output) | ~460 |
|
|
110
|
-
| **Teacher** | `claude-opus-4-6` | Proposes mutations via reflection | ~30 |
|
|
111
|
-
| **Judge** | `claude-sonnet-4` | Scores output (LLM-as-judge metric) | ~460 |
|
|
112
|
-
|
|
113
|
-
**22 optimization targets:**
|
|
114
|
-
|
|
115
|
-
| Category | Targets |
|
|
116
|
-
|----------|--------|
|
|
117
|
-
| Prompt templates (12) | System, ingest, query, capture (×3), maintenance, processor, summarize, iterative, overview, lint |
|
|
118
|
-
| Tool instructions (8) | wiki_ingest, wiki_query, wiki_write, wiki_read, wiki_move, wiki_lint, wiki_migrate, wiki_summarize |
|
|
119
|
-
| Skills (2) | para (active PARA workflow), setup (installation guide) |
|
|
120
|
-
|
|
121
|
-
**LLM providers** (custom `dspy.BaseLM` subclasses, no litellm):
|
|
122
|
-
|
|
123
|
-
| Provider | Auth | Notes |
|
|
124
|
-
|----------|------|-------|
|
|
125
|
-
| Anthropic | OAuth token from `auth.json` | Claude Code billing headers + user-agent, auto token refresh |
|
|
126
|
-
| MiniMax | API key | Via Anthropic-compatible API |
|
|
127
|
-
| OpenRouter | API key | Via OpenAI-compatible API |
|
|
128
|
-
|
|
129
|
-
**Configuration** (`~/.pi/wiki/config.json`):
|
|
130
|
-
|
|
131
|
-
```json
|
|
132
|
-
{
|
|
133
|
-
"gepa": {
|
|
134
|
-
"useOptimized": true,
|
|
135
|
-
"studentModel": "anthropic/claude-sonnet-4-20250514",
|
|
136
|
-
"teacherModel": "anthropic/claude-opus-4-6",
|
|
137
|
-
"judgeModel": null,
|
|
138
|
-
"auto": "light",
|
|
139
|
-
"threads": 2,
|
|
140
|
-
"seed": 42
|
|
141
|
-
}
|
|
142
|
-
}
|
|
107
|
+
```text
|
|
108
|
+
~/.pi/para/config.jsonc
|
|
143
109
|
```
|
|
144
110
|
|
|
145
|
-
|
|
146
|
-
- `studentModel` — fast model for running proxy + judging (Sonnet recommended)
|
|
147
|
-
- `teacherModel` — smart model for proposing mutations (Opus recommended)
|
|
148
|
-
- `judgeModel` — model for scoring output (defaults to studentModel if null)
|
|
149
|
-
- All settings overridable via CLI flags
|
|
111
|
+
Credential refs use one of:
|
|
150
112
|
|
|
151
|
-
|
|
113
|
+
```text
|
|
114
|
+
pi-auth:<provider> # Pi AuthStorage, e.g. ~/.pi/agent/auth.json
|
|
115
|
+
secret:<name> # ~/.pi/para/secrets.json
|
|
116
|
+
none # local/no-auth provider
|
|
117
|
+
```
|
|
152
118
|
|
|
153
|
-
|
|
119
|
+
Setup does not require or write API-key environment variables.
|
|
154
120
|
|
|
155
|
-
|
|
156
|
-
|--------|----------|---------------|-------------|
|
|
157
|
-
| `light` | ~460 | 1-2 hours | Quick sanity check |
|
|
158
|
-
| `medium` | ~1500 | 4-6 hours | Everyday optimization |
|
|
159
|
-
| `heavy` | ~5000 | 12-24 hours | Final tuning |
|
|
121
|
+
See [CONFIGURATION.md](./CONFIGURATION.md) for the full schema.
|
|
160
122
|
|
|
161
|
-
|
|
123
|
+
## Search and QMD
|
|
162
124
|
|
|
163
|
-
|
|
125
|
+
QMD is used as an embedded SDK through `qmd-engine`; users do not need to install a global `qmd` CLI.
|
|
164
126
|
|
|
165
|
-
|
|
127
|
+
- BM25 keyword search works immediately.
|
|
128
|
+
- Embedding/rerank can be configured in `/wiki-settings` or `~/.pi/para/config.jsonc`.
|
|
129
|
+
- Legacy `~/.config/qmd/index.yml` is only a compatibility fallback.
|
|
166
130
|
|
|
167
|
-
|
|
168
|
-
# Via extension command
|
|
169
|
-
/wiki-daemon start
|
|
170
|
-
/wiki-daemon status
|
|
131
|
+
## Background capture and maintenance
|
|
171
132
|
|
|
172
|
-
|
|
173
|
-
pi-para-daemon start
|
|
174
|
-
pi-para-daemon process-recent --hours 24
|
|
175
|
-
```
|
|
133
|
+
When Pi is running, pi-para starts an in-process scheduler. It handles:
|
|
176
134
|
|
|
177
|
-
|
|
135
|
+
- queued session capture,
|
|
136
|
+
- startup catch-up from `.completed-sessions`,
|
|
137
|
+
- index/search maintenance,
|
|
138
|
+
- queue/history/lease tracking in `.pi-para.sqlite`.
|
|
178
139
|
|
|
179
|
-
|
|
140
|
+
No background OS service is required. If Pi is closed, queued work resumes on the next Pi session.
|
|
180
141
|
|
|
181
|
-
##
|
|
142
|
+
## Web Wiki UI
|
|
182
143
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
├── index.md # page catalog (auto-rebuilt)
|
|
188
|
-
├── log.md # activity log
|
|
189
|
-
├── sessions.md # session digest log
|
|
190
|
-
├── .completed-sessions # daemon registry
|
|
191
|
-
├── .daemon.sqlite # daemon state
|
|
192
|
-
├── .qmd.sqlite # search index
|
|
193
|
-
├── projects/ # active, goal-defined work
|
|
194
|
-
├── areas/ # ongoing responsibilities
|
|
195
|
-
├── resources/ # reference material
|
|
196
|
-
├── archives/ # completed/deprecated
|
|
197
|
-
├── raw/ # immutable source material
|
|
198
|
-
└── gepa/ # GEPA optimizer state
|
|
199
|
-
├── input/ # targets.json (generated per run)
|
|
200
|
-
├── output/ # results.json (GEPA output)
|
|
201
|
-
├── optimized/ # deployed optimized prompts (*.txt)
|
|
202
|
-
└── history/ # version history per target
|
|
144
|
+
The optional web wiki can be enabled from `/wiki-settings`:
|
|
145
|
+
|
|
146
|
+
```text
|
|
147
|
+
/wiki-settings → [WebWiki] Enabled
|
|
203
148
|
```
|
|
204
149
|
|
|
205
|
-
|
|
150
|
+
It serves the wiki viewer/editor/graph on the configured host/port.
|
|
206
151
|
|
|
207
|
-
|
|
208
|
-
scripts/gepa/
|
|
209
|
-
├── pyproject.toml # uv project (dspy, anthropic, openai deps)
|
|
210
|
-
├── optimize.py # Main entry — runs DSPy GEPA
|
|
211
|
-
├── lm_providers.py # Custom BaseLM: AnthropicOAuthLM, MiniMaxLM, OpenRouterLM
|
|
212
|
-
├── program.py # PromptProxy DSPy Module (1 LLM call per eval)
|
|
213
|
-
├── metric.py # LLM-as-judge metric (6 dimensions)
|
|
214
|
-
├── dataset.py # Build train/val from real wiki pages
|
|
215
|
-
└── wiki_reader.py # Read wiki pages from disk
|
|
216
|
-
```
|
|
152
|
+
## GEPA Prompt Optimizer
|
|
217
153
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
1. **During a session** — LLM uses wiki tools (query, write, ingest). Context injection provides wiki knowledge on every turn.
|
|
221
|
-
2. **On /quit** — session registered in `.completed-sessions` (instant, <10ms)
|
|
222
|
-
3. **Background** — daemon picks up session, Agent explores with tools, writes wiki pages
|
|
223
|
-
4. **Next session** — new wiki pages appear in context injection
|
|
224
|
-
|
|
225
|
-
### Freshness Verification
|
|
226
|
-
|
|
227
|
-
Every `wiki_query` and `wiki_read` result includes a freshness indicator based on the page's last-updated date:
|
|
228
|
-
|
|
229
|
-
| Age | Indicator | LLM Behavior |
|
|
230
|
-
|-----|-----------|---------------|
|
|
231
|
-
| < 7 days | ✅ FRESH | Trust normally |
|
|
232
|
-
| 7-14 days | ✅ Recent | Trust normally |
|
|
233
|
-
| 14-30 days | ⚠️ AGING | Verify claims about code/configs before trusting |
|
|
234
|
-
| 30-90 days | ⚠️ STALE | Verify before trusting |
|
|
235
|
-
| > 90 days | 🚨 VERY STALE | Likely outdated, verify everything |
|
|
236
|
-
|
|
237
|
-
The LLM is instructed to:
|
|
238
|
-
- **Verify** stale claims by checking actual code, configs, or files
|
|
239
|
-
- **Self-heal** — fix incorrect wiki pages via `wiki_write(mode: 'edit')` when it discovers they're wrong
|
|
240
|
-
- **Flag uncertainty** — tell the user when a claim can't be verified (e.g. external services)
|
|
241
|
-
|
|
242
|
-
### Configuration
|
|
243
|
-
|
|
244
|
-
All settings via `/wiki-settings` interactive menu, or edit `~/.pi/wiki/config.json`:
|
|
245
|
-
|
|
246
|
-
```json
|
|
247
|
-
{
|
|
248
|
-
"contextMaxTokens": 4000,
|
|
249
|
-
"searchLimit": 10,
|
|
250
|
-
"searchGraphBoost": true,
|
|
251
|
-
"lintAutoFix": true,
|
|
252
|
-
"lintStaleDays": 90,
|
|
253
|
-
"daemonModel": null,
|
|
254
|
-
"webWiki": { "enabled": true, "host": "0.0.0.0", "port": 10973 },
|
|
255
|
-
"gepa": { "useOptimized": false }
|
|
256
|
-
}
|
|
257
|
-
```
|
|
154
|
+
pi-para can optimize prompts/tools/skills using DSPy GEPA via `uv` and custom DSPy `BaseLM` providers.
|
|
258
155
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
```yaml
|
|
262
|
-
providers:
|
|
263
|
-
embed:
|
|
264
|
-
url: https://openrouter.ai/api/v1
|
|
265
|
-
key: sk-or-...
|
|
266
|
-
model: openai/text-embedding-3-small
|
|
267
|
-
chat:
|
|
268
|
-
url: https://api.minimaxi.com/anthropic
|
|
269
|
-
key: sk-cp-...
|
|
270
|
-
model: MiniMax-M2.7-highspeed
|
|
271
|
-
api: anthropic
|
|
272
|
-
```
|
|
156
|
+
Recommended roles:
|
|
273
157
|
|
|
274
|
-
|
|
158
|
+
| Role | Default |
|
|
159
|
+
|---|---|
|
|
160
|
+
| Student | `anthropic/claude-sonnet-4-20250514` |
|
|
161
|
+
| Teacher/reflection | `anthropic/claude-opus-4-6` |
|
|
162
|
+
| Judge | `anthropic/claude-sonnet-4-20250514` |
|
|
163
|
+
|
|
164
|
+
Examples:
|
|
275
165
|
|
|
276
166
|
```bash
|
|
277
|
-
|
|
167
|
+
pi-para gepa targets
|
|
168
|
+
pi-para gepa optimize --target capture-prompt
|
|
169
|
+
pi-para gepa optimize --target skill-para \
|
|
170
|
+
--student-model anthropic/claude-sonnet-4-20250514 \
|
|
171
|
+
--teacher-model anthropic/claude-opus-4-6 \
|
|
172
|
+
--judge-model anthropic/claude-sonnet-4-20250514
|
|
173
|
+
pi-para gepa list
|
|
174
|
+
pi-para gepa compare --target capture-prompt
|
|
278
175
|
```
|
|
279
176
|
|
|
280
|
-
|
|
177
|
+
GEPA uses `~/.pi/agent/auth.json`/custom providers; it does not use LiteLLM.
|
|
281
178
|
|
|
282
|
-
## Obsidian
|
|
179
|
+
## Obsidian compatibility
|
|
283
180
|
|
|
284
|
-
The wiki is
|
|
181
|
+
The wiki is plain markdown with YAML frontmatter and `[[wikilinks]]`. You can open `~/.pi/wiki/` as an Obsidian vault.
|
|
285
182
|
|
|
286
183
|
## Development
|
|
287
184
|
|
|
@@ -289,16 +186,22 @@ The wiki is a directory of markdown files with YAML frontmatter and `[[wikilinks
|
|
|
289
186
|
git clone https://github.com/picassio/pi-para.git
|
|
290
187
|
cd pi-para
|
|
291
188
|
npm install
|
|
292
|
-
npm run check
|
|
293
|
-
npm test
|
|
294
|
-
npm run
|
|
189
|
+
npm run check
|
|
190
|
+
npm test
|
|
191
|
+
npm run test:coverage
|
|
192
|
+
npm run build
|
|
193
|
+
npm run smoke:install
|
|
194
|
+
|
|
195
|
+
# Local setup into Pi settings
|
|
196
|
+
node ./dist/cli.js setup --local .
|
|
197
|
+
```
|
|
295
198
|
|
|
296
|
-
|
|
297
|
-
ln -sf $(pwd) ~/.pi/agent/extensions/pi-para
|
|
199
|
+
More docs:
|
|
298
200
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
201
|
+
- [SETUP.md](./SETUP.md)
|
|
202
|
+
- [ARCHITECTURE.md](./ARCHITECTURE.md)
|
|
203
|
+
- [STRUCTURE.md](./STRUCTURE.md)
|
|
204
|
+
- [CONFIGURATION.md](./CONFIGURATION.md)
|
|
302
205
|
|
|
303
206
|
## License
|
|
304
207
|
|