brainpick 0.1.0__py3-none-any.whl
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.
- brainpick/__init__.py +4 -0
- brainpick/__main__.py +7 -0
- brainpick/_skill/SKILL.md +65 -0
- brainpick/_static/assets/Editor-x4G_0KV0.js +45 -0
- brainpick/_static/assets/index-CTcBQZsl.js +4324 -0
- brainpick/_static/assets/index-Dn6TTKMy.css +1 -0
- brainpick/_static/assets/virtual_pwa-register-Cb81Y-Xh.js +1 -0
- brainpick/_static/assets/workbox-window.prod.es5-BBnX5xw4.js +2 -0
- brainpick/_static/assets/worker-CVB4_RMu.js +1 -0
- brainpick/_static/icons/apple-touch-icon.png +0 -0
- brainpick/_static/icons/favicon.svg +35 -0
- brainpick/_static/icons/icon-192.png +0 -0
- brainpick/_static/icons/icon-512.png +0 -0
- brainpick/_static/icons/icon-maskable-512.png +0 -0
- brainpick/_static/index.html +17 -0
- brainpick/_static/manifest.webmanifest +1 -0
- brainpick/_static/sw.js +1 -0
- brainpick/_static/workbox-a3c94b52.js +1 -0
- brainpick/auth.py +419 -0
- brainpick/cli.py +435 -0
- brainpick/compile/__init__.py +0 -0
- brainpick/compile/pipeline.py +387 -0
- brainpick/compile/similarity_gaps.py +115 -0
- brainpick/compile/t1.py +277 -0
- brainpick/compile/t2.py +280 -0
- brainpick/compile/t3.py +426 -0
- brainpick/config.py +309 -0
- brainpick/core/__init__.py +0 -0
- brainpick/core/bundle.py +173 -0
- brainpick/core/canonical.py +18 -0
- brainpick/core/frontmatter.py +33 -0
- brainpick/core/fs.py +28 -0
- brainpick/core/links.py +37 -0
- brainpick/deltas.py +41 -0
- brainpick/detect.py +215 -0
- brainpick/embed.py +147 -0
- brainpick/integrate.py +180 -0
- brainpick/kg.py +273 -0
- brainpick/kgadapt/__init__.py +13 -0
- brainpick/kgadapt/algorithmic.py +166 -0
- brainpick/kgadapt/protocol.py +162 -0
- brainpick/llm.py +133 -0
- brainpick/mcp_server.py +663 -0
- brainpick/merge.py +218 -0
- brainpick/query/__init__.py +0 -0
- brainpick/query/keyword.py +116 -0
- brainpick/query/present.py +130 -0
- brainpick/query/router.py +140 -0
- brainpick/query/vectors.py +65 -0
- brainpick/scaffold.py +593 -0
- brainpick/serve/__init__.py +1 -0
- brainpick/serve/app.py +210 -0
- brainpick/serve/live.py +68 -0
- brainpick/serve/rest.py +515 -0
- brainpick/serve/state.py +368 -0
- brainpick/serve/watcher.py +76 -0
- brainpick/timeline.py +250 -0
- brainpick/vectorstore.py +155 -0
- brainpick-0.1.0.dist-info/METADATA +67 -0
- brainpick-0.1.0.dist-info/RECORD +63 -0
- brainpick-0.1.0.dist-info/WHEEL +5 -0
- brainpick-0.1.0.dist-info/entry_points.txt +2 -0
- brainpick-0.1.0.dist-info/top_level.txt +1 -0
brainpick/__init__.py
ADDED
brainpick/__main__.py
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainpick
|
|
3
|
+
description: Consult the compiled knowledge brain (a graph of this repo's docs) BEFORE grepping or answering questions about the project. Use whenever a brainpick brain is available — the brain_* MCP tools or the `brainpick` CLI.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# brainpick — pick the brain before you grep
|
|
7
|
+
|
|
8
|
+
This repo (or a folder in it) is compiled into a **brain**: a searchable graph of
|
|
9
|
+
its docs. Reading the brain is faster and truer than grepping raw files — it knows
|
|
10
|
+
titles, descriptions, links, and neighbors.
|
|
11
|
+
|
|
12
|
+
## The rule
|
|
13
|
+
|
|
14
|
+
**Before you grep, glob, or answer a "how does X work?" question, ask the brain.**
|
|
15
|
+
Grep finds strings; the brain finds meaning and the docs around it. Grep only after
|
|
16
|
+
the brain comes up short.
|
|
17
|
+
|
|
18
|
+
Start every session with one call to get oriented, then search.
|
|
19
|
+
|
|
20
|
+
## The five MCP tools
|
|
21
|
+
|
|
22
|
+
Call these if a `brainpick` MCP server is connected (tools are named `brain_*`):
|
|
23
|
+
|
|
24
|
+
- `brain_overview()` — one screen: counts, tiers, every doc grouped by folder. Call first.
|
|
25
|
+
- `brain_search({query})` — find docs by meaning/keyword. Returns paths + descriptions, never full bodies. `mode` is `auto` (default), `keyword`, `semantic`, or `graph`.
|
|
26
|
+
- `brain_read({doc})` — open one doc. `doc` is forgiving: a path (`kuu.md`), a bare stem (`kuu`), or an approximate title. Pass `sections:["Heading"]` to read just parts.
|
|
27
|
+
- `brain_neighbors({doc})` — walk the links around a doc (`depth` 1–3). Find what connects to what.
|
|
28
|
+
- `brain_write({doc, content})` — add a doc, guarded by the repo's contract. See "Writing" below.
|
|
29
|
+
|
|
30
|
+
Every result carries a `hint` naming a sensible next call. Follow it.
|
|
31
|
+
|
|
32
|
+
## The CLI equivalents
|
|
33
|
+
|
|
34
|
+
No MCP server? The same four reads are CLI verbs. Pick the invocation that runs here:
|
|
35
|
+
|
|
36
|
+
- Published (Python): `uvx brainpick search "vuorovesi"` · `read kuu` · `neighbors kuu` · `overview`
|
|
37
|
+
- Dev checkout (Python): `uv run brainpick search "vuorovesi" --root <bundle>`
|
|
38
|
+
- Node engine: `node /path/to/brainpick/dist/cli.js search "vuorovesi"` (or `npx brainpick search …` once published)
|
|
39
|
+
|
|
40
|
+
Add `--json` for machine-readable output, `--root <dir>` to point at the bundle,
|
|
41
|
+
`--mode`/`--limit` on search, `--depth` on neighbors. If the CLI says the brain
|
|
42
|
+
is not compiled, run `brainpick compile --root <bundle>` first.
|
|
43
|
+
|
|
44
|
+
Wire the MCP server into your host with `brainpick mcp` — e.g.
|
|
45
|
+
`claude mcp add brainpick -- uvx brainpick mcp --root <bundle>`.
|
|
46
|
+
|
|
47
|
+
## Writing knowledge back (brain_write)
|
|
48
|
+
|
|
49
|
+
Only write when asked to record knowledge. Follow the wiki's conventions or the
|
|
50
|
+
write is rejected by the contract:
|
|
51
|
+
|
|
52
|
+
- **One concept per page**, filename **kebab-case** `.md` (`kuun-vaiheet.md`).
|
|
53
|
+
- **Frontmatter**: `type` (Concept/Reference/Decision/Playbook), `title`,
|
|
54
|
+
`description`, `timestamp` — the brain bumps `timestamp` for you.
|
|
55
|
+
- **Link generously**; the **link text is the target doc's title** (`[Kuu](kuu.md)`).
|
|
56
|
+
A doc with no links is an orphan.
|
|
57
|
+
- **Optimistic concurrency**: pass `base_sha` = the sha256 of the content you last
|
|
58
|
+
read. On a mismatch nothing is written and you get the current content back —
|
|
59
|
+
re-read, reconcile, retry with the new `base_sha`.
|
|
60
|
+
|
|
61
|
+
## Auth
|
|
62
|
+
|
|
63
|
+
If the brain answers `401`, it wants a bearer token. Send
|
|
64
|
+
`Authorization: Bearer <token>` (mint one with `brainpick token create`). Local
|
|
65
|
+
stdio MCP is never gated.
|