@korrlabs/mnemos-pi 2.15.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 +384 -0
- package/README.ru.md +378 -0
- package/integrations/extensions/mnemos-mcp.ts +178 -0
- package/integrations/skills/.gitkeep +2 -0
- package/integrations/skills/mnemos-agent-recall.md +53 -0
- package/integrations/skills/mnemos-cache-align.md +48 -0
- package/integrations/skills/mnemos-checkpoint.md +72 -0
- package/integrations/skills/mnemos-compress.md +52 -0
- package/integrations/skills/mnemos-exchange.md +55 -0
- package/integrations/skills/mnemos-filter.md +56 -0
- package/integrations/skills/mnemos-housekeeping.md +66 -0
- package/integrations/skills/mnemos-ingest.md +51 -0
- package/integrations/skills/mnemos-recall.md +87 -0
- package/integrations/skills/mnemos-session-init.md +68 -0
- package/integrations/skills/mnemos-tag-contract.md +104 -0
- package/integrations/skills/mnemos-watch.md +52 -0
- package/integrations/skills/mnemos-workflow.md +53 -0
- package/integrations/skills/mnemos-write.md +94 -0
- package/package.json +59 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mnemos-checkpoint
|
|
3
|
+
description: Save a compaction-resilient checkpoint mid-session — survives context compression and session restart
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mnemos Checkpoint
|
|
7
|
+
|
|
8
|
+
Write a snapshot every time the session reaches a meaningful milestone or
|
|
9
|
+
signals compaction. The checkpoint is what the agent reads back after
|
|
10
|
+
compaction to recover state.
|
|
11
|
+
|
|
12
|
+
## WHEN
|
|
13
|
+
|
|
14
|
+
- **Just finished a multi-step phase** — a batch of files saved, a test suite
|
|
15
|
+
fixed, a refactor completed.
|
|
16
|
+
- **About to invoke an expensive subagent chain** — before delegating to a
|
|
17
|
+
worker that may consume significant context.
|
|
18
|
+
- **User confirmed a non-trivial decision** — before moving on.
|
|
19
|
+
- **Compaction signal detected** — summary banner, long conversation
|
|
20
|
+
(≳30 turns since last checkpoint), `mnemos_auto_collect_status` recommends
|
|
21
|
+
checkpoint, or sudden loss of earlier-turn references.
|
|
22
|
+
- **Before a long step** — when the next action will consume many turns.
|
|
23
|
+
|
|
24
|
+
## STEPS
|
|
25
|
+
|
|
26
|
+
1. Compose the checkpoint content:
|
|
27
|
+
|
|
28
|
+
| Field | Content |
|
|
29
|
+
|-------|---------|
|
|
30
|
+
| `goals` | The active goal in one sentence. |
|
|
31
|
+
| `completed` | Recent completed items (≤7 bullets). |
|
|
32
|
+
| `in_progress` | The immediate next action (one bullet). |
|
|
33
|
+
| `decisions` | Decisions worth surviving compaction (bullets). |
|
|
34
|
+
| `context` | File paths, architecture notes, gotchas (free text). |
|
|
35
|
+
|
|
36
|
+
2. Save the checkpoint:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
mnemos_save_context(
|
|
40
|
+
project=<current-project>,
|
|
41
|
+
goals=<one sentence>,
|
|
42
|
+
completed=<bullets>,
|
|
43
|
+
in_progress=<one bullet>,
|
|
44
|
+
decisions=<bullets>,
|
|
45
|
+
context=<file paths, notes>
|
|
46
|
+
)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
3. Confirm with a one-line notice:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
mnemos: checkpoint saved (project=<name>)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## DISCIPLINE
|
|
56
|
+
|
|
57
|
+
- **Idempotent within a session.** Re-saving shortly after a previous
|
|
58
|
+
checkpoint should update the latest checkpoint, not create duplicates.
|
|
59
|
+
- **Keep the body short.** The checkpoint is for waking up after compaction,
|
|
60
|
+
not for archival. ≤7 bullets per field.
|
|
61
|
+
- **Never block on checkpoint failure.** If `mnemos_save_context` errors,
|
|
62
|
+
log a one-line notice and continue. Memory is an enhancement, not a
|
|
63
|
+
dependency.
|
|
64
|
+
- **Do not checkpoint on a timer.** Write on signals (phase done, compaction
|
|
65
|
+
detected), not every N turns. Timer-based checkpoints create noise.
|
|
66
|
+
- **Include the next action.** A checkpoint without `in_progress` leaves the
|
|
67
|
+
post-compaction agent without a starting point.
|
|
68
|
+
|
|
69
|
+
## See also
|
|
70
|
+
|
|
71
|
+
- Skill `mnemos-session-init` — recall at session start
|
|
72
|
+
- Instruction `mnemos-session-lifecycle.instructions.md`
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mnemos-compress
|
|
3
|
+
description: Zero-loss compression of huge tool outputs — keep context small, fetch the original back on demand
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mnemos Compress (CCR)
|
|
7
|
+
|
|
8
|
+
Compress oversized tool output (logs, JSON, build logs) with ZERO data loss
|
|
9
|
+
before pasting it into context. The original is cached server-side; a marker
|
|
10
|
+
hash lets you retrieve it later.
|
|
11
|
+
|
|
12
|
+
## WHEN
|
|
13
|
+
|
|
14
|
+
- **A tool returned >500 lines / huge JSON** that you only partly need now.
|
|
15
|
+
- **Long command output** where the gist matters but details may matter
|
|
16
|
+
later.
|
|
17
|
+
- **Before writing a memory entry** that quotes a big blob — store the
|
|
18
|
+
compressed marker, not the blob.
|
|
19
|
+
|
|
20
|
+
## STEPS
|
|
21
|
+
|
|
22
|
+
1. **Compress and keep the marker**:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
mnemos_compress(text=<huge output>, profile="log")
|
|
26
|
+
# → [compressed: <sha256> | 87% saved | retrieve via mnemos_retrieve]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Profiles: `log`, `terminal`, `code`, `docs`, `web`, `default`.
|
|
30
|
+
|
|
31
|
+
2. **Carry the marker in context** instead of the original text.
|
|
32
|
+
|
|
33
|
+
3. **Retrieve when details are needed** — full original or ranked snippets:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
mnemos_retrieve(hash=<sha256>) # full original
|
|
37
|
+
mnemos_retrieve(hash=<sha256>, query="timeout") # FTS-ranked snippets
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## DISCIPLINE
|
|
41
|
+
|
|
42
|
+
- Compression is **zero-loss** — never summarize by hand "because it's
|
|
43
|
+
compressed anyway"; retrieve instead.
|
|
44
|
+
- Pick the matching profile: `code` preserves identifiers, `log` keeps
|
|
45
|
+
timestamps aligned.
|
|
46
|
+
- Don't compress short outputs (<500 chars) — the marker costs more than
|
|
47
|
+
the text.
|
|
48
|
+
|
|
49
|
+
## See also
|
|
50
|
+
|
|
51
|
+
- Skill `mnemos-cache-align` — stabilizing prompts for provider KV caches
|
|
52
|
+
- Skill `mnemos-write` — persisting the marker into a memory entry
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mnemos-exchange
|
|
3
|
+
description: Export and import the memory store — backups, migration between instances, federation payloads
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mnemos Exchange
|
|
7
|
+
|
|
8
|
+
Move memories between mnemos instances (or into a backup file) via
|
|
9
|
+
`mnemos_export` / `mnemos_import`. JSON for selective payloads, SQLite for
|
|
10
|
+
full snapshots.
|
|
11
|
+
|
|
12
|
+
## WHEN
|
|
13
|
+
|
|
14
|
+
- **Before risky operations** — a dated export is a cheap safety net.
|
|
15
|
+
- **Migrating instances** — new machine, new container, split → merge.
|
|
16
|
+
- **Federation Phase 0 sync** — compact payloads between peers.
|
|
17
|
+
|
|
18
|
+
## STEPS
|
|
19
|
+
|
|
20
|
+
1. **Export** (JSON by default; filters optional):
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
mnemos_export(output_path="/backup/mnemos-2026-08-21.json",
|
|
24
|
+
format="json", project=<slug>)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Full snapshot for restore purposes:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
mnemos_export(output_path="...", format="sqlite")
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
2. **Import on the target** — merge is the safe default:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
mnemos_import(source_path="...", mode="merge", dry_run=true) # preview!
|
|
37
|
+
mnemos_import(source_path="...", mode="merge")
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
3. **Restore mode is destructive** — wipes the target store first; requires
|
|
41
|
+
`confirm=true`. Use only for full disaster recovery.
|
|
42
|
+
|
|
43
|
+
## RULES
|
|
44
|
+
|
|
45
|
+
- **Always `dry_run=true` first** — the validation report shows what would
|
|
46
|
+
happen with zero risk.
|
|
47
|
+
- Encrypted exports: the passphrase comes from the environment variable
|
|
48
|
+
named by `passphrase_env` — never inline.
|
|
49
|
+
- Import rejects schema drift and oversized content; fix the source rather
|
|
50
|
+
than forcing.
|
|
51
|
+
|
|
52
|
+
## See also
|
|
53
|
+
|
|
54
|
+
- Skill `mnemos-write` — what belongs in the store in the first place
|
|
55
|
+
- `mnemos sync` CLI — federation batch sync between instances
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mnemos-filter
|
|
3
|
+
description: Run or refresh the Context Filter on a stored memory — strip noise, pick profiles, enforce token budgets
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mnemos Filter
|
|
7
|
+
|
|
8
|
+
The Context Filter is the five-stage noise stripper that runs automatically
|
|
9
|
+
on every `mnemos_add`. Use `mnemos_filter` to run it retroactively (when
|
|
10
|
+
`auto_filter` was off) or to re-filter an entry with a different profile or
|
|
11
|
+
token budget.
|
|
12
|
+
|
|
13
|
+
## WHEN
|
|
14
|
+
|
|
15
|
+
- **An entry was written with auto_filter off** — noisy content is bloating
|
|
16
|
+
recall results.
|
|
17
|
+
- **The wrong profile was auto-detected** — e.g. a log pasted as docs kept
|
|
18
|
+
its timestamps and ANSI codes.
|
|
19
|
+
- **A token budget changed** — re-filter to truncate to the new ceiling.
|
|
20
|
+
- **Previewing the cost of keeping content** — the tool reports clean
|
|
21
|
+
content plus reduction stats.
|
|
22
|
+
|
|
23
|
+
## STEPS
|
|
24
|
+
|
|
25
|
+
1. **Re-filter with an explicit profile**:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
mnemos_filter(memory_id=<id>, profile="terminal")
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Profiles: `log`, `terminal`, `code`, `docs`, `web`, `default`.
|
|
32
|
+
Omit `profile` to let the filter auto-select.
|
|
33
|
+
|
|
34
|
+
2. **Enforce a token budget**:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
mnemos_filter(memory_id=<id>, profile="log", budget=2000)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
3. **Check the reduction stats** in the result — a tiny reduction means the
|
|
41
|
+
entry was already clean; a huge one means the raw content was mostly
|
|
42
|
+
noise worth compressing instead (see `mnemos-compress`).
|
|
43
|
+
|
|
44
|
+
## DISCIPLINE
|
|
45
|
+
|
|
46
|
+
- Filtering rewrites the STORED content — the vault original stays the
|
|
47
|
+
source of truth; don't hand-copy filtered output back into entries.
|
|
48
|
+
- Prefer fixing the writer over re-filtering forever: if entries keep
|
|
49
|
+
arriving noisy, adjust how they're added, not the filter.
|
|
50
|
+
- `code` profile preserves identifiers; don't use `default` on source code.
|
|
51
|
+
|
|
52
|
+
## See also
|
|
53
|
+
|
|
54
|
+
- Skill `mnemos-write` — writing clean entries in the first place
|
|
55
|
+
- Skill `mnemos-compress` — zero-loss alternative for big blobs
|
|
56
|
+
- [Context filter guide](https://github.com/Korrnals/mnemos/blob/main/docs/en/user/context-filter.md)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mnemos-housekeeping
|
|
3
|
+
description: Memory store housekeeping — stats, queue depth, tag hygiene, and reprocessing raw entries
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mnemos Housekeeping
|
|
7
|
+
|
|
8
|
+
Keep the memory store healthy: check stats and queue depth, list recent
|
|
9
|
+
entries and tags, reprocess the raw queue when it grows.
|
|
10
|
+
|
|
11
|
+
## WHEN
|
|
12
|
+
|
|
13
|
+
- **At session start** — `mnemos_stats()` is a cheap health ping (counts,
|
|
14
|
+
degraded flags, search health).
|
|
15
|
+
- **Recall results look stale or thin** — check `embedding_status` and
|
|
16
|
+
`search_health` before blaming the query.
|
|
17
|
+
- **After heavy write bursts** — a growing `queue_depth` means the pipeline
|
|
18
|
+
is behind; reprocess to flush.
|
|
19
|
+
- **Tag hygiene** — `mnemos_list_tags()` reveals typos and near-duplicates
|
|
20
|
+
(`project:mnemos` vs `project:Project-Mnemos`).
|
|
21
|
+
|
|
22
|
+
## STEPS
|
|
23
|
+
|
|
24
|
+
1. **Health ping**:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
mnemos_stats()
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Watch for: `degraded: true`, `fts_available/vector_available: false`,
|
|
31
|
+
`orphaned_vectors: true`.
|
|
32
|
+
|
|
33
|
+
2. **Flush the pipeline** when `queue_depth > 0` after writes:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
mnemos_reprocess()
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
3. **Review recent entries and tags**:
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
mnemos_list_recent(limit=10)
|
|
43
|
+
mnemos_list_tags()
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
4. **Fix tag drift** with the bulk rename (dry-run first). Two entry
|
|
47
|
+
points: the grouped pilot tool `mnemos_tags`, or the dedicated
|
|
48
|
+
`mnemos_tags_rename` (same engine, prefix→prefix, idempotent):
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
mnemos_tags_rename(from_prefix="gcw:", to_prefix="mnemos:", dry_run=true)
|
|
52
|
+
mnemos_tags(action="rename", from_prefix="gcw:", to_prefix="mnemos:",
|
|
53
|
+
dry_run=true)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## DISCIPLINE
|
|
57
|
+
|
|
58
|
+
- Reprocess is for **pipeline backlog**, not a fix for bad content — bad
|
|
59
|
+
entries get rewritten, not reprocessed.
|
|
60
|
+
- Tag renames are prefix-based and idempotent, but ALWAYS dry-run first.
|
|
61
|
+
- Don't poll stats in a loop — it's a check, not a monitor.
|
|
62
|
+
|
|
63
|
+
## See also
|
|
64
|
+
|
|
65
|
+
- Skill `mnemos-tag-contract` — what valid tags look like
|
|
66
|
+
- Skill `mnemos-checkpoint` — when to save session state
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mnemos-ingest
|
|
3
|
+
description: Ingest a web page into memory — fetch, extract, and store a URL as a tagged knowledge unit
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mnemos Ingest URL
|
|
7
|
+
|
|
8
|
+
Fetch a web page, extract its readable content, and store it in the memory
|
|
9
|
+
vault as a tagged entry — much better than pasting raw HTML into context.
|
|
10
|
+
|
|
11
|
+
## WHEN
|
|
12
|
+
|
|
13
|
+
- **A URL contains knowledge worth keeping** — docs, an ADR, a postmortem,
|
|
14
|
+
a spec.
|
|
15
|
+
- **You will cite this source later** — the vault entry preserves the URL.
|
|
16
|
+
- **Teams should read the same version** — one ingested copy instead of
|
|
17
|
+
everyone re-fetching.
|
|
18
|
+
|
|
19
|
+
## STEPS
|
|
20
|
+
|
|
21
|
+
1. **Ingest with tags** (contract applies — `project:` and `agent:` are
|
|
22
|
+
mandatory, `source:` records where it came from):
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
mnemos_ingest_url(
|
|
26
|
+
url="https://example.com/postmortem",
|
|
27
|
+
tags=["project:<slug>", "agent:<your-slug>", "source:web",
|
|
28
|
+
"domain:reliability"]
|
|
29
|
+
)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
2. **Confirm what was stored** — the tool reports the extracted title and
|
|
33
|
+
size; sanity-check that it's not a cookie-wall or JS shell.
|
|
34
|
+
|
|
35
|
+
3. **Cite it later via search**, not by re-fetching:
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
mnemos_search(query="postmortem cache stampede")
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## DISCIPLINE
|
|
42
|
+
|
|
43
|
+
- Ingest **knowledge**, not links — a URL nobody will read again is noise.
|
|
44
|
+
- One page = one entry; don't batch a link farm into the vault.
|
|
45
|
+
- If the page requires auth/cookies the extraction may be empty — verify
|
|
46
|
+
the reported content before relying on it.
|
|
47
|
+
|
|
48
|
+
## See also
|
|
49
|
+
|
|
50
|
+
- Skill `mnemos-write` — writing your own knowledge vs. ingesting external
|
|
51
|
+
- Skill `mnemos-recall` — searching ingested pages
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mnemos-recall
|
|
3
|
+
description: Effective memory search — start narrow, broaden if no hits; avoids re-learning what was already learned
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mnemos Recall
|
|
7
|
+
|
|
8
|
+
Query the memory store for relevant prior entries. Use before architectural
|
|
9
|
+
decisions, before web searches, and when resuming work on a topic.
|
|
10
|
+
|
|
11
|
+
## WHEN
|
|
12
|
+
|
|
13
|
+
- **Before an architectural decision** — choosing a pattern, library, or
|
|
14
|
+
approach. Check if a prior decision exists.
|
|
15
|
+
- **Before a web search** — the answer may already be in memory.
|
|
16
|
+
- **When resuming a topic** — recall what was learned last time.
|
|
17
|
+
- **When debugging** — check if this bug-pattern was seen before.
|
|
18
|
+
|
|
19
|
+
## STEPS
|
|
20
|
+
|
|
21
|
+
1. **Start narrow** — tag-filtered, project-scoped:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
mnemos_search(
|
|
25
|
+
query=<natural language query>,
|
|
26
|
+
project=<current-project>,
|
|
27
|
+
tags=["mnemos:decision"], # or mnemos:bug-pattern, mnemos:learning
|
|
28
|
+
limit=10
|
|
29
|
+
)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
2. **Broaden if no hits** — drop the tag filter, keep the project scope:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
mnemos_search(
|
|
36
|
+
query=<query>,
|
|
37
|
+
project=<current-project>,
|
|
38
|
+
limit=10
|
|
39
|
+
)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
3. **Broaden further if still no hits** — drop project scope:
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
mnemos_search(
|
|
46
|
+
query=<query>,
|
|
47
|
+
limit=10
|
|
48
|
+
)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
4. **For agent-scoped recall** — when you need your own prior context:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
mnemos_agent_recall(
|
|
55
|
+
agent=<your-slug>,
|
|
56
|
+
project=<current-project>, # optional
|
|
57
|
+
query=<optional focus>,
|
|
58
|
+
limit=20
|
|
59
|
+
)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
5. **Return a compact list** — do not paste full bodies unless the caller
|
|
63
|
+
asks:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
- <title> (<tags>) [project=<...>]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
6. **If 0 results, say so explicitly.** Do not fabricate prior context.
|
|
70
|
+
|
|
71
|
+
## DISCIPLINE
|
|
72
|
+
|
|
73
|
+
- **Narrow → broaden.** Starting broad returns too much noise; starting
|
|
74
|
+
narrow returns signal or confirms absence.
|
|
75
|
+
- **Default to recency, not relevance, when ranking ties.** The most recent
|
|
76
|
+
entry is usually the most applicable.
|
|
77
|
+
- **Do not paste full bodies.** Keep the recall list scannable. Recall the
|
|
78
|
+
full entry only if the caller needs it.
|
|
79
|
+
- **Never fabricate.** If search returns nothing, say "no prior context
|
|
80
|
+
found for <query>". Do not infer what "probably" was in memory.
|
|
81
|
+
- **Search before web.** A web search that re-discovers what memory already
|
|
82
|
+
has is wasted tokens and time.
|
|
83
|
+
|
|
84
|
+
## See also
|
|
85
|
+
|
|
86
|
+
- Skill `mnemos-write` — capture what you learned
|
|
87
|
+
- Instruction `mnemos-memory-ops.instructions.md`
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mnemos-session-init
|
|
3
|
+
description: Recall prior context at session start — restores project state, open questions, and recent decisions before any work begins
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mnemos Session Init
|
|
7
|
+
|
|
8
|
+
Run at the start of any session that wants memory continuity. Restores prior
|
|
9
|
+
context for the current project so the agent does not re-learn what was
|
|
10
|
+
already learned.
|
|
11
|
+
|
|
12
|
+
## WHEN
|
|
13
|
+
|
|
14
|
+
- **Session start** — before reading any project file or running a search.
|
|
15
|
+
- **After a context compaction** — when the harness signals compression and
|
|
16
|
+
prior context may have been lost.
|
|
17
|
+
- **After switching projects** — when resuming work on a different codebase.
|
|
18
|
+
|
|
19
|
+
## STEPS
|
|
20
|
+
|
|
21
|
+
1. Determine `project` = workspace folder name (or explicit project slug).
|
|
22
|
+
|
|
23
|
+
2. Recall prior context:
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
mnemos_recall_context(project=<project>)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
3. If the result contains prior context, surface a short header (≤4 lines):
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
Memory: project=<name> | recalled=<N> entries
|
|
33
|
+
Last focus: <one line from last checkpoint>
|
|
34
|
+
Open questions: <one line or "none">
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
4. If recall returns nothing, say:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
Memory: no prior context for <project>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
5. Optionally, recall your own agent-scoped context if you are resuming as a
|
|
44
|
+
specific agent:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
mnemos_agent_recall(agent=<your-slug>, project=<project>, limit=20)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
6. Proceed with the task. Do not dump full recalled content into the response
|
|
51
|
+
— act on it.
|
|
52
|
+
|
|
53
|
+
## DISCIPLINE
|
|
54
|
+
|
|
55
|
+
- **Header ≤4 lines.** The user does not need to see the full recall — they
|
|
56
|
+
need to know that memory is active and what the last focus was.
|
|
57
|
+
- **Never block on recall failure.** If `mnemos_recall_context` errors or
|
|
58
|
+
returns nothing, degrade silently to "no prior context" and continue.
|
|
59
|
+
- **Recall before reading files.** The whole point is to avoid re-reading
|
|
60
|
+
what memory already summarised. If you read files first, you waste tokens
|
|
61
|
+
re-learning what memory had.
|
|
62
|
+
- **Do not fabricate prior context.** If recall returns nothing, say so.
|
|
63
|
+
Never infer what "probably" was in memory.
|
|
64
|
+
|
|
65
|
+
## See also
|
|
66
|
+
|
|
67
|
+
- Skill `mnemos-checkpoint` — save mid-session / on compaction
|
|
68
|
+
- Instruction `mnemos-session-lifecycle.instructions.md`
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mnemos-tag-contract
|
|
3
|
+
description: Canonical tag schema for Mnemos memory entries — required composition, whitelisted prefixes, subtypes
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mnemos Tag Contract (skill reference)
|
|
7
|
+
|
|
8
|
+
All memory entries — via `mnemos_add` or `mnemos_ingest_url` — must use this
|
|
9
|
+
tag vocabulary. Stability of these names matters: migration and search depend
|
|
10
|
+
on it.
|
|
11
|
+
|
|
12
|
+
## WHEN
|
|
13
|
+
|
|
14
|
+
- **Before every `mnemos_add` call** — validate the tag set.
|
|
15
|
+
- **Before every `mnemos_ingest_url` call** — same requirement.
|
|
16
|
+
- **When reviewing a migration** — check that legacy entries have valid
|
|
17
|
+
tags or `mnemos:legacy`.
|
|
18
|
+
|
|
19
|
+
## Required tags (mandatory on all new entries)
|
|
20
|
+
|
|
21
|
+
| Tag | Format | Cardinality | Purpose |
|
|
22
|
+
|-----|--------|-------------|---------|
|
|
23
|
+
| `project:<slug>` | `[a-z0-9][a-z0-9\-_]*` | **exactly 1** | Binds entry to a codebase / initiative |
|
|
24
|
+
| `agent:<slug>` | `[a-z0-9][a-z0-9\-_]*` | **exactly 1** | Agent that authored the memory (use `agent:user` for user-authored) |
|
|
25
|
+
| `mnemos:<subtype>` | see table below | **at least 1** | Cognitive category |
|
|
26
|
+
|
|
27
|
+
### Mnemos subtypes (whitelist)
|
|
28
|
+
|
|
29
|
+
| Subtype | When to use |
|
|
30
|
+
|---------|-------------|
|
|
31
|
+
| `mnemos:session` | Session continuity snapshots |
|
|
32
|
+
| `mnemos:checkpoint` | Mid-session compaction-resilient checkpoints |
|
|
33
|
+
| `mnemos:bug-pattern` | Recurring failure modes, root-cause patterns |
|
|
34
|
+
| `mnemos:learning` | Non-obvious facts acquired during a task |
|
|
35
|
+
| `mnemos:decision` | Explicit architectural / product decisions + rationale |
|
|
36
|
+
| `mnemos:rule` | Hard constraints and invariants |
|
|
37
|
+
| `mnemos:open-question` | Unresolved questions requiring future investigation |
|
|
38
|
+
| `mnemos:legacy` | Migrated entries from ai-brain or pre-contract stores |
|
|
39
|
+
|
|
40
|
+
## Optional tags (accepted, not required)
|
|
41
|
+
|
|
42
|
+
| Tag | Format | Purpose |
|
|
43
|
+
|-----|--------|---------|
|
|
44
|
+
| `source:<slug>` | any string | Origin of the entry (chat, file, url, …) |
|
|
45
|
+
| `applyTo:<glob>` | file glob | Scope a `mnemos:rule` to specific file paths |
|
|
46
|
+
| `milestone:<id>` | any string | Links entry to a project milestone |
|
|
47
|
+
| `domain:<slug>` | any string | Domain sub-classifier within a project |
|
|
48
|
+
| `severity:<level>` | `low\|medium\|high\|critical` | Severity for bug-patterns |
|
|
49
|
+
| `stack:<slug>` | any string | Technology stack (e.g. `stack:python`) |
|
|
50
|
+
|
|
51
|
+
Unknown prefixes not listed here are **rejected** in strict mode.
|
|
52
|
+
|
|
53
|
+
## Enforcement modes
|
|
54
|
+
|
|
55
|
+
| Mode | Setting | Behaviour |
|
|
56
|
+
|------|---------|-----------|
|
|
57
|
+
| **Strict** (default) | `strict_tag_contract=true` | Missing/malformed required tags → `TagContractError`, write rejected. |
|
|
58
|
+
| **Lax** (migrations) | `strict_tag_contract=false` | Missing required tags → warning, write succeeds. Multiple `project:`/`agent:` always raise. |
|
|
59
|
+
|
|
60
|
+
## STEPS
|
|
61
|
+
|
|
62
|
+
1. **Identify the project** — the codebase or initiative this entry belongs
|
|
63
|
+
to. If unknown, determine it before calling `mnemos_add`.
|
|
64
|
+
|
|
65
|
+
2. **Identify the agent** — the agent slug that authored this entry. Use
|
|
66
|
+
`agent:user` for user-provided content.
|
|
67
|
+
|
|
68
|
+
3. **Choose the subtype** — pick exactly one `mnemos:<subtype>` from the
|
|
69
|
+
whitelist. If none fits, do not invent one — propose a new subtype via
|
|
70
|
+
PR.
|
|
71
|
+
|
|
72
|
+
4. **Add optional tags** as needed — `severity:` for bug-patterns,
|
|
73
|
+
`applyTo:` for rules, `stack:` for stack-specific learnings.
|
|
74
|
+
|
|
75
|
+
5. **Assemble and write**:
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
mnemos_add(
|
|
79
|
+
content=<body>,
|
|
80
|
+
tags=[
|
|
81
|
+
"project:<slug>",
|
|
82
|
+
"agent:<slug>",
|
|
83
|
+
"mnemos:<subtype>",
|
|
84
|
+
"<optional>:<value>"
|
|
85
|
+
]
|
|
86
|
+
)
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## DISCIPLINE
|
|
90
|
+
|
|
91
|
+
- **Never omit required tags.** If you do not know the project or agent,
|
|
92
|
+
determine it before writing. Do not guess.
|
|
93
|
+
- **Do not invent new `mnemos:` subtypes.** Propose additions via PR to the tag
|
|
94
|
+
contract.
|
|
95
|
+
- **One `project:` per entry.** If a learning spans projects, write one
|
|
96
|
+
entry per project, or use `project:shared` if genuinely cross-project.
|
|
97
|
+
- **`agent:user` for user-authored content.** Do not attribute user-provided
|
|
98
|
+
facts to the agent that happened to be running.
|
|
99
|
+
- **Slugs are lowercase.** `[a-z0-9][a-z0-9\-_]*` — no uppercase, no spaces.
|
|
100
|
+
|
|
101
|
+
## See also
|
|
102
|
+
|
|
103
|
+
- Instruction `mnemos-tag-contract.instructions.md`
|
|
104
|
+
- [Tag Contract (user docs)](../../docs/en/user/tag-contract.md)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mnemos-watch
|
|
3
|
+
description: Watch directories and auto-index changes into memory — keep the vault in sync with living code and docs
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mnemos Watch
|
|
7
|
+
|
|
8
|
+
Start a background watcher over project directories so file changes are
|
|
9
|
+
auto-indexed into memory. The vault stays current without manual
|
|
10
|
+
`mnemos_add` for every doc change.
|
|
11
|
+
|
|
12
|
+
## WHEN
|
|
13
|
+
|
|
14
|
+
- **Long-running multi-session work** — docs/rules written between sessions
|
|
15
|
+
should be searchable without re-ingestion.
|
|
16
|
+
- **A shared knowledge dir** (ADRs, runbooks) that several agents read.
|
|
17
|
+
- **After restoring or migrating a vault** — one scan pass re-indexes
|
|
18
|
+
everything.
|
|
19
|
+
|
|
20
|
+
## STEPS
|
|
21
|
+
|
|
22
|
+
1. **Start watching** (initial scan included by default):
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
mnemos_watch_start(paths=["/project", "/project/docs"], scan=true)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. **Check health periodically** — especially after long idle periods:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
mnemos_watch_status()
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
3. **Stop cleanly** when the workstream ends:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
mnemos_watch_stop()
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## DISCIPLINE
|
|
41
|
+
|
|
42
|
+
- Watch **knowledge directories**, not whole repos — `src/` churn would
|
|
43
|
+
flood the pipeline with noise.
|
|
44
|
+
- `.github/instructions/*.instructions.md` is picked up automatically when
|
|
45
|
+
present — no need to add it twice.
|
|
46
|
+
- The watcher is per-session background state: if the session died, restart
|
|
47
|
+
it rather than assuming it survived.
|
|
48
|
+
|
|
49
|
+
## See also
|
|
50
|
+
|
|
51
|
+
- Skill `mnemos-ingest` — one-shot URL ingestion vs. directory watching
|
|
52
|
+
- `mnemos doctor` — reports watcher health among other checks
|