universal-agent-memory 6.1.0 → 6.2.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
@@ -5,429 +5,267 @@
5
5
 
6
6
  <div align="center">
7
7
 
8
- ### What if your AI coding assistant could *remember*?
8
+ ### AI coding assistants that remember
9
9
 
10
10
  **Every lesson learned. Every bug fixed. Every architectural decision.**
11
11
 
12
- *Not just in one conversation—but forever.*
12
+ _Not just in one conversation—but forever._
13
13
 
14
14
  </div>
15
15
 
16
16
  ---
17
17
 
18
- UAM transforms stateless AI coding assistants into **persistent, coordinated agents** that learn from every interaction and never make the same mistake twice.
18
+ ## Quick Start (30 seconds)
19
19
 
20
20
  ```bash
21
- npm install -g universal-agent-memory && cd your-project && uam init
22
- ```
23
-
24
- **30 seconds to superhuman AI.**
25
-
26
- ---
27
-
28
- ## The Problem We Solve
29
-
30
- Every time you start a new conversation with your AI assistant:
31
-
32
- - It forgets your project's architectural decisions
33
- - It suggests patterns you've already rejected
34
- - It reintroduces bugs you've already fixed
35
- - It doesn't know *why* the code is the way it is
36
-
37
- **You're constantly re-teaching the same lessons.**
38
-
39
- UAM fixes this by giving AI agents:
40
-
41
- | Capability | What It Means |
42
- |------------|---------------|
43
- | **4-Layer Memory** | Recall decisions from months ago |
44
- | **Hierarchical Memory** | Hot/warm/cold tiering with auto-promotion |
45
- | **58 Optimizations** | Battle-tested from Terminal-Bench 2.0 benchmarking |
46
- | **Pattern Router** | Auto-selects optimal patterns per task |
47
- | **Adaptive Context** | Selectively loads context based on task type and history |
48
- | **Multi-Agent Coordination** | Multiple AIs work without conflicts |
49
- | **Worktree Isolation** | No accidental commits to main |
50
- | **Code Field** | 89% bug detection vs 39% baseline |
51
- | **Completion Gates** | 3 mandatory checks before "done" |
52
- | **MCP Router** | 98%+ token reduction for multi-tool contexts |
53
- | **Pre-execution Hooks** | Domain-specific setup before agent runs |
54
-
55
- ---
21
+ # Install
22
+ npm install -g universal-agent-memory
56
23
 
57
- ## See It In Action
24
+ # Run complete setup (installs dependencies, git hooks, etc.)
25
+ npm run setup
58
26
 
59
- ```bash
60
- # Agent A starts work
61
- $ uam task create --title "Fix auth vulnerability" --type bug --priority 0
62
- ✓ Task created: UAM-042
63
-
64
- $ uam worktree create fix-auth
65
- ✓ Created worktree: 001-fix-auth
66
- Branch: feature/001-fix-auth
67
- Path: .worktrees/001-fix-auth
68
-
69
- $ uam agent announce --resource src/auth/* --intent editing
70
- ✓ Work announced. No conflicts detected.
71
-
72
- # Meanwhile, Agent B checks for conflicts
73
- $ uam agent overlaps --resource src/auth/*
74
- ⚠ Agent A (fix-auth) is editing src/auth/*
75
- Suggestion: Wait for completion or coordinate merge order
76
-
77
- # Agent A completes and the lesson is preserved
78
- $ uam memory store "CSRF vulnerability in auth: always validate origin header"
79
- ✓ Stored in memory (importance: 8/10)
80
-
81
- # Weeks later, ANY agent on this project will know:
82
- $ uam memory query "auth security"
83
- [2024-03-15] CSRF vulnerability in auth: always validate origin header
84
- [2024-02-28] Session tokens must be httpOnly and secure
85
- [2024-01-10] Auth refresh flow: use rotating tokens
27
+ # Initialize in your project
28
+ uam init
86
29
  ```
87
30
 
88
- **The AI never forgets. The team never re-learns.**
31
+ That's it. Your AI now has persistent memory and follows proven workflows.
89
32
 
90
33
  ---
91
34
 
92
- ## Why Developers Love UAM
35
+ ## Complete Setup
93
36
 
94
- ### "My AI Finally Understands My Codebase"
37
+ For a full installation with all features:
95
38
 
96
- > *"After 3 months of using UAM, my Claude instance knows more about our architecture than most junior devs. It remembers that we chose Redux over MobX because of time-travel debugging, that our API uses snake_case because of the Python backend, that the auth flow was refactored twice. It's like pair programming with someone who has perfect recall."*
39
+ ```bash
40
+ # Install UAM CLI
41
+ npm install -g universal-agent-memory
97
42
 
98
- ### "Zero Merge Conflicts in Multi-Agent Workflows"
43
+ # Run comprehensive setup
44
+ npm run setup
45
+ # This will:
46
+ # ✓ Check and install dependencies
47
+ # ✓ Install npm packages
48
+ # ✓ Build TypeScript
49
+ # ✓ Configure git hooks (pre-commit, commit-msg, pre-push)
50
+ # ✓ Set up GitHub PR templates
51
+ ```
99
52
 
100
- > *"We run 5 agents in parallel on different features. Before UAM, we had merge conflicts daily. Now? Zero. The agents announce their work, check for overlaps, and coordinate merge order automatically. It's like they're a team."*
53
+ ### Requirements
101
54
 
102
- ### "Our CI Bill Dropped 70%"
55
+ **Required:**
103
56
 
104
- > *"UAM's deploy batcher changed everything. Instead of 15 CI runs from rapid commits, we get 1-2. Same work, fraction of the cost. The commit squashing alone paid for the setup time."*
57
+ - Node.js >= 18.0.0
58
+ - npm
59
+ - git
60
+ - npx
105
61
 
106
- ---
62
+ **Optional (recommended):**
107
63
 
108
- ## Key Features
64
+ - Docker - for local Qdrant semantic search
65
+ - Python 3 - for Pattern RAG indexing
66
+ - pre-commit - for advanced git hooks
109
67
 
110
- ### 🧠 Endless Context Through Project Memory
68
+ ### Installing Dependencies
111
69
 
112
- **Your AI's context is NOT limited to the conversation.**
70
+ **macOS:**
113
71
 
114
- Memory persists with the project in SQLite databases that travel with the code:
115
-
116
- ```
117
- agents/data/memory/
118
- ├── short_term.db # L1/L2: Recent actions + session memories (SQLite)
119
- ├── long_term_prepopulated.json # L3: Prepopulated learnings for search
120
- └── historical_context.db # Adaptive context + semantic cache (SQLite/WAL)
72
+ ```bash
73
+ brew install node git python docker
121
74
  ```
122
75
 
123
- This means:
124
- - Recall decisions from weeks/months ago
125
- - Learn from past mistakes (gotchas never repeated)
126
- - Understand why code is the way it is
127
- - Seamless handoff between sessions
76
+ **Ubuntu/Debian:**
128
77
 
129
- **The AI queries memory before every task** - it never starts from zero.
130
-
131
- ### 🎯 Intelligent Task Routing
132
-
133
- Tasks automatically route to specialized expert droids:
134
-
135
- | Task Type | Routed To | Result |
136
- |-----------|-----------|--------|
137
- | TypeScript/JS | `typescript-node-expert` | Proper typing, async patterns |
138
- | Security review | `security-auditor` | OWASP checks, secrets detection |
139
- | Performance | `performance-optimizer` | Algorithm analysis, caching |
140
- | Documentation | `documentation-expert` | Complete, accurate docs |
141
- | Code quality | `code-quality-guardian` | SOLID, complexity checks |
142
-
143
- **Missing an expert?** The AI generates one:
144
78
  ```bash
145
- uam droids add rust-expert --capabilities "ownership,lifetimes,async" --triggers "*.rs"
79
+ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
80
+ sudo apt-get install -y nodejs python3 docker.io
146
81
  ```
147
82
 
148
- ### 🎯 Pattern Router - Battle-Tested Intelligence
83
+ **Windows:**
149
84
 
150
- **58 optimizations in v2.7.0 from Terminal-Bench 2.0 analysis.**
85
+ ```powershell
86
+ winget install OpenJS.NodeJS.LTS
87
+ winget install Git.Git
88
+ winget install Python.Python.3.12
89
+ winget install Docker.DockerDesktop
90
+ ```
151
91
 
152
- Before ANY task, UAM's Pattern Router auto-selects which patterns apply:
92
+ ---
153
93
 
154
- ```
155
- === PATTERN ROUTER ===
156
- Task: Implement user authentication
157
- Classification: file-creation
158
- PATTERNS: P12:[Y] P17:[Y] P20:[N] P11:[N] P35:[N]
159
- ACTIVE: P3, P12, P17
160
- BLOCKING: [none]
161
- VERIFIER: [read tests first]
162
- === END ===
163
- ```
94
+ ## Recommended Platform: **opencode**
164
95
 
165
- **Key Patterns:**
166
-
167
- | Pattern | Name | Impact |
168
- |---------|------|--------|
169
- | **P12** | Output Existence Verification | Fixes 37% of agent failures |
170
- | **P17** | Constraint Extraction | Catches "exactly/only/single" requirements |
171
- | **P3** | Pre-execution State Protection | Backups before destructive actions |
172
- | **P20** | Adversarial Thinking | Attack mindset for security bypass tasks |
173
- | **P35** | Decoder-First Analysis | Read decoder BEFORE writing encoder |
174
- | **P11** | Pre-Computed Solutions | Use libraries (Stockfish, scipy) not custom code |
175
-
176
- **Pattern Categories:**
177
- - **Core (P1-P12)**: Tool checks, state protection, output verification
178
- - **Constraints (P17)**: Extract hidden requirements from task descriptions
179
- - **Domain (P21-P26)**: Chess, git recovery, compression, polyglot code
180
- - **Verification (P27-P31)**: Output cleanup, smoke tests, round-trip checks
181
- - **Advanced (P32-P36)**: CLI execution, numerical stability, decoder-first analysis
182
-
183
- **Optimization Categories (#40-#58):**
184
- - **Code Field (#40)**: State assumptions before coding
185
- - **Pattern Router (#41, #47)**: Auto-classification and blocking gates
186
- - **Verifier-First (#53)**: Read tests before implementing
187
- - **Near-Miss Handling (#54)**: 60-89% pass = fix specific failures, don't change approach
188
- - **Compression (#55-#57)**: Reduced template size while preserving effectiveness
96
+ UAM is optimized for **[opencode](https://opencode.ai)** - the local AI coding platform that provides:
189
97
 
190
- ---
98
+ - **Persistent sessions** - Memory survives across sessions
99
+ - **Plugin architecture** - Pattern RAG, session hooks, and more
100
+ - **Local LLM support** - Run Qwen3.5 35B locally via llama.cpp
101
+ - **Built-in tooling** - File operations, bash, search, todo management
191
102
 
192
- ### 🔬 What Works vs What Doesn't (From 40-Task Benchmark)
103
+ ### Setup opencode (Recommended)
193
104
 
194
- **Strengths (100% pass rate in category):**
105
+ ```bash
106
+ # Install opencode
107
+ npm install -g opencode
195
108
 
196
- | Category | Why It Works |
197
- |----------|--------------|
198
- | **ML/Data Processing** | Clear data transformation, pandas/numpy operations |
199
- | **Graphics/Rendering** | Path tracing, POV-Ray - well-defined algorithms |
200
- | **Security Tasks** | Hash cracking, password recovery - tools available |
201
- | **Formal Verification** | Coq proofs - step-by-step tactics |
109
+ # Configure local LLM (optional, requires llama.cpp server)
110
+ # See: https://opencode.ai/docs/configuration
202
111
 
203
- **Weaknesses (Common failure modes):**
112
+ # Initialize UAM in your project
113
+ cd your-project
114
+ uam init
115
+ ```
204
116
 
205
- | Failure Mode | Fix |
206
- |--------------|-----|
207
- | **"File not created"** (37%) | P12 - Verify outputs exist before completing |
208
- | **Missed constraints** | P17 - Extract "exactly/only/single" keywords |
209
- | **First action destroys state** | P3 - Backup before agent runs |
210
- | **Impossible tasks attempted** | P5/P23 - Detect and refuse immediately |
211
- | **Complex toolchain setup** | Pre-execution hooks for dependencies |
117
+ The `opencode.json` configuration file automatically loads UAM plugins for:
212
118
 
213
- **Near-Misses (High-value improvements):**
119
+ - **Pattern RAG** - Context-aware pattern injection (~12K tokens saved)
120
+ - **Session hooks** - Pre-execution setup, memory preservation
121
+ - **Agent coordination** - Multi-agent workflows without conflicts
214
122
 
215
- | Task | Tests | Fix Needed |
216
- |------|-------|------------|
217
- | adaptive-rejection-sampler | 8/9 (89%) | Numerical edge case |
218
- | headless-terminal | 6/7 (86%) | Service startup timing |
219
- | db-wal-recovery | 5/7 (71%) | WAL parsing edge case |
123
+ ### Other Supported Platforms
220
124
 
221
- **Tasks That Will Never Pass (Without External Tools):**
222
- - `gpt2-codegolf` - Requires pre-computed weights (500MB → 5KB impossible)
223
- - `chess-best-move` - Requires vision/image parsing
224
- - `break-filter-js-from-html` - Requires pre-computed XSS bypass patterns
125
+ | Platform | Notes |
126
+ | --------------- | --------------------------------------- |
127
+ | **Factory.AI** | Works well, use `CLAUDE.md` for context |
128
+ | **Claude Code** | Desktop app, full UAM support |
129
+ | **VSCode** | Use with Claude Code extension |
130
+ | **claude.ai** | Web version, limited tooling |
225
131
 
226
132
  ---
227
133
 
228
- ### 🚦 Completion Gates - Mandatory Quality Checks
134
+ ## What UAM Gives You
229
135
 
230
- Three gates must pass before the AI reports "done":
136
+ ### 🧠 Persistent Memory
231
137
 
232
- | Gate | Check | If Fails |
233
- |------|-------|----------|
234
- | **Gate 1** | All output files exist | CREATE immediately |
235
- | **Gate 2** | All constraints satisfied | FIX violations |
236
- | **Gate 3** | All tests pass | ITERATE until 100% |
138
+ Your AI never forgets:
237
139
 
238
140
  ```bash
239
- # Gate 1: Verify outputs
240
- ls -la /expected/output.json /expected/result.txt
241
- # If missing → CREATE NOW, don't explain
242
-
243
- # Gate 2: Check constraints
244
- # Printed checklist with ☐/☑ for each requirement
141
+ # Store a lesson
142
+ uam memory store "Always validate CSRF tokens in auth flows"
245
143
 
246
- # Gate 3: Run tests
247
- npm test # Iterate on failures until 100%
144
+ # Query later (any agent, any session)
145
+ uam memory query "auth security"
248
146
  ```
249
147
 
250
- ---
148
+ Memory persists in SQLite databases that travel with your code:
149
+
150
+ - `agents/data/memory/short_term.db` - Recent actions + session memories
151
+ - Semantic search via Qdrant (optional, `uam memory start`)
251
152
 
252
- ### 🔒 Code Field - Better Code Generation
153
+ ### 🎯 Pattern Router
253
154
 
254
- Based on [context-field research](https://github.com/NeoVertex1/context-field), UAM includes a 4-line prompt that dramatically improves code quality:
155
+ Before every task, UAM auto-selects relevant patterns:
255
156
 
256
157
  ```
257
- Do not write code before stating assumptions.
258
- Do not claim correctness you haven't verified.
259
- Do not handle only the happy path.
260
- Under what conditions does this work?
158
+ === PATTERN ROUTER ===
159
+ Task: Fix authentication bug
160
+ Classification: bug-fix
161
+ ACTIVE: P3, P12, P17
162
+ BLOCKING: [none]
163
+ === END ===
261
164
  ```
262
165
 
263
- **Results from 72 tests:**
264
- - 100% assumption stating (vs 0% baseline)
265
- - 89% bug detection in code review (vs 39% baseline)
266
- - 100% refusal of impossible requests (vs 0% baseline)
267
- - 320% more hidden issues found in debugging
268
-
269
- Every code generation task applies Code Field automatically.
166
+ **58 battle-tested patterns** from Terminal-Bench 2.0 analysis:
270
167
 
271
- ### 🌳 Safe Git Workflows
168
+ - **P12** - Verify outputs exist (fixes 37% of failures)
169
+ - **P17** - Extract hidden constraints ("exactly", "only", "single")
170
+ - **P3** - Backup before destructive actions
171
+ - **P20** - Attack mindset for security tasks
272
172
 
273
- **The AI never commits directly to main.**
173
+ ### 🛡️ Completion Gates
274
174
 
275
- All changes use worktrees:
175
+ Three mandatory checks before "done":
276
176
 
277
- ```bash
278
- # AI automatically does this for every change
279
- uam worktree create my-feature
280
- # → Creates .worktrees/001-my-feature/
281
- # → Creates branch feature/001-my-feature
282
- # → Works in isolation
283
-
284
- uam worktree pr 001
285
- # → Pushes, creates PR, triggers reviews
286
-
287
- uam worktree cleanup 001
288
- # → Removes worktree after merge
289
- ```
177
+ 1. **Output Existence** - All expected files exist
178
+ 2. **Constraint Compliance** - All requirements verified
179
+ 3. **Tests Pass** - `npm test` 100%
290
180
 
291
- ### Complete Close-Out Workflow
181
+ ### 🌳 Safe Worktrees
292
182
 
293
- Work isn't "done" until it's deployed and verified:
183
+ No more accidental commits to main:
294
184
 
185
+ ```bash
186
+ uam worktree create my-feature
187
+ # → Creates isolated branch in .worktrees/
188
+ # → All changes tracked
189
+ uam worktree pr <id>
190
+ # → Creates PR, triggers reviews
191
+ uam worktree cleanup <id>
192
+ # → Clean removal after merge
295
193
  ```
296
- MERGE → DEPLOY → MONITOR → FIX (repeat until 100%)
297
- ```
298
-
299
- The AI follows this loop automatically:
300
- 1. Get PR approved, merge to main
301
- 2. Verify CI/CD runs, check deployment
302
- 3. Monitor logs, verify functionality
303
- 4. If issues: create hotfix worktree, repeat
304
194
 
305
- **The AI stores learnings after every completed task** for future sessions.
195
+ ### 🤖 Expert Droids
306
196
 
307
- ## Installation
197
+ Tasks automatically route to specialists:
308
198
 
309
- ### npm (Recommended)
199
+ | Task Type | Routed To |
200
+ | --------------- | ------------------------ |
201
+ | TypeScript/JS | `typescript-node-expert` |
202
+ | Security review | `security-auditor` |
203
+ | Performance | `performance-optimizer` |
204
+ | Documentation | `documentation-expert` |
310
205
 
311
- ```bash
312
- npm install -g universal-agent-memory
313
- ```
206
+ ---
314
207
 
315
- ### One-Line Installers
208
+ ## How It Works
316
209
 
317
- ```bash
318
- # Desktop (includes Docker for semantic search)
319
- bash <(curl -fsSL https://raw.githubusercontent.com/DammianMiller/universal-agent-memory/main/scripts/install-desktop.sh)
210
+ 1. **Install & init** - `npm i -g universal-agent-memory && uam init`
211
+ 2. **CLAUDE.md generated** - Auto-populated with project structure, commands, patterns
212
+ 3. **AI reads CLAUDE.md** - Follows embedded workflows automatically
213
+ 4. **Every task**:
214
+ - Pattern Router classifies task and selects patterns
215
+ - Adaptive context loads relevant memory
216
+ - Agent coordination checks for conflicts
217
+ - Worktree created for isolated changes
218
+ - Completion gates verify outputs, constraints, tests
219
+ - Learnings stored in memory
320
220
 
321
- # Web browsers (claude.ai, factory.ai)
322
- bash <(curl -fsSL https://raw.githubusercontent.com/DammianMiller/universal-agent-memory/main/scripts/install-web.sh)
323
- ```
221
+ ---
324
222
 
325
223
  ## Commands
326
224
 
327
225
  ### Essential
328
226
 
329
- | Command | Description |
330
- |---------|-------------|
331
- | `uam init` | Initialize/update UAM (auto-merges, never loses data) |
332
- | `uam generate` | Regenerate CLAUDE.md from project analysis |
333
- | `uam update` | Update templates while preserving customizations |
334
- | `uam analyze` | Analyze project structure and generate metadata |
227
+ | Command | Description |
228
+ | -------------- | ------------------------------------------------ |
229
+ | `uam init` | Initialize/update UAM (never loses data) |
230
+ | `uam generate` | Regenerate CLAUDE.md from project analysis |
231
+ | `uam update` | Update templates while preserving customizations |
335
232
 
336
233
  ### Memory
337
234
 
338
- | Command | Description |
339
- |---------|-------------|
340
- | `uam memory status` | Check memory system status |
341
- | `uam memory query <search>` | Search memories |
342
- | `uam memory store <content>` | Store a learning |
343
- | `uam memory start` | Start Qdrant for semantic search |
344
- | `uam memory prepopulate` | Populate from docs and git history |
235
+ | Command | Description |
236
+ | ---------------------------- | -------------------------------- |
237
+ | `uam memory status` | Check memory system status |
238
+ | `uam memory query <search>` | Search memories |
239
+ | `uam memory store <content>` | Store a learning |
240
+ | `uam memory start` | Start Qdrant for semantic search |
345
241
 
346
242
  ### Tasks
347
243
 
348
- | Command | Description |
349
- |---------|-------------|
350
- | `uam task create` | Create tracked task |
351
- | `uam task list` | List all tasks |
352
- | `uam task claim <id>` | Claim task (announces to other agents) |
353
- | `uam task release <id>` | Complete task |
354
- | `uam task ready` | List tasks ready to work on |
355
- | `uam task stats` | Show task statistics |
244
+ | Command | Description |
245
+ | ----------------------- | -------------------------------------- |
246
+ | `uam task create` | Create tracked task |
247
+ | `uam task list` | List all tasks |
248
+ | `uam task claim <id>` | Claim task (announces to other agents) |
249
+ | `uam task release <id>` | Complete task |
356
250
 
357
251
  ### Worktrees
358
252
 
359
- | Command | Description |
360
- |---------|-------------|
361
- | `uam worktree create <name>` | Create isolated branch |
362
- | `uam worktree pr <id>` | Create PR from worktree |
363
- | `uam worktree cleanup <id>` | Remove worktree |
364
- | `uam worktree list` | List all worktrees |
253
+ | Command | Description |
254
+ | ---------------------------- | ----------------------- |
255
+ | `uam worktree create <name>` | Create isolated branch |
256
+ | `uam worktree pr <id>` | Create PR from worktree |
257
+ | `uam worktree cleanup <id>` | Remove worktree |
365
258
 
366
259
  ### Droids
367
260
 
368
- | Command | Description |
369
- |---------|-------------|
370
- | `uam droids list` | List available expert droids |
371
- | `uam droids add <name>` | Create new expert droid |
372
- | `uam droids import <path>` | Import droids from another platform |
373
-
374
- ### Coordination
375
-
376
- | Command | Description |
377
- |---------|-------------|
378
- | `uam agent status` | View active agents |
379
- | `uam agent overlaps` | Check for file conflicts |
380
- | `uam agent announce` | Announce intent to work on a resource |
381
- | `uam coord status` | Coordination overview |
382
-
383
- ### Deploy Batching
384
-
385
- | Command | Description |
386
- |---------|-------------|
387
- | `uam deploy queue` | Queue a deploy action for batching |
388
- | `uam deploy batch` | Create a batch from pending actions |
389
- | `uam deploy execute` | Execute a deploy batch |
390
- | `uam deploy flush` | Flush all pending deploys |
391
-
392
- ### Multi-Model Architecture
393
-
394
- | Command | Description |
395
- |---------|-------------|
396
- | `uam model status` | Show model router status |
397
- | `uam model list` | List available models |
398
- | `uam model fingerprint` | Show model performance fingerprints |
399
-
400
- ### MCP Router (98%+ token reduction)
401
-
402
- | Command | Description |
403
- |---------|-------------|
404
- | `uam mcp-router start` | Start hierarchical MCP router |
405
- | `uam mcp-router stats` | Show router statistics and token savings |
406
- | `uam mcp-router discover` | Discover tools matching a query |
407
- | `uam mcp-router list` | List configured MCP servers |
408
-
409
- ## How It Works
410
-
411
- 1. **Install & Init**: `npm i -g universal-agent-memory && uam init`
412
-
413
- 2. **CLAUDE.md Generated**: Auto-populated with project structure, commands, patterns, droids, and memory system instructions
414
-
415
- 3. **AI Reads CLAUDE.md**: Follows the embedded workflows automatically
261
+ | Command | Description |
262
+ | ----------------------- | ---------------------------- |
263
+ | `uam droids list` | List available expert droids |
264
+ | `uam droids add <name>` | Create new expert droid |
416
265
 
417
- 4. **Every Task**:
418
- - Pattern Router classifies task and selects applicable patterns
419
- - Adaptive context decides what memory to load (none/minimal/full)
420
- - Dynamic retrieval queries relevant memories from all tiers
421
- - Check for agent overlaps before starting work
422
- - Route to specialist droids if needed
423
- - Create worktree for isolated changes
424
- - Apply Code Field for better code generation
425
- - Run completion gates: outputs exist, constraints met, tests pass
426
- - Store learnings in memory for future sessions
427
-
428
- 5. **Close-Out**: Merge → Deploy → Monitor → Fix loop until 100%
266
+ ---
429
267
 
430
- ## Memory Architecture
268
+ ## Architecture
431
269
 
432
270
  ### 4-Layer Memory System
433
271
 
@@ -440,47 +278,53 @@ bash <(curl -fsSL https://raw.githubusercontent.com/DammianMiller/universal-agen
440
278
  └─────────────────────────────────────────────────────────────────┘
441
279
  ```
442
280
 
443
- ### Hierarchical Memory (Hot/Warm/Cold Tiering)
444
-
445
- On top of the 4-layer system, UAM implements hierarchical memory management:
446
-
447
- ```
448
- HOT (10 entries) → In-context, always included → <1ms access
449
- WARM (50 entries) → Cached, promoted on access → <5ms access
450
- COLD (500 entries) → Archived, semantic search only → ~50ms access
451
- ```
452
-
453
- - **Time-decay importance**: `importance * (0.95 ^ days_since_access)`
454
- - **Auto-promotion**: Frequently accessed cold/warm entries promote to hotter tiers
455
- - **Consolidation**: Old warm entries summarized into compressed cold entries
456
- - **SQLite persistence**: Survives across sessions via `hierarchical_memory` table
281
+ ### Hierarchical Memory (Hot/Warm/Cold)
457
282
 
458
- ### Adaptive Context System
283
+ - **HOT** (10 entries) - In-context, always included → <1ms access
284
+ - **WARM** (50 entries) - Cached, promoted on access → <5ms access
285
+ - **COLD** (500 entries) - Archived, semantic search → ~50ms access
459
286
 
460
- The memory system selectively loads context based on task classification:
287
+ ### Pattern RAG
461
288
 
462
- - **21 optimizations** including SQLite-backed historical benefit tracking
463
- - **TF-IDF-like keyword scoring** for section relevance
464
- - **13 domain-specific context sections** (security, file formats, git recovery, etc.)
465
- - **Error-to-section mapping** for progressive escalation on failure
466
- - **Semantic caching** for task-to-outcome mappings
289
+ Dynamically retrieves relevant patterns from Qdrant:
467
290
 
468
- ### Additional Memory Features
291
+ - Queries `agent_patterns` collection
292
+ - Injects ~2 patterns per task (saves ~12K tokens)
293
+ - Filters by similarity score (default 0.35)
294
+ - Avoids duplicate injections per session
469
295
 
470
- - **Dynamic retrieval**: Adaptive depth based on query complexity (simple/moderate/complex)
471
- - **Semantic compression**: 2-3x token reduction while preserving meaning
472
- - **Speculative cache**: Pre-warms queries based on category patterns
473
- - **Deduplication**: SHA-256 content hash + Jaccard similarity (0.8 threshold)
474
- - **Feedback loop**: `recordTaskFeedback()` captures success/failure to improve future runs
475
- - **Model router**: Per-model performance fingerprints by task category
296
+ ---
476
297
 
477
- **Data is never deleted.** Memory databases persist with the project.
298
+ ## Configuration
478
299
 
479
- Update with `uam init` or `uam generate` always merges - nothing is lost.
300
+ ### opencode.json (Platform-specific)
480
301
 
481
- ## Configuration
302
+ ```json
303
+ {
304
+ "$schema": "https://opencode.ai/config.json",
305
+ "provider": {
306
+ "llama.cpp": {
307
+ "name": "llama-server (local)",
308
+ "options": {
309
+ "baseURL": "http://localhost:8080/v1",
310
+ "apiKey": "sk-qwen35b"
311
+ },
312
+ "models": {
313
+ "qwen35-a3b-iq4xs": {
314
+ "name": "Qwen3.5 35B A3B (IQ4_XS)",
315
+ "limit": {
316
+ "context": 262144,
317
+ "output": 16384
318
+ }
319
+ }
320
+ }
321
+ }
322
+ },
323
+ "model": "llama.cpp/qwen35-a3b-iq4xs"
324
+ }
325
+ ```
482
326
 
483
- Configuration in `.uam.json`:
327
+ ### .uam.json (Project-specific)
484
328
 
485
329
  ```json
486
330
  {
@@ -495,140 +339,117 @@ Configuration in `.uam.json`:
495
339
  "worktrees": {
496
340
  "enabled": true,
497
341
  "directory": ".worktrees"
498
- },
499
- "template": {
500
- "sections": {
501
- "codeField": true
502
- }
503
342
  }
504
343
  }
505
344
  ```
506
345
 
507
- ## Platform Support
508
-
509
- | Platform | Context File | Works With |
510
- |----------|--------------|------------|
511
- | Claude Code | `CLAUDE.md` | Desktop app |
512
- | Factory.AI | `CLAUDE.md` | Desktop/web |
513
- | claude.ai | `CLAUDE.md` | Web browser |
514
- | VSCode | `CLAUDE.md` | Extensions |
515
-
516
- ## Built-in Expert Droids
517
-
518
- | Droid | Specialization | When Used |
519
- |-------|----------------|-----------|
520
- | `code-quality-guardian` | SOLID, complexity, naming | Before every PR |
521
- | `security-auditor` | OWASP, secrets, injection (enhanced with 150+ security sources) | Before every PR |
522
- | `performance-optimizer` | Algorithms, memory, caching | On request |
523
- | `documentation-expert` | JSDoc, README, accuracy | On request |
524
- | `debug-expert` | Dependency conflicts, runtime errors, SWE-bench debugging | Error handling |
525
- | `sysadmin-expert` | Kernel, QEMU, networking, DNS, systemd | Infrastructure tasks |
526
- | `ml-training-expert` | Model training, MTEB, RL, datasets | ML tasks |
527
- | `terminal-bench-optimizer` | Task routing, time budgets, strategy orchestration | Benchmarking |
528
-
529
- ## Built-in Skills
530
-
531
- | Skill | Purpose | Trigger |
532
- |-------|---------|---------|
533
- | `balls-mode` | Decomposed reasoning with confidence scoring | Complex decisions, debugging |
534
- | `cli-design-expert` | CLI/TUI design patterns, UX, help systems | Building CLI tools |
535
- | `typescript-node-expert` | TypeScript best practices, strict typing | TypeScript projects |
536
- | `terminal-bench-strategies` | Proven strategies for Terminal-Bench tasks | Benchmark tasks |
537
- | `unreal-engine-developer` | UE5, Blueprints, C++, Python scripting | Game development |
538
- | `sec-context-review` | Security context review patterns | Security analysis |
346
+ ---
539
347
 
540
348
  ## Requirements
541
349
 
542
- - Node.js 18+
543
- - Git
544
- - Docker (optional, for semantic search)
350
+ ### Required Dependencies
545
351
 
546
- ## FAQ
352
+ | Dependency | Version | Purpose |
353
+ | ---------- | ----------------- | --------------------------- |
354
+ | Node.js | >= 18.0.0 | Runtime environment |
355
+ | npm | Latest | Package manager |
356
+ | git | Latest | Version control (git hooks) |
357
+ | npx | Included with npm | Run CLI tools |
547
358
 
548
- **Q: Do I need to manage memory manually?**
549
- A: No. The AI queries and stores memory automatically per CLAUDE.md instructions.
359
+ ### Optional Dependencies
550
360
 
551
- **Q: What if I don't have Docker?**
552
- A: UAM works without Docker. You lose semantic search but SQLite memory still works.
361
+ | Dependency | Purpose | Installation |
362
+ | ---------- | -------------------------------- | ---------------------------------------------- |
363
+ | Docker | Local Qdrant for semantic search | [get.docker.com](https://get.docker.com) |
364
+ | Python 3 | Pattern RAG indexing | `brew install python` or `apt install python3` |
365
+ | pre-commit | Advanced git hooks | `pip install pre-commit` |
553
366
 
554
- **Q: Can multiple AI agents work on the same project?**
555
- A: Yes. UAM includes coordination protocols to prevent merge conflicts.
367
+ ### Platform-Specific Setup
556
368
 
557
- **Q: How do I update without losing my customizations?**
558
- A: Run `uam init` or `uam generate`. Updates always merge - nothing is lost.
369
+ **macOS:**
559
370
 
560
- **Q: What's Code Field?**
561
- A: A prompt technique that makes AI state assumptions before coding. Based on [context-field research](https://github.com/NeoVertex1/context-field).
371
+ ```bash
372
+ brew install node@18 git python docker
373
+ ```
374
+
375
+ **Ubuntu/Debian:**
376
+
377
+ ```bash
378
+ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
379
+ sudo apt-get install -y nodejs python3 docker.io
380
+ ```
381
+
382
+ **Windows (PowerShell):**
383
+
384
+ ```powershell
385
+ winget install OpenJS.NodeJS.LTS
386
+ winget install Git.Git
387
+ winget install Python.Python.3.12
388
+ winget install Docker.DockerDesktop
389
+ ```
562
390
 
563
391
  ---
564
392
 
565
- ## Deep Dive Documentation
393
+ ## Testing & Quality
566
394
 
567
- Want to understand how UAM works under the hood?
395
+ ```bash
396
+ # Run tests
397
+ npm test
568
398
 
569
- ### Architecture & Analysis
399
+ # Run linter
400
+ npm run lint
570
401
 
571
- | Document | Description |
572
- |----------|-------------|
573
- | [UAM Complete Analysis](docs/UAM_COMPLETE_ANALYSIS.md) | Full system architecture, all features |
574
- | [Adaptive UAM Design](docs/ADAPTIVE_UAM_DESIGN.md) | Hybrid adaptive context selector design |
575
- | [Multi-Model Architecture](docs/MULTI_MODEL_ARCHITECTURE.md) | Model routing and fingerprints |
576
- | [MCP Router Setup](docs/MCP_ROUTER_SETUP.md) | Hierarchical MCP router for token reduction |
402
+ # Build TypeScript
403
+ npm run build
404
+ ```
577
405
 
578
- ### Benchmarking & Optimization
406
+ ---
579
407
 
580
- | Document | Description |
581
- |----------|-------------|
582
- | [Terminal-Bench Learnings](docs/TERMINAL_BENCH_LEARNINGS.md) | Universal agent patterns discovered |
583
- | [Behavioral Patterns](docs/BEHAVIORAL_PATTERNS.md) | What works vs what doesn't analysis |
584
- | [Failing Tasks Solution Plan](docs/FAILING_TASKS_SOLUTION_PLAN.md) | Detailed fix strategies for each failure mode |
585
- | [Benchmark Results](benchmark-results/) | All Terminal-Bench 2.0 run results |
586
- | [Benchmark Evolution](docs/BENCHMARK_EVOLUTION.md) | How benchmark performance evolved |
587
- | [Domain Strategy Guides](docs/DOMAIN_STRATEGY_GUIDES.md) | Task-specific strategies |
408
+ ## Documentation
588
409
 
589
- ### Optimization Plans
410
+ ### Core CLAUDE.md Sections
590
411
 
591
- | Document | Description |
592
- |----------|-------------|
593
- | [UAM Performance Analysis](docs/UAM_PERFORMANCE_ANALYSIS_2026-01-18.md) | Performance metrics and analysis |
594
- | [Optimization Options](docs/OPTIMIZATION_OPTIONS.md) | Available optimization strategies |
595
- | [V110 Pattern Analysis](docs/UAM_V110_PATTERN_ANALYSIS_2026-01-18.md) | Pattern effectiveness analysis |
412
+ | File | Purpose |
413
+ | ------------------------ | -------------------------------- |
414
+ | `CLAUDE_ARCHITECTURE.md` | Cluster topology, IaC rules |
415
+ | `CLAUDE_CODING.md` | Coding standards, security |
416
+ | `CLAUDE_WORKFLOWS.md` | Task workflows, completion gates |
417
+ | `CLAUDE_MEMORY.md` | Memory system, Pattern RAG |
418
+ | `CLAUDE_DROIDS.md` | Available droids/skills |
419
+
420
+ ### Deep Dive
421
+
422
+ | Document | Description |
423
+ | ---------------------------------------------------------------------- | -------------------------- |
424
+ | [`docs/UAM_COMPLETE_ANALYSIS.md`](docs/UAM_COMPLETE_ANALYSIS.md) | Full system architecture |
425
+ | [`docs/TERMINAL_BENCH_LEARNINGS.md`](docs/TERMINAL_BENCH_LEARNINGS.md) | Universal agent patterns |
426
+ | [`docs/BEHAVIORAL_PATTERNS.md`](docs/BEHAVIORAL_PATTERNS.md) | What works vs what doesn't |
427
+ | [`benchmark-results/`](benchmark-results/) | Terminal-Bench 2.0 results |
596
428
 
597
429
  ---
598
430
 
599
- ## What's Next?
431
+ ## What's Next
600
432
 
601
- UAM v2.7.0 includes 58 optimizations. Recent additions:
433
+ UAM v5.0 includes:
602
434
 
603
435
  - ✅ **58 Optimizations** - Battle-tested from Terminal-Bench 2.0
604
- - ✅ **Pattern Router** - Auto-selects optimal patterns per task with blocking gates
436
+ - ✅ **Pattern Router** - Auto-selects optimal patterns per task
605
437
  - ✅ **Completion Gates** - 3 mandatory checks before "done"
606
438
  - ✅ **8 Expert Droids** - Specialized agents for common tasks
607
439
  - ✅ **6 Skills** - Reusable capabilities (balls-mode, CLI design, etc.)
608
440
  - ✅ **Pre-execution Hooks** - Task-specific setup before agent runs
609
441
  - ✅ **Hierarchical Memory** - Hot/warm/cold tiering with auto-promotion
610
- - ✅ **Adaptive Context** - Selective context loading based on task type
611
- - ✅ **MCP Router** - 98%+ token reduction for multi-tool contexts
612
- - ✅ **Harbor Integration** - Terminal-Bench 2.0 benchmarking agent
442
+ - ✅ **Pattern RAG** - Context-aware pattern injection (~12K tokens saved)
443
+ - ✅ **opencode Integration** - Plugin system for seamless integration
613
444
  - ✅ **Model Router** - Per-model performance fingerprints
614
445
 
615
- Coming soon:
616
-
617
- - **Cross-Project Learning** - Share patterns between codebases
618
- - **Visual Memory Dashboard** - See what your AI knows
619
- - **Continuous Benchmark Tracking** - Auto-run benchmarks on template changes
620
-
621
- **Star the repo** to follow updates. **Open an issue** to request features.
622
-
623
446
  ---
624
447
 
625
448
  ## Attribution
626
449
 
627
450
  Code Field prompts based on research from [NeoVertex1/context-field](https://github.com/NeoVertex1/context-field).
628
451
 
629
- ## License
630
-
631
- MIT
452
+ Terminal-Bench patterns from [Terminal-Bench 2.0](https://github.com/aptx432/terminal-bench) benchmarking.
632
453
 
633
454
  ---
634
455
 
@@ -636,6 +457,6 @@ MIT
636
457
 
637
458
  **[Documentation](docs/UAM_COMPLETE_ANALYSIS.md)** · **[Issues](https://github.com/DammianMiller/universal-agent-memory/issues)** · **[npm](https://www.npmjs.com/package/universal-agent-memory)**
638
459
 
639
- *Built for developers who want AI that learns.*
460
+ _Built for developers who want AI that learns._
640
461
 
641
462
  </div>