@ainyc/canonry 2.0.0 → 2.2.3

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.
@@ -1,47 +1,66 @@
1
1
  ---
2
2
  name: memory-patterns
3
- description: What to persist vs. re-query — project state lives in canonry, only user-scoped facts go in agent memory. Read when unsure whether to remember or look up.
3
+ description: When to remember vs. re-query — project state lives in canonry, only durable user-scoped facts go in Aero memory. Read when unsure whether to call remember or look up.
4
4
  ---
5
5
 
6
6
  # Memory Patterns
7
7
 
8
- Canonry is the source of truth for project state. Do **not** maintain a parallel copy of project facts in agent memory — it will drift from the DB and mislead the next session.
8
+ Canonry is the source of truth for project state. Do **not** maintain a parallel copy of project facts in Aero memory — it will drift from the DB and mislead the next session.
9
+
10
+ Aero now ships with a built-in durable notes store — the `remember`, `forget`, and `recall` tools — backed by the `agent_memory` table. The N most-recently-updated notes are injected into the system prompt at every session start, so you usually see relevant memory without calling `recall`.
9
11
 
10
12
  ## What belongs where
11
13
 
12
14
  | Scope | Examples | Home |
13
15
  |---|---|---|
14
- | **Project state** | Baselines, historical regressions, citation rates per keyword/provider, recent insights, sweep history, audit trail | Canonry DB — query via CLI / API |
15
- | **User preferences** | How the operator likes reports framed, tone, comms style, tools they already use | Platform-native memory (Claude Code auto-memory, Codex thread metadata, etc.) |
16
- | **Session scratch** | "I just tried X and it failed", intermediate reasoning | Platform-native memory (dies with the session) |
16
+ | **Project state** | Baselines, historical regressions, citation rates per keyword/provider, recent insights, sweep history, audit trail | Canonry DB — query via CLI / API / read tools |
17
+ | **Operator facts** | Personal preferences, non-observable context ("content lead is Sarah", "migrating off Webflow next quarter"), tone/voice preferences the operator confirmed | Aero memory (`remember`) |
18
+ | **Session scratch** | "I just tried X and it failed", intermediate reasoning, turn-local state | Nowhere let it die with the session |
17
19
 
18
20
  ## How to read project state from canonry
19
21
 
20
- Always use `--format json` for structured output:
22
+ Prefer Aero's read tools (`get_status`, `get_health`, `get_timeline`, `get_insights`, `list_keywords`, `list_competitors`, `get_run`) over shelling out, but the CLI exists for operators too:
21
23
 
22
24
  ```bash
23
- # Current health + latest run summary
24
25
  canonry status <project> --format json
25
26
  canonry health <project> --format json
26
-
27
- # Historical trend
28
27
  canonry timeline <project> --since <YYYY-MM-DD> --format json
29
- canonry history <project> --format json
30
-
31
- # Insights already surfaced (don't regenerate — query)
32
28
  canonry insights <project> --format json
33
-
34
- # Raw evidence from the most recent sweep
35
29
  canonry evidence <project> --format json
36
-
37
- # Audit log — who changed what and when
38
30
  canonry audit <project> --format json
39
31
  ```
40
32
 
41
- If the data you need isn't reachable with a single CLI call, that's a bug in canonry's API surface — file it rather than working around it in memory.
33
+ If the data you need isn't reachable with a single read tool or CLI call, that's a bug in canonry's API surface — file it rather than working around it in memory.
42
34
 
43
35
  ## Regenerate, don't remember
44
36
 
45
37
  Derived interpretations (trend summaries, correlations between events) are cheap to recompute from the underlying DB rows. Prefer running the analysis again on fresh data over recalling what you concluded last session — conclusions age, the data doesn't.
46
38
 
47
- The one exception: if the operator gave you a *fact* that canonry can't observe ("the content lead is named Sarah", "they're migrating off Webflow next quarter"), persist it in platform-native memory as user-scoped context.
39
+ ## Using `remember` / `forget` / `recall`
40
+
41
+ - `remember(key, value)` — upsert a project-scoped note. Capped at 2 KB per value. Same key replaces the prior value, so use stable keys (e.g. `operator-pref.reporting-tone`, not `note-2026-04-17`).
42
+ - `forget(key)` — remove a single note. Returns `status: missing` when the key never existed (non-fatal).
43
+ - `recall(limit?)` — read notes newest-first. Usually unnecessary — the top 20 are already in the system prompt under `<memory>`. Reach for it when you need older context or the full value of a note that's been summarized.
44
+
45
+ **Reserved prefix.** Keys starting with `compaction:` are reserved for LLM-summarized transcript slices. `remember` and `forget` both reject them. Compaction notes are pruned automatically — you can `recall` them but never write or delete them by hand.
46
+
47
+ **CLI parity.** Operators can manage memory without talking to you:
48
+
49
+ ```bash
50
+ canonry agent memory list <project> --format json
51
+ canonry agent memory set <project> --key <k> --value <v>
52
+ canonry agent memory forget <project> --key <k>
53
+ ```
54
+
55
+ ## Good remember candidates
56
+
57
+ - Operator-confirmed facts canonry can't observe (team names, migration plans, vendor lock-in, upcoming content bets).
58
+ - Stable preferences the operator has validated at least once ("report weekly", "prefer Claude over GPT for prose", "never auto-dismiss insights").
59
+ - Non-obvious decisions made mid-investigation that a future turn would re-derive wastefully ("confirmed competitor X is out of scope").
60
+
61
+ ## Bad remember candidates
62
+
63
+ - Anything canonry already tracks (runs, insights, citation rates, schedules). Query it.
64
+ - Turn-local state that's useful for one follow-up and then noise ("user just asked about keyword Y").
65
+ - Raw evidence or long transcripts — persist a conclusion, not a dump.
66
+ - Unvalidated guesses. Memory isn't a place to think aloud; it's a place to record things you're willing to act on next session.
@@ -12,18 +12,18 @@ metadata:
12
12
  {
13
13
  "id": "npm",
14
14
  "kind": "npm",
15
- "package": "canonry",
15
+ "package": "@ainyc/canonry",
16
16
  "bins": ["canonry"],
17
17
  "label": "Install canonry globally",
18
- "command": "npm install -g canonry"
18
+ "command": "npm install -g @ainyc/canonry"
19
19
  },
20
20
  {
21
21
  "id": "npx",
22
22
  "kind": "npx",
23
- "package": "@ainyc/aeo-audit",
24
- "bins": ["aeo-audit"],
25
- "label": "Use aeo-audit via npx",
26
- "command": "npx @ainyc/aeo-audit@latest"
23
+ "package": "@ainyc/canonry",
24
+ "bins": ["canonry"],
25
+ "label": "Run canonry via npx",
26
+ "command": "npx @ainyc/canonry@latest init"
27
27
  }
28
28
  ],
29
29
  },
@@ -211,4 +211,4 @@ cat audit.json | jq -r '.factors[] | select(.score < 70) | "- \(.name): \(.score
211
211
  ---
212
212
 
213
213
  **Tools:** canonry v1.37+, @ainyc/aeo‑audit v1.3+
214
- **Website:** [ainyc.ai](https://ainyc.ai) | **Reference:** [AINYC AEO Methodology](https://ainyc.ai/aeo-methodology)
214
+ **Website:** [ainyc.ai](https://ainyc.ai) | **Reference:** [AINYC AEO Methodology](https://ainyc.ai/aeo-methodology)