@andespindola/brainlink 0.1.0-alpha.2 → 0.1.0-alpha.4
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/AGENTS.md +5 -1
- package/README.md +21 -4
- package/docs/AGENT_USAGE.md +43 -0
- package/docs/RELEASE.md +1 -0
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -27,12 +27,16 @@ By default, the installed Brainlink CLI uses `$HOME/.brainlink/vault` as its vau
|
|
|
27
27
|
Use this loop when using Brainlink as memory:
|
|
28
28
|
|
|
29
29
|
1. Write durable knowledge into Markdown notes.
|
|
30
|
-
2. Link related notes with `[[Note Title]]
|
|
30
|
+
2. Link related notes with explicit `[[Note Title]]` wiki links inside the note body.
|
|
31
31
|
3. Add explicit `#tags` for retrieval.
|
|
32
32
|
4. Run `index` after writes.
|
|
33
33
|
5. Run `context "<task or question>"` before answering.
|
|
34
34
|
6. Use the returned sources as grounded context.
|
|
35
35
|
|
|
36
|
+
`context` is read-only. It does not create notes, backlinks, graph edges or durable memory by itself. A relationship exists only when a Markdown note contains a `[[wiki link]]` to another note and the vault has been indexed after that write.
|
|
37
|
+
|
|
38
|
+
When an agent adds durable memory, it should connect the new note to at least one existing concept unless the note is intentionally a root concept. Prefer exact note titles in links, for example `[[Architecture]]`, and run `broken-links`, `orphans` or `validate` when the graph looks disconnected.
|
|
39
|
+
|
|
36
40
|
## Commands
|
|
37
41
|
|
|
38
42
|
```bash
|
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ Requirements:
|
|
|
76
76
|
- npm
|
|
77
77
|
|
|
78
78
|
```bash
|
|
79
|
-
npm install -g @andespindola/brainlink
|
|
79
|
+
npm install -g @andespindola/brainlink@latest
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
The package installs two equivalent commands:
|
|
@@ -88,6 +88,14 @@ blink --help
|
|
|
88
88
|
|
|
89
89
|
Use `brainlink` when clarity matters. Use `blink` for faster daily terminal usage.
|
|
90
90
|
|
|
91
|
+
The npm package page may show `npm i @andespindola/brainlink`. That installs
|
|
92
|
+
Brainlink as a project dependency. Use `-g` when you want the terminal commands
|
|
93
|
+
available globally, or run it without a global install:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npx @andespindola/brainlink@latest --help
|
|
97
|
+
```
|
|
98
|
+
|
|
91
99
|
## Agent Autonomous Setup
|
|
92
100
|
|
|
93
101
|
This section is written for agents. If you are an AI agent operating in a user workspace, use this workflow to install and use Brainlink without requiring the user to run commands manually.
|
|
@@ -101,7 +109,7 @@ command -v blink || command -v brainlink
|
|
|
101
109
|
If neither command exists, install it:
|
|
102
110
|
|
|
103
111
|
```bash
|
|
104
|
-
npm install -g @andespindola/brainlink
|
|
112
|
+
npm install -g @andespindola/brainlink@latest
|
|
105
113
|
```
|
|
106
114
|
|
|
107
115
|
Then verify:
|
|
@@ -177,6 +185,15 @@ blink add "Testing Policy" \
|
|
|
177
185
|
--content "Run npm run check before final delivery. Related: [[Release Checklist]]. #testing #process"
|
|
178
186
|
```
|
|
179
187
|
|
|
188
|
+
Brainlink does not infer durable graph relationships from generated context. A context result is only a read package for the model. To create a real link in the knowledge graph, the agent must write Markdown that contains an explicit `[[Note Title]]` wiki link and then rebuild the index.
|
|
189
|
+
|
|
190
|
+
When adding memory, follow this contract:
|
|
191
|
+
|
|
192
|
+
- Link the new note to at least one existing note when there is a related concept.
|
|
193
|
+
- Use the exact target note title inside `[[...]]`.
|
|
194
|
+
- Add retrieval tags such as `#architecture`, `#decision`, `#runbook` or `#preference`.
|
|
195
|
+
- Do not leave isolated notes unless they are intentionally root concepts.
|
|
196
|
+
|
|
180
197
|
Rebuild the index:
|
|
181
198
|
|
|
182
199
|
```bash
|
|
@@ -199,9 +216,9 @@ Use this loop during real work:
|
|
|
199
216
|
2. Run `blink context "<task>" --agent "$BLINK_AGENT" --json`.
|
|
200
217
|
3. Use returned sources as project memory.
|
|
201
218
|
4. Perform the task.
|
|
202
|
-
5. Save only durable learnings with `blink add
|
|
219
|
+
5. Save only durable learnings with `blink add`, including `[[wiki links]]` to related notes.
|
|
203
220
|
6. Run `blink index`.
|
|
204
|
-
7. Validate with `blink validate
|
|
221
|
+
7. Validate with `blink validate`, `blink broken-links` and `blink orphans` when graph links matter.
|
|
205
222
|
|
|
206
223
|
Do not store secrets, credentials, private keys, access tokens or transient chat noise.
|
|
207
224
|
|
package/docs/AGENT_USAGE.md
CHANGED
|
@@ -138,6 +138,41 @@ Rules:
|
|
|
138
138
|
- Prefer summaries over raw transcripts.
|
|
139
139
|
- Preserve dates when the timing matters.
|
|
140
140
|
|
|
141
|
+
## Linking Contract
|
|
142
|
+
|
|
143
|
+
Brainlink only builds graph edges from Markdown `[[wiki links]]`.
|
|
144
|
+
|
|
145
|
+
The `context` command is read-only. It retrieves indexed notes and returns a compact package for the model, but it does not write memory, create backlinks, infer relationships or modify the graph. If an agent reads context and then learns something durable, the agent must write a note with explicit links before that knowledge becomes connected memory.
|
|
146
|
+
|
|
147
|
+
Required write behavior:
|
|
148
|
+
|
|
149
|
+
1. Choose a clear title for the new note.
|
|
150
|
+
2. Look for an existing related concept with `search`, `links` or `backlinks`.
|
|
151
|
+
3. Add at least one `[[Existing Note Title]]` link unless the note is intentionally a root concept.
|
|
152
|
+
4. Add useful `#tags` for retrieval.
|
|
153
|
+
5. Run `index` after the write.
|
|
154
|
+
6. Run `validate`, `broken-links` or `orphans` when the graph should be connected.
|
|
155
|
+
|
|
156
|
+
Good linked note:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
blink add "SQLite Index Rebuild" \
|
|
160
|
+
--agent coding-agent \
|
|
161
|
+
--content "Legacy derived indexes without agent columns are rebuilt because SQLite is disposable. Related: [[Architecture]], [[Agent Namespaces]]. #sqlite #architecture #decision"
|
|
162
|
+
blink index
|
|
163
|
+
blink validate --agent coding-agent
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Poor disconnected note:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
blink add "SQLite Index Rebuild" \
|
|
170
|
+
--agent coding-agent \
|
|
171
|
+
--content "We rebuild old indexes now."
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The poor note may be searchable, but it will not create graph links, backlinks or useful traversal paths.
|
|
175
|
+
|
|
141
176
|
## Read Policy
|
|
142
177
|
|
|
143
178
|
Before answering a memory-dependent question, run:
|
|
@@ -453,6 +488,12 @@ Output:
|
|
|
453
488
|
|
|
454
489
|
Agents should include source paths in their reasoning or final answer when the user needs traceability.
|
|
455
490
|
|
|
491
|
+
Non-goals:
|
|
492
|
+
|
|
493
|
+
- `context` must not be treated as a write operation.
|
|
494
|
+
- Retrieved context must not be assumed to create graph edges.
|
|
495
|
+
- Backlinks are derived only from indexed `[[wiki links]]`.
|
|
496
|
+
|
|
456
497
|
## Operational Rules
|
|
457
498
|
|
|
458
499
|
- Re-run `index` after modifying notes.
|
|
@@ -461,6 +502,8 @@ Agents should include source paths in their reasoning or final answer when the u
|
|
|
461
502
|
- Do not manually edit the database.
|
|
462
503
|
- Keep generated context short enough for the target model.
|
|
463
504
|
- Prefer specific queries over broad queries.
|
|
505
|
+
- Write explicit `[[wiki links]]` when durable memory should be connected.
|
|
506
|
+
- Check `orphans` before assuming the graph is healthy.
|
|
464
507
|
|
|
465
508
|
## Failure Modes
|
|
466
509
|
|
package/docs/RELEASE.md
CHANGED
|
@@ -49,6 +49,7 @@ The preferred path is the `Publish npm` GitHub Actions workflow:
|
|
|
49
49
|
|
|
50
50
|
- GitHub Release `published`: runs checks, pack smoke, then publishes to npm with provenance.
|
|
51
51
|
- Manual `workflow_dispatch`: runs a dry run by default. Disable `dry_run` only for an intentional manual publish.
|
|
52
|
+
- Manual `workflow_dispatch` accepts an optional `dist_tag` override. Use `latest` only when the default npm install command should resolve to that version.
|
|
52
53
|
- Prerelease versions publish under their prerelease dist-tag, for example `0.1.0-alpha.1` publishes with `--tag alpha`.
|
|
53
54
|
|
|
54
55
|
For emergency local publishing of scoped public packages:
|
package/package.json
CHANGED