@aman_asmuei/aman-agent 0.24.3 → 0.26.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/README.md CHANGED
@@ -33,36 +33,97 @@
33
33
  </p>
34
34
 
35
35
  <p align="center">
36
- <a href="#-quick-start">Quick Start</a> &bull;
37
- <a href="#-intelligent-companion-features">Features</a> &bull;
38
- <a href="#-how-it-works">How It Works</a> &bull;
39
- <a href="#-commands">Commands</a> &bull;
40
- <a href="#-supported-llms">LLMs</a> &bull;
41
- <a href="#-the-ecosystem">Ecosystem</a>
36
+ <a href="#quick-start">Quick Start</a> &bull;
37
+ <a href="#features">Features</a> &bull;
38
+ <a href="#how-it-works">How It Works</a> &bull;
39
+ <a href="#commands">Commands</a> &bull;
40
+ <a href="#supported-llms">LLMs</a> &bull;
41
+ <a href="#the-ecosystem">Ecosystem</a> &bull;
42
+ <a href="#faq">FAQ</a>
42
43
  </p>
43
44
 
44
45
  ---
45
46
 
46
- ## What's New in v0.18.0
47
+ <details>
48
+ <summary><strong>Table of Contents</strong></summary>
49
+
50
+ - [What's New](#whats-new-in-v0260)
51
+ - [The Problem](#the-problem)
52
+ - [The Solution](#the-solution)
53
+ - [Quick Start](#quick-start)
54
+ - [Usage Guide](#usage-guide)
55
+ - [Your First Conversation](#your-first-conversation)
56
+ - [How Memory Works](#how-memory-works)
57
+ - [Files & Images](#working-with-files--images)
58
+ - [Plans](#working-with-plans)
59
+ - [Skills](#skills-in-action)
60
+ - [Project Workflow](#project-workflow)
61
+ - [Personality & Wellbeing](#personality--wellbeing)
62
+ - [Customization](#customization)
63
+ - [Showcase Templates](#showcase-templates)
64
+ - [Profiles](#your-profile-vs-agent-profiles)
65
+ - [Delegation](#agent-delegation)
66
+ - [Teams](#agent-teams)
67
+ - [Daily Workflow](#daily-workflow-summary)
68
+ - [Features](#features)
69
+ - [How It Works](#how-it-works)
70
+ - [Commands](#commands)
71
+ - [What It Loads](#what-it-loads)
72
+ - [Supported LLMs](#supported-llms)
73
+ - [Configuration](#configuration)
74
+ - [The Ecosystem](#the-ecosystem)
75
+ - [What Makes This Different](#what-makes-this-different)
76
+ - [FAQ](#faq)
77
+ - [Contributing](#contributing)
78
+
79
+ </details>
80
+
81
+ ---
47
82
 
48
- > **Personalized onboarding, showcase templates, and 10 runtime reliability fixes.**
83
+ ## What's New in v0.26.0
84
+
85
+ > **Your agent learns new skills from its own sessions.**
86
+
87
+ When a post-mortem runs, the LLM now proposes 0–2 reusable procedures it noticed you demonstrated. You accept or reject each one via a simple prompt at session end. Accepted skills are written to `~/.askill/skills.md` with embedded trigger keywords and **auto-activate** on subsequent sessions — zero extra LLM calls.
49
88
 
50
89
  | Feature | What it does |
51
90
  |:---|:---|
52
- | **User onboarding** | Interactive first-run setup captures your name, role, expertise, and communication style |
53
- | **Showcase templates** | 13 pre-built companion personalities (fitness, freelancer, Muslim, finance, etc.) from [aman-showcase](https://github.com/amanasmuei/aman-showcase) |
54
- | **User profile** | `/profile me` to view, `/profile edit` to update injected into every system prompt |
55
- | **Streaming cancellation** | Ctrl+C aborts current response instead of killing the session |
56
- | **Session checkpointing** | Auto-saves every 10 turns crash-safe, no more lost conversations |
57
- | **Sub-agent guardrails** | Delegated agents now enforce the same safety rules as the main agent |
58
- | **Sub-agent memory** | Delegated agents recall relevant memories for better context |
59
- | **MCP auto-reconnect** | Tool servers automatically reconnect on connection failure |
60
- | **Token-safe tool loop** | Conversation trimming runs inside the tool loop — no more context blowups |
61
- | **System prompt ceiling** | 16K token cap prevents unbounded system prompt growth |
62
- | **Non-blocking extraction** | Memory extraction runs fire-and-forget — never blocks your next message |
63
- | **Image-aware trimming** | Image blocks properly counted in token estimates for conversation trimming |
64
-
65
- <a href="https://github.com/amanasmuei/aman-agent/releases">Full release history</a>
91
+ | **Skill crystallization** | Post-mortems identify reusable procedures opt-in prompt saved as auto-triggering skills |
92
+ | **Runtime trigger matching** | Crystallized skills merge with hardcoded skill triggers keyword match fires both |
93
+ | **`/skills crystallize`** | Manually crystallize skills from the most recent post-mortem JSON sidecar |
94
+ | **`/skills list --auto`** | List all crystallized skills with dates, confidence, and trigger keywords |
95
+ | **Post-mortem JSON sidecar** | Every post-mortem now writes a `.json` alongside the `.md` for lossless re-parsing |
96
+ | **Extended LLM schema** | Post-mortem prompt includes crystallization rules narrow, reusable, confidence-gated |
97
+
98
+ <details>
99
+ <summary><strong>Highlights from earlier releases</strong></summary>
100
+
101
+ **v0.24 Observation & post-mortem**
102
+ - Passive session telemetry (tool calls, errors, file changes, sentiment, blockers)
103
+ - LLM-generated post-mortem reports with smart auto-trigger
104
+ - Pattern memory loop — the agent learns from its own session history
105
+ - `/observe` dashboard, `/postmortem` commands
106
+
107
+ **v0.18 — User onboarding**
108
+ - Interactive first-run setup capturing name, role, expertise, communication style
109
+ - 13 showcase templates (fitness, freelancer, Muslim, finance, etc.)
110
+ - `/profile me` and `/profile edit` for user identity management
111
+
112
+ **v0.16 — Session resilience**
113
+ - Streaming cancellation (Ctrl+C aborts response, not session)
114
+ - Session checkpointing every 10 turns — crash-safe
115
+ - MCP auto-reconnect on connection failure
116
+ - Token-safe tool loop with conversation trimming inside
117
+ - Non-blocking memory extraction
118
+
119
+ **v0.14 — Sub-agent infrastructure**
120
+ - Sub-agent guardrails enforce same safety rules as main agent
121
+ - Sub-agent memory recall for better delegation context
122
+ - 16K system prompt token ceiling
123
+
124
+ </details>
125
+
126
+ <a href="https://github.com/amanasmuei/aman-agent/releases">Full release history →</a>
66
127
 
67
128
  ---
68
129
 
@@ -152,7 +213,10 @@ aman-agent --budget 12000
152
213
 
153
214
  ## Usage Guide
154
215
 
155
- A step-by-step walkthrough of how to use aman-agent day-to-day.
216
+ A step-by-step walkthrough of how to use aman-agent day-to-day. Click any section below to expand.
217
+
218
+ <details open>
219
+ <summary><strong>Your First Conversation</strong></summary>
156
220
 
157
221
  ### Your First Conversation
158
222
 
@@ -185,6 +249,11 @@ You > Hey, I'm working on a Node.js API
185
249
 
186
250
  That's it. No setup required. The agent remembers your stack from this point forward.
187
251
 
252
+ </details>
253
+
254
+ <details>
255
+ <summary><strong>How Memory Works</strong></summary>
256
+
188
257
  ### How Memory Works
189
258
 
190
259
  Memory is automatic. You don't need to do anything — the agent silently extracts important information from every conversation:
@@ -217,6 +286,11 @@ You > Let's add a new endpoint
217
286
  /decisions View your decision log
218
287
  ```
219
288
 
289
+ </details>
290
+
291
+ <details>
292
+ <summary><strong>Working with Files & Images</strong></summary>
293
+
220
294
  ### Working with Files & Images
221
295
 
222
296
  Reference any file path in your message — it gets attached automatically:
@@ -248,6 +322,11 @@ You > What's wrong with this schema? ~/Desktop/schema.png
248
322
 
249
323
  Multiple files in one message work too.
250
324
 
325
+ </details>
326
+
327
+ <details>
328
+ <summary><strong>Working with Plans</strong></summary>
329
+
251
330
  ### Working with Plans
252
331
 
253
332
  Plans help you track multi-step work that spans sessions.
@@ -310,6 +389,11 @@ $ aman-agent
310
389
 
311
390
  Plans are stored as markdown in `.acore/plans/` — they're git-trackable.
312
391
 
392
+ </details>
393
+
394
+ <details>
395
+ <summary><strong>Skills in Action</strong></summary>
396
+
313
397
  ### Skills in Action
314
398
 
315
399
  Skills activate automatically based on what you're talking about. No commands needed.
@@ -340,6 +424,11 @@ Skills also self-improve — when the agent learns your patterns (e.g., "user pr
340
424
 
341
425
  **10 knowledge library items** auto-suggested when relevant: security-headers, docker-node, github-actions, env-config, error-handling, rate-limiter, prisma-setup, zod-validation, testing-patterns, git-hooks
342
426
 
427
+ </details>
428
+
429
+ <details>
430
+ <summary><strong>Project Workflow</strong></summary>
431
+
343
432
  ### Project Workflow
344
433
 
345
434
  aman-agent is project-aware. When you run it in a project directory, it loads project-specific context.
@@ -366,6 +455,11 @@ cd ~/project-b && aman-agent # Loads project-b context + memories
366
455
 
367
456
  Global preferences (coding style, tool choices) carry across all projects.
368
457
 
458
+ </details>
459
+
460
+ <details>
461
+ <summary><strong>Personality & Wellbeing</strong></summary>
462
+
369
463
  ### Personality & Wellbeing
370
464
 
371
465
  The agent adapts its tone based on time of day and how you're doing:
@@ -394,6 +488,11 @@ You > ugh nothing works, tried everything!!
394
488
 
395
489
  These are one-time nudges — the agent won't nag.
396
490
 
491
+ </details>
492
+
493
+ <details>
494
+ <summary><strong>Customization</strong></summary>
495
+
397
496
  ### Customization
398
497
 
399
498
  **Persona presets** for different work styles:
@@ -432,6 +531,11 @@ aman-agent init
432
531
 
433
532
  Set any to `false` to disable.
434
533
 
534
+ </details>
535
+
536
+ <details>
537
+ <summary><strong>Showcase Templates</strong></summary>
538
+
435
539
  ### Showcase Templates
436
540
 
437
541
  Give your companion a pre-built specialty from [aman-showcase](https://github.com/amanasmuei/aman-showcase):
@@ -460,6 +564,11 @@ npx @aman_asmuei/aman-showcase install muslim
460
564
 
461
565
  Each template includes identity, workflows, rules, and domain skills — all installed into your ecosystem.
462
566
 
567
+ </details>
568
+
569
+ <details>
570
+ <summary><strong>Your Profile vs Agent Profiles</strong></summary>
571
+
463
572
  ### Your Profile vs Agent Profiles
464
573
 
465
574
  **Your profile** is who YOU are — name, role, expertise, communication style. Set during onboarding, injected into every conversation:
@@ -486,6 +595,11 @@ Each agent profile has its own identity, rules, and skills — but shares the sa
486
595
  /profile list Show all profiles
487
596
  ```
488
597
 
598
+ </details>
599
+
600
+ <details>
601
+ <summary><strong>Agent Delegation</strong></summary>
602
+
489
603
  ### Agent Delegation
490
604
 
491
605
  Delegate tasks to sub-agents with specialist profiles:
@@ -511,6 +625,11 @@ Delegate tasks to sub-agents with specialist profiles:
511
625
 
512
626
  The AI also **auto-suggests delegation** when it recognizes a task matches a specialist profile — always asks for your permission first.
513
627
 
628
+ </details>
629
+
630
+ <details>
631
+ <summary><strong>Agent Teams</strong></summary>
632
+
514
633
  ### Agent Teams
515
634
 
516
635
  Named teams of agents that collaborate on complex tasks:
@@ -553,6 +672,80 @@ Create custom teams:
553
672
 
554
673
  The AI auto-suggests teams when appropriate — always asks permission first.
555
674
 
675
+ </details>
676
+
677
+ <details>
678
+ <summary><strong>Session Telemetry & Post-Mortems</strong> (new in v0.24)</summary>
679
+
680
+ ### Session Telemetry & Post-Mortems
681
+
682
+ aman-agent now passively observes what happens during a session and can produce a structured post-mortem on demand or automatically.
683
+
684
+ **Live observation dashboard:**
685
+
686
+ ```
687
+ You > /observe
688
+
689
+ Session: 47 min | Tools: 23 calls (2 errors) | Files: 5 changed
690
+ Blockers: 1 | Milestones: 3 | Topic shifts: 2
691
+ ```
692
+
693
+ **Pause / resume capture** when you don't want noisy commands recorded:
694
+
695
+ ```
696
+ You > /observe pause
697
+ Observation paused. Use /observe resume to continue.
698
+ ```
699
+
700
+ **Generate a post-mortem on demand:**
701
+
702
+ ```
703
+ You > /postmortem
704
+
705
+ # Post-Mortem: 2026-04-11
706
+ **Session:** session-2026-04-11-2143 | **Duration:** 47 min | **Turns:** 23
707
+
708
+ ## Summary
709
+ Refactored the auth middleware and shipped JWT validation...
710
+
711
+ ## Completed
712
+ - [x] Extracted token handler
713
+ - [x] Wired rate limiter
714
+
715
+ ## Blockers
716
+ - Rate limit hit on token endpoint mid-session
717
+
718
+ ## Patterns
719
+ - Detect rate limits earlier
720
+ ...
721
+
722
+ Saved → ~/.acore/postmortems/2026-04-11-sess.md
723
+ ```
724
+
725
+ **Automatic on session end** when any of these triggers fire:
726
+ - ≥3 tool errors
727
+ - ≥2 user blockers
728
+ - &gt;60 minute session
729
+ - Plan steps abandoned
730
+ - Sustained frustration (5+ frustration signals)
731
+
732
+ Recurring patterns from the report are stored as `pattern` memories so the next session benefits.
733
+
734
+ **Cross-session trends:**
735
+
736
+ ```
737
+ /postmortem --since 7d Analyze the last 7 days of post-mortems
738
+ /postmortem last Show the most recent report
739
+ /postmortem list List all saved post-mortems
740
+ ```
741
+
742
+ **Storage:** `~/.acore/observations/*.jsonl` (raw events) and `~/.acore/postmortems/*.md` (reports). Old observations auto-prune after 30 days. Disable with `recordObservations: false` or `autoPostmortem: false` in config.
743
+
744
+ </details>
745
+
746
+ <details>
747
+ <summary><strong>Daily Workflow Summary</strong></summary>
748
+
556
749
  ### Daily Workflow Summary
557
750
 
558
751
  Here's what a typical day looks like with aman-agent:
@@ -581,9 +774,13 @@ Next morning:
581
774
  → Everything picks up where you left off
582
775
  ```
583
776
 
777
+ </details>
778
+
584
779
  ---
585
780
 
586
- ## Intelligent Companion Features
781
+ ## Features
782
+
783
+ ### Intelligent Companion Features
587
784
 
588
785
  ### Per-Message Memory Recall with Progressive Disclosure
589
786
 
@@ -761,6 +958,14 @@ On every startup, the agent automatically merges duplicate memories, prunes stal
761
958
 
762
959
  Every operation that can fail logs to `~/.aman-agent/debug.log` with structured JSON. No more silent failures — use `/debug` to see what's happening under the hood.
763
960
 
961
+ ### Passive Session Observation
962
+
963
+ Every tool call, error, file change, sentiment shift, blocker, milestone, and topic shift is captured as a typed event and written to `~/.acore/observations/*.jsonl`. Capture is non-blocking (events buffer in memory and flush in batches). Stats are visible live via `/observe`.
964
+
965
+ ### LLM-Powered Post-Mortems
966
+
967
+ On session end, if any smart trigger fires (≥3 tool errors, ≥2 blockers, &gt;60 min, abandoned plan steps, or sustained frustration), the agent uses your LLM to generate a structured post-mortem report — summary, goals, completed work, blockers, decisions, sentiment arc, recurring patterns, and actionable recommendations. Patterns are stored back as `pattern` memories. Reports persist as markdown in `~/.acore/postmortems/`.
968
+
764
969
  ---
765
970
 
766
971
  ## How It Works
@@ -843,9 +1048,11 @@ Every operation that can fail logs to `~/.aman-agent/debug.log` with structured
843
1048
  | `/rules` | View guardrails `[add\|remove\|toggle ...]` |
844
1049
  | `/workflows` | View workflows `[add\|remove ...]` |
845
1050
  | `/tools` | View tools `[add\|remove ...]` |
846
- | `/skills` | View skills `[install\|uninstall ...]` |
1051
+ | `/skills` | View skills `[install\|uninstall\|crystallize\|list --auto]` |
847
1052
  | `/eval` | View evaluation `[milestone ...]` |
848
1053
  | `/memory` | View memories `[search\|clear\|timeline]` |
1054
+ | `/observe` | Live session telemetry dashboard `[pause\|resume]` |
1055
+ | `/postmortem` | Generate session post-mortem `[last\|list\|--since 7d]` |
849
1056
  | `/decisions` | View decision log `[<project>]` |
850
1057
  | `/export` | Export conversation to markdown |
851
1058
  | `/debug` | Show debug log (last 20 entries) |
@@ -945,7 +1152,10 @@ Config is stored in `~/.aman-agent/config.json`:
945
1152
  "evalPrompt": true,
946
1153
  "autoSessionSave": true,
947
1154
  "extractMemories": true,
948
- "featureHints": true
1155
+ "featureHints": true,
1156
+ "personalityAdapt": true,
1157
+ "recordObservations": true,
1158
+ "autoPostmortem": true
949
1159
  }
950
1160
  }
951
1161
  ```
@@ -970,6 +1180,8 @@ All hooks are on by default. Disable any in `config.json`:
970
1180
  | `extractMemories` | Auto-extract memories from conversation |
971
1181
  | `featureHints` | Show progressive feature discovery tips |
972
1182
  | `personalityAdapt` | Adapt tone based on time, sentiment, and session signals |
1183
+ | `recordObservations` | Capture passive session telemetry to JSONL |
1184
+ | `autoPostmortem` | Auto-generate post-mortem on session end (smart trigger) |
973
1185
 
974
1186
  > Treat the config file like a credential — it contains your API key.
975
1187
 
@@ -1052,17 +1264,75 @@ aman
1052
1264
 
1053
1265
  ---
1054
1266
 
1267
+ ## FAQ
1268
+
1269
+ <details>
1270
+ <summary><strong>Is my data sent anywhere?</strong></summary>
1271
+
1272
+ No. All memory, observations, and post-mortems live in your local filesystem (`~/.acore`, `~/.amem`, `~/.aman-agent`). The only data leaving your machine is what you send to your chosen LLM provider — and you control that with your own API key.
1273
+
1274
+ </details>
1275
+
1276
+ <details>
1277
+ <summary><strong>Can I use this without Claude?</strong></summary>
1278
+
1279
+ Yes. aman-agent supports Anthropic, OpenAI, Ollama (local), GitHub Copilot, and the Claude Code CLI as authentication backends. Anything that speaks tool use will work — see [Supported LLMs](#supported-llms).
1280
+
1281
+ </details>
1282
+
1283
+ <details>
1284
+ <summary><strong>How is this different from Claude Code's memory or `mem0`?</strong></summary>
1285
+
1286
+ Claude Code's memory is markdown read at startup — no per-message recall, no learning. `mem0` is a cloud vector DB focused on OpenAI. **amem** (the memory layer aman-agent uses) is local SQLite + embeddings + a knowledge graph, with typed memories, progressive disclosure (~10x token savings), reminders, and consolidation. See [the comparison table](#what-makes-this-different).
1287
+
1288
+ </details>
1289
+
1290
+ <details>
1291
+ <summary><strong>What does "progressive disclosure" mean for memory?</strong></summary>
1292
+
1293
+ Instead of injecting full memory content (~500-1000 tokens) on every recall, the agent injects a compact index (~50-100 tokens) with IDs and previews. The LLM can then call `memory_detail` with specific IDs if it needs full content. Result: ~10x token savings on most turns.
1294
+
1295
+ </details>
1296
+
1297
+ <details>
1298
+ <summary><strong>How do I disable post-mortems / observations?</strong></summary>
1299
+
1300
+ Set `recordObservations: false` and/or `autoPostmortem: false` in `~/.aman-agent/config.json`. You can still generate post-mortems on demand with `/postmortem` even if auto-trigger is off.
1301
+
1302
+ </details>
1303
+
1304
+ <details>
1305
+ <summary><strong>Does this work in CI / non-interactive mode?</strong></summary>
1306
+
1307
+ aman-agent is primarily an interactive REPL. For programmatic use, the underlying packages (`@aman_asmuei/amem`, `acore-core`, `arules-core`) are available as standalone Node libraries.
1308
+
1309
+ </details>
1310
+
1311
+ <details>
1312
+ <summary><strong>I'm getting "MCP error -32000: Connection closed"</strong></summary>
1313
+
1314
+ This usually means an MCP server crashed on startup. Run `npx @aman_asmuei/aman-mcp` directly to see the underlying error. The most common cause is a stale package install — try `rm -rf ~/.npm/_npx && npx @aman_asmuei/aman-agent`.
1315
+
1316
+ </details>
1317
+
1318
+ ---
1319
+
1055
1320
  ## Contributing
1056
1321
 
1057
1322
  ```bash
1058
1323
  git clone https://github.com/amanasmuei/aman-agent.git
1059
1324
  cd aman-agent && npm install
1060
1325
  npm run build # zero errors
1061
- npm test # 111 tests pass
1326
+ npm test # 304 tests pass
1062
1327
  ```
1063
1328
 
1064
1329
  PRs welcome. See [Issues](https://github.com/amanasmuei/aman-agent/issues).
1065
1330
 
1331
+ **Project standards:**
1332
+ - All new modules ship with tests (TDD encouraged)
1333
+ - Type errors block merge — `npm run build` must be clean
1334
+ - Commits follow conventional format (`feat:`, `fix:`, `chore:`, `docs:`)
1335
+
1066
1336
  ---
1067
1337
 
1068
1338
  <p align="center">