@aman_asmuei/aman-agent 0.24.3 → 0.25.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,93 @@
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-v0240)
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.24.0
84
+
85
+ > **Session telemetry, post-mortem analysis, and a smarter feedback loop.**
86
+
87
+ The agent now passively observes what happens during a session — tool calls, file changes, sentiment shifts, blockers, milestones — and on session end can generate a structured post-mortem with actionable patterns stored back as memories.
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
+ | **Observation system** | Passive event capture: tool calls, errors, file changes, sentiment, topic shifts, blockers, milestones all written to JSONL, never blocking the user |
92
+ | **Post-mortem reports** | LLM-generated session analysis with goals, completed work, blockers, decisions, sentiment arc, recurring patterns, and recommendations |
93
+ | **Smart auto-trigger** | Reports generate automatically when sessions hit ≥3 tool errors, ≥2 blockers, &gt;60min, abandoned plan steps, or sustained frustration |
94
+ | **Pattern memory loop** | Recurring patterns from post-mortems are stored as `pattern` memories — your AI learns from its own session history |
95
+ | **`/observe` dashboard** | Live session stats: tool calls, errors, files changed, blockers, milestones, topic shifts |
96
+ | **`/postmortem` commands** | Generate now, view last, list all, or `--since 7d` for cross-session trend analysis |
97
+ | **Eval reliability fix** | `/eval report` now uses `fs.existsSync` instead of an ANSI-sensitive prefix check |
98
+ | **CI dependency stability** | Switched `npm ci` `npm install` to handle platform-specific native deps |
99
+
100
+ <details>
101
+ <summary><strong>Highlights from earlier releases</strong></summary>
102
+
103
+ **v0.18 — User onboarding**
104
+ - Interactive first-run setup capturing name, role, expertise, communication style
105
+ - 13 showcase templates (fitness, freelancer, Muslim, finance, etc.)
106
+ - `/profile me` and `/profile edit` for user identity management
107
+
108
+ **v0.16 — Session resilience**
109
+ - Streaming cancellation (Ctrl+C aborts response, not session)
110
+ - Session checkpointing every 10 turns — crash-safe
111
+ - MCP auto-reconnect on connection failure
112
+ - Token-safe tool loop with conversation trimming inside
113
+ - Non-blocking memory extraction
114
+
115
+ **v0.14 — Sub-agent infrastructure**
116
+ - Sub-agent guardrails enforce same safety rules as main agent
117
+ - Sub-agent memory recall for better delegation context
118
+ - 16K system prompt token ceiling
119
+
120
+ </details>
121
+
122
+ <a href="https://github.com/amanasmuei/aman-agent/releases">Full release history →</a>
66
123
 
67
124
  ---
68
125
 
@@ -152,7 +209,10 @@ aman-agent --budget 12000
152
209
 
153
210
  ## Usage Guide
154
211
 
155
- A step-by-step walkthrough of how to use aman-agent day-to-day.
212
+ A step-by-step walkthrough of how to use aman-agent day-to-day. Click any section below to expand.
213
+
214
+ <details open>
215
+ <summary><strong>Your First Conversation</strong></summary>
156
216
 
157
217
  ### Your First Conversation
158
218
 
@@ -185,6 +245,11 @@ You > Hey, I'm working on a Node.js API
185
245
 
186
246
  That's it. No setup required. The agent remembers your stack from this point forward.
187
247
 
248
+ </details>
249
+
250
+ <details>
251
+ <summary><strong>How Memory Works</strong></summary>
252
+
188
253
  ### How Memory Works
189
254
 
190
255
  Memory is automatic. You don't need to do anything — the agent silently extracts important information from every conversation:
@@ -217,6 +282,11 @@ You > Let's add a new endpoint
217
282
  /decisions View your decision log
218
283
  ```
219
284
 
285
+ </details>
286
+
287
+ <details>
288
+ <summary><strong>Working with Files & Images</strong></summary>
289
+
220
290
  ### Working with Files & Images
221
291
 
222
292
  Reference any file path in your message — it gets attached automatically:
@@ -248,6 +318,11 @@ You > What's wrong with this schema? ~/Desktop/schema.png
248
318
 
249
319
  Multiple files in one message work too.
250
320
 
321
+ </details>
322
+
323
+ <details>
324
+ <summary><strong>Working with Plans</strong></summary>
325
+
251
326
  ### Working with Plans
252
327
 
253
328
  Plans help you track multi-step work that spans sessions.
@@ -310,6 +385,11 @@ $ aman-agent
310
385
 
311
386
  Plans are stored as markdown in `.acore/plans/` — they're git-trackable.
312
387
 
388
+ </details>
389
+
390
+ <details>
391
+ <summary><strong>Skills in Action</strong></summary>
392
+
313
393
  ### Skills in Action
314
394
 
315
395
  Skills activate automatically based on what you're talking about. No commands needed.
@@ -340,6 +420,11 @@ Skills also self-improve — when the agent learns your patterns (e.g., "user pr
340
420
 
341
421
  **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
422
 
423
+ </details>
424
+
425
+ <details>
426
+ <summary><strong>Project Workflow</strong></summary>
427
+
343
428
  ### Project Workflow
344
429
 
345
430
  aman-agent is project-aware. When you run it in a project directory, it loads project-specific context.
@@ -366,6 +451,11 @@ cd ~/project-b && aman-agent # Loads project-b context + memories
366
451
 
367
452
  Global preferences (coding style, tool choices) carry across all projects.
368
453
 
454
+ </details>
455
+
456
+ <details>
457
+ <summary><strong>Personality & Wellbeing</strong></summary>
458
+
369
459
  ### Personality & Wellbeing
370
460
 
371
461
  The agent adapts its tone based on time of day and how you're doing:
@@ -394,6 +484,11 @@ You > ugh nothing works, tried everything!!
394
484
 
395
485
  These are one-time nudges — the agent won't nag.
396
486
 
487
+ </details>
488
+
489
+ <details>
490
+ <summary><strong>Customization</strong></summary>
491
+
397
492
  ### Customization
398
493
 
399
494
  **Persona presets** for different work styles:
@@ -432,6 +527,11 @@ aman-agent init
432
527
 
433
528
  Set any to `false` to disable.
434
529
 
530
+ </details>
531
+
532
+ <details>
533
+ <summary><strong>Showcase Templates</strong></summary>
534
+
435
535
  ### Showcase Templates
436
536
 
437
537
  Give your companion a pre-built specialty from [aman-showcase](https://github.com/amanasmuei/aman-showcase):
@@ -460,6 +560,11 @@ npx @aman_asmuei/aman-showcase install muslim
460
560
 
461
561
  Each template includes identity, workflows, rules, and domain skills — all installed into your ecosystem.
462
562
 
563
+ </details>
564
+
565
+ <details>
566
+ <summary><strong>Your Profile vs Agent Profiles</strong></summary>
567
+
463
568
  ### Your Profile vs Agent Profiles
464
569
 
465
570
  **Your profile** is who YOU are — name, role, expertise, communication style. Set during onboarding, injected into every conversation:
@@ -486,6 +591,11 @@ Each agent profile has its own identity, rules, and skills — but shares the sa
486
591
  /profile list Show all profiles
487
592
  ```
488
593
 
594
+ </details>
595
+
596
+ <details>
597
+ <summary><strong>Agent Delegation</strong></summary>
598
+
489
599
  ### Agent Delegation
490
600
 
491
601
  Delegate tasks to sub-agents with specialist profiles:
@@ -511,6 +621,11 @@ Delegate tasks to sub-agents with specialist profiles:
511
621
 
512
622
  The AI also **auto-suggests delegation** when it recognizes a task matches a specialist profile — always asks for your permission first.
513
623
 
624
+ </details>
625
+
626
+ <details>
627
+ <summary><strong>Agent Teams</strong></summary>
628
+
514
629
  ### Agent Teams
515
630
 
516
631
  Named teams of agents that collaborate on complex tasks:
@@ -553,6 +668,80 @@ Create custom teams:
553
668
 
554
669
  The AI auto-suggests teams when appropriate — always asks permission first.
555
670
 
671
+ </details>
672
+
673
+ <details>
674
+ <summary><strong>Session Telemetry & Post-Mortems</strong> (new in v0.24)</summary>
675
+
676
+ ### Session Telemetry & Post-Mortems
677
+
678
+ aman-agent now passively observes what happens during a session and can produce a structured post-mortem on demand or automatically.
679
+
680
+ **Live observation dashboard:**
681
+
682
+ ```
683
+ You > /observe
684
+
685
+ Session: 47 min | Tools: 23 calls (2 errors) | Files: 5 changed
686
+ Blockers: 1 | Milestones: 3 | Topic shifts: 2
687
+ ```
688
+
689
+ **Pause / resume capture** when you don't want noisy commands recorded:
690
+
691
+ ```
692
+ You > /observe pause
693
+ Observation paused. Use /observe resume to continue.
694
+ ```
695
+
696
+ **Generate a post-mortem on demand:**
697
+
698
+ ```
699
+ You > /postmortem
700
+
701
+ # Post-Mortem: 2026-04-11
702
+ **Session:** session-2026-04-11-2143 | **Duration:** 47 min | **Turns:** 23
703
+
704
+ ## Summary
705
+ Refactored the auth middleware and shipped JWT validation...
706
+
707
+ ## Completed
708
+ - [x] Extracted token handler
709
+ - [x] Wired rate limiter
710
+
711
+ ## Blockers
712
+ - Rate limit hit on token endpoint mid-session
713
+
714
+ ## Patterns
715
+ - Detect rate limits earlier
716
+ ...
717
+
718
+ Saved → ~/.acore/postmortems/2026-04-11-sess.md
719
+ ```
720
+
721
+ **Automatic on session end** when any of these triggers fire:
722
+ - ≥3 tool errors
723
+ - ≥2 user blockers
724
+ - &gt;60 minute session
725
+ - Plan steps abandoned
726
+ - Sustained frustration (5+ frustration signals)
727
+
728
+ Recurring patterns from the report are stored as `pattern` memories so the next session benefits.
729
+
730
+ **Cross-session trends:**
731
+
732
+ ```
733
+ /postmortem --since 7d Analyze the last 7 days of post-mortems
734
+ /postmortem last Show the most recent report
735
+ /postmortem list List all saved post-mortems
736
+ ```
737
+
738
+ **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.
739
+
740
+ </details>
741
+
742
+ <details>
743
+ <summary><strong>Daily Workflow Summary</strong></summary>
744
+
556
745
  ### Daily Workflow Summary
557
746
 
558
747
  Here's what a typical day looks like with aman-agent:
@@ -581,9 +770,13 @@ Next morning:
581
770
  → Everything picks up where you left off
582
771
  ```
583
772
 
773
+ </details>
774
+
584
775
  ---
585
776
 
586
- ## Intelligent Companion Features
777
+ ## Features
778
+
779
+ ### Intelligent Companion Features
587
780
 
588
781
  ### Per-Message Memory Recall with Progressive Disclosure
589
782
 
@@ -761,6 +954,14 @@ On every startup, the agent automatically merges duplicate memories, prunes stal
761
954
 
762
955
  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
956
 
957
+ ### Passive Session Observation
958
+
959
+ 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`.
960
+
961
+ ### LLM-Powered Post-Mortems
962
+
963
+ 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/`.
964
+
764
965
  ---
765
966
 
766
967
  ## How It Works
@@ -846,6 +1047,8 @@ Every operation that can fail logs to `~/.aman-agent/debug.log` with structured
846
1047
  | `/skills` | View skills `[install\|uninstall ...]` |
847
1048
  | `/eval` | View evaluation `[milestone ...]` |
848
1049
  | `/memory` | View memories `[search\|clear\|timeline]` |
1050
+ | `/observe` | Live session telemetry dashboard `[pause\|resume]` |
1051
+ | `/postmortem` | Generate session post-mortem `[last\|list\|--since 7d]` |
849
1052
  | `/decisions` | View decision log `[<project>]` |
850
1053
  | `/export` | Export conversation to markdown |
851
1054
  | `/debug` | Show debug log (last 20 entries) |
@@ -945,7 +1148,10 @@ Config is stored in `~/.aman-agent/config.json`:
945
1148
  "evalPrompt": true,
946
1149
  "autoSessionSave": true,
947
1150
  "extractMemories": true,
948
- "featureHints": true
1151
+ "featureHints": true,
1152
+ "personalityAdapt": true,
1153
+ "recordObservations": true,
1154
+ "autoPostmortem": true
949
1155
  }
950
1156
  }
951
1157
  ```
@@ -970,6 +1176,8 @@ All hooks are on by default. Disable any in `config.json`:
970
1176
  | `extractMemories` | Auto-extract memories from conversation |
971
1177
  | `featureHints` | Show progressive feature discovery tips |
972
1178
  | `personalityAdapt` | Adapt tone based on time, sentiment, and session signals |
1179
+ | `recordObservations` | Capture passive session telemetry to JSONL |
1180
+ | `autoPostmortem` | Auto-generate post-mortem on session end (smart trigger) |
973
1181
 
974
1182
  > Treat the config file like a credential — it contains your API key.
975
1183
 
@@ -1052,17 +1260,75 @@ aman
1052
1260
 
1053
1261
  ---
1054
1262
 
1263
+ ## FAQ
1264
+
1265
+ <details>
1266
+ <summary><strong>Is my data sent anywhere?</strong></summary>
1267
+
1268
+ 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.
1269
+
1270
+ </details>
1271
+
1272
+ <details>
1273
+ <summary><strong>Can I use this without Claude?</strong></summary>
1274
+
1275
+ 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).
1276
+
1277
+ </details>
1278
+
1279
+ <details>
1280
+ <summary><strong>How is this different from Claude Code's memory or `mem0`?</strong></summary>
1281
+
1282
+ 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).
1283
+
1284
+ </details>
1285
+
1286
+ <details>
1287
+ <summary><strong>What does "progressive disclosure" mean for memory?</strong></summary>
1288
+
1289
+ 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.
1290
+
1291
+ </details>
1292
+
1293
+ <details>
1294
+ <summary><strong>How do I disable post-mortems / observations?</strong></summary>
1295
+
1296
+ 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.
1297
+
1298
+ </details>
1299
+
1300
+ <details>
1301
+ <summary><strong>Does this work in CI / non-interactive mode?</strong></summary>
1302
+
1303
+ 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.
1304
+
1305
+ </details>
1306
+
1307
+ <details>
1308
+ <summary><strong>I'm getting "MCP error -32000: Connection closed"</strong></summary>
1309
+
1310
+ 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`.
1311
+
1312
+ </details>
1313
+
1314
+ ---
1315
+
1055
1316
  ## Contributing
1056
1317
 
1057
1318
  ```bash
1058
1319
  git clone https://github.com/amanasmuei/aman-agent.git
1059
1320
  cd aman-agent && npm install
1060
1321
  npm run build # zero errors
1061
- npm test # 111 tests pass
1322
+ npm test # 304 tests pass
1062
1323
  ```
1063
1324
 
1064
1325
  PRs welcome. See [Issues](https://github.com/amanasmuei/aman-agent/issues).
1065
1326
 
1327
+ **Project standards:**
1328
+ - All new modules ship with tests (TDD encouraged)
1329
+ - Type errors block merge — `npm run build` must be clean
1330
+ - Commits follow conventional format (`feat:`, `fix:`, `chore:`, `docs:`)
1331
+
1066
1332
  ---
1067
1333
 
1068
1334
  <p align="center">