universal-agent-memory 0.1.4 → 0.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/dist/analyzers/index.d.ts.map +1 -1
- package/dist/analyzers/index.js +75 -0
- package/dist/analyzers/index.js.map +1 -1
- package/dist/bin/cli.js +207 -0
- package/dist/bin/cli.js.map +1 -1
- package/dist/cli/agent.d.ts +20 -0
- package/dist/cli/agent.d.ts.map +1 -0
- package/dist/cli/agent.js +388 -0
- package/dist/cli/agent.js.map +1 -0
- package/dist/cli/coord.d.ts +7 -0
- package/dist/cli/coord.d.ts.map +1 -0
- package/dist/cli/coord.js +145 -0
- package/dist/cli/coord.js.map +1 -0
- package/dist/cli/deploy.d.ts +19 -0
- package/dist/cli/deploy.d.ts.map +1 -0
- package/dist/cli/deploy.js +267 -0
- package/dist/cli/deploy.js.map +1 -0
- package/dist/cli/task.d.ts +33 -0
- package/dist/cli/task.d.ts.map +1 -0
- package/dist/cli/task.js +570 -0
- package/dist/cli/task.js.map +1 -0
- package/dist/coordination/database.d.ts +13 -0
- package/dist/coordination/database.d.ts.map +1 -0
- package/dist/coordination/database.js +131 -0
- package/dist/coordination/database.js.map +1 -0
- package/dist/coordination/deploy-batcher.d.ts +38 -0
- package/dist/coordination/deploy-batcher.d.ts.map +1 -0
- package/dist/coordination/deploy-batcher.js +401 -0
- package/dist/coordination/deploy-batcher.js.map +1 -0
- package/dist/coordination/index.d.ts +4 -0
- package/dist/coordination/index.d.ts.map +1 -0
- package/dist/coordination/index.js +4 -0
- package/dist/coordination/index.js.map +1 -0
- package/dist/coordination/service.d.ts +79 -0
- package/dist/coordination/service.d.ts.map +1 -0
- package/dist/coordination/service.js +591 -0
- package/dist/coordination/service.js.map +1 -0
- package/dist/generators/claude-md.js +2 -1
- package/dist/generators/claude-md.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/tasks/coordination.d.ts +74 -0
- package/dist/tasks/coordination.d.ts.map +1 -0
- package/dist/tasks/coordination.js +237 -0
- package/dist/tasks/coordination.js.map +1 -0
- package/dist/tasks/database.d.ts +14 -0
- package/dist/tasks/database.d.ts.map +1 -0
- package/dist/tasks/database.js +128 -0
- package/dist/tasks/database.js.map +1 -0
- package/dist/tasks/index.d.ts +5 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +5 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/tasks/service.d.ts +39 -0
- package/dist/tasks/service.d.ts.map +1 -0
- package/dist/tasks/service.js +582 -0
- package/dist/tasks/service.js.map +1 -0
- package/dist/tasks/types.d.ts +224 -0
- package/dist/tasks/types.d.ts.map +1 -0
- package/dist/tasks/types.js +64 -0
- package/dist/tasks/types.js.map +1 -0
- package/dist/types/coordination.d.ts +240 -0
- package/dist/types/coordination.d.ts.map +1 -0
- package/dist/types/coordination.js +43 -0
- package/dist/types/coordination.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/CLAUDE.template.md +335 -48
|
@@ -4,7 +4,50 @@
|
|
|
4
4
|
This template is the master source for generating project-specific CLAUDE.md files.
|
|
5
5
|
It provides autonomous AI agent operation with full memory system, worktrees, and skills.
|
|
6
6
|
|
|
7
|
-
All variables are populated by the generator from project analysis.
|
|
7
|
+
All variables are populated by the UAM generator from project analysis.
|
|
8
|
+
|
|
9
|
+
Template Variables:
|
|
10
|
+
==================
|
|
11
|
+
Core:
|
|
12
|
+
{{PROJECT_NAME}} - Name of the project (from package.json or git)
|
|
13
|
+
{{DEFAULT_BRANCH}} - Main branch name (main/master)
|
|
14
|
+
{{STRUCTURE_DATE}} - Date of last structure update
|
|
15
|
+
|
|
16
|
+
Memory System:
|
|
17
|
+
{{MEMORY_DB_PATH}} - Path to SQLite short-term memory
|
|
18
|
+
{{MEMORY_QUERY_CMD}} - Command to query long-term memory
|
|
19
|
+
{{MEMORY_STORE_CMD}} - Command to store long-term memory
|
|
20
|
+
{{MEMORY_START_CMD}} - Command to start memory services
|
|
21
|
+
{{MEMORY_STATUS_CMD}} - Command to check memory status
|
|
22
|
+
{{MEMORY_STOP_CMD}} - Command to stop memory services
|
|
23
|
+
{{LONG_TERM_BACKEND}} - Backend type (Qdrant/Chroma/etc)
|
|
24
|
+
{{LONG_TERM_ENDPOINT}} - Backend endpoint
|
|
25
|
+
{{LONG_TERM_COLLECTION}} - Collection name
|
|
26
|
+
{{SHORT_TERM_LIMIT}} - Max short-term entries
|
|
27
|
+
|
|
28
|
+
Worktree:
|
|
29
|
+
{{WORKTREE_CREATE_CMD}} - Command to create worktree
|
|
30
|
+
{{WORKTREE_PR_CMD}} - Command to create PR
|
|
31
|
+
{{WORKTREE_CLEANUP_CMD}} - Command to cleanup worktree
|
|
32
|
+
{{WORKTREE_DIR}} - Worktree directory path
|
|
33
|
+
{{WORKTREE_APPLIES_TO}} - What worktrees apply to
|
|
34
|
+
{{BRANCH_PREFIX}} - Branch prefix (feature/)
|
|
35
|
+
|
|
36
|
+
Paths:
|
|
37
|
+
{{SKILLS_PATH}} - Path to skills directory
|
|
38
|
+
{{DROIDS_PATH}} - Path to droids directory
|
|
39
|
+
{{COMMANDS_PATH}} - Path to commands directory
|
|
40
|
+
{{DOCS_PATH}} - Path to documentation
|
|
41
|
+
{{SCREENSHOTS_PATH}} - Path for browser screenshots
|
|
42
|
+
{{DOCKER_COMPOSE_PATH}} - Path to docker-compose.yml
|
|
43
|
+
|
|
44
|
+
Commands:
|
|
45
|
+
{{TEST_COMMAND}} - Command to run tests
|
|
46
|
+
{{HOOKS_INSTALL_CMD}} - Command to install git hooks
|
|
47
|
+
|
|
48
|
+
Optional Sections (Handlebars conditionals):
|
|
49
|
+
{{#if SECTION}}...{{/if}}
|
|
50
|
+
{{{MULTILINE_CONTENT}}} - Triple braces for multiline
|
|
8
51
|
-->
|
|
9
52
|
|
|
10
53
|
<coding_guidelines>
|
|
@@ -19,7 +62,7 @@ You are Autonomous Claude, a self-directed AI agent with full control over this
|
|
|
19
62
|
|
|
20
63
|
---
|
|
21
64
|
|
|
22
|
-
##
|
|
65
|
+
## CRITICAL: READ THIS FIRST - EVERY SINGLE TIME
|
|
23
66
|
|
|
24
67
|
**YOU MUST FOLLOW THE DECISION LOOP BELOW FOR EVERY ACTION. NO EXCEPTIONS.**
|
|
25
68
|
|
|
@@ -73,7 +116,7 @@ You are Autonomous Claude, a self-directed AI agent with full control over this
|
|
|
73
116
|
|
|
74
117
|
---
|
|
75
118
|
|
|
76
|
-
##
|
|
119
|
+
## MANDATORY RULES - ZERO TOLERANCE
|
|
77
120
|
|
|
78
121
|
**FAILURE TO FOLLOW THESE RULES IS A CRITICAL ERROR. STOP AND RE-READ IF UNSURE.**
|
|
79
122
|
|
|
@@ -134,14 +177,14 @@ sqlite3 {{MEMORY_DB_PATH}} \
|
|
|
134
177
|
|
|
135
178
|
**Before starting ANY implementation, check if a skill applies:**
|
|
136
179
|
|
|
137
|
-
| Task Type
|
|
138
|
-
|
|
|
180
|
+
| Task Type | Required Skill |
|
|
181
|
+
| --------- | -------------- |
|
|
139
182
|
{{#if SKILL_MAPPINGS}}
|
|
140
183
|
{{{SKILL_MAPPINGS}}}
|
|
141
184
|
{{/if}}
|
|
142
|
-
| React/TypeScript/Frontend
|
|
143
|
-
| Code review
|
|
144
|
-
| Web testing
|
|
185
|
+
| React/TypeScript/Frontend | `senior-frontend` |
|
|
186
|
+
| Code review | `code-reviewer` |
|
|
187
|
+
| Web testing | `webapp-testing` |
|
|
145
188
|
|
|
146
189
|
```bash
|
|
147
190
|
# Invoke skill FIRST, then follow its guidance
|
|
@@ -175,79 +218,325 @@ Before sending ANY response, verify:
|
|
|
175
218
|
|
|
176
219
|
---
|
|
177
220
|
|
|
178
|
-
## MEMORY SYSTEM
|
|
221
|
+
## MEMORY SYSTEM (4-Layer Architecture)
|
|
222
|
+
|
|
223
|
+
> **Architecture Note**: This system is based on research into MemGPT, Mem0, A-MEM, LangGraph, and
|
|
224
|
+
> industry best practices for agentic memory systems.
|
|
225
|
+
|
|
226
|
+
### Architecture Overview
|
|
227
|
+
|
|
228
|
+
```
|
|
229
|
+
┌─────────────────────────────────────────────────────────────────────┐
|
|
230
|
+
│ FOUR-LAYER MEMORY ARCHITECTURE │
|
|
231
|
+
├─────────────────────────────────────────────────────────────────────┤
|
|
232
|
+
│ │
|
|
233
|
+
│ LAYER 1: WORKING MEMORY (SQLite) ~0.15ms access │
|
|
234
|
+
│ ├─ {{SHORT_TERM_LIMIT}} entries max, FIFO eviction │
|
|
235
|
+
│ ├─ Types: action, observation, thought, goal │
|
|
236
|
+
│ └─ Immediate context for current task │
|
|
237
|
+
│ │
|
|
238
|
+
│ LAYER 2: SESSION MEMORY (SQLite) ~0.2ms access │
|
|
239
|
+
│ ├─ Session-scoped summaries and decisions │
|
|
240
|
+
│ ├─ Entities mentioned with context │
|
|
241
|
+
│ └─ Cleaned on session end (optional persistence) │
|
|
242
|
+
│ │
|
|
243
|
+
│ LAYER 3: SEMANTIC MEMORY ({{LONG_TERM_BACKEND}}) ~1-2ms search │
|
|
244
|
+
│ ├─ Vector embeddings (384-dim all-MiniLM-L6-v2) │
|
|
245
|
+
│ ├─ Importance scoring with time-based decay │
|
|
246
|
+
│ └─ Deduplication via content hash + similarity │
|
|
247
|
+
│ │
|
|
248
|
+
│ LAYER 4: KNOWLEDGE GRAPH (SQLite) ~0.17ms query │
|
|
249
|
+
│ ├─ Entities: files, functions, concepts, errors, configs │
|
|
250
|
+
│ ├─ Relationships: depends_on, fixes, causes, related_to │
|
|
251
|
+
│ └─ Multi-hop traversal for complex reasoning │
|
|
252
|
+
│ │
|
|
253
|
+
└─────────────────────────────────────────────────────────────────────┘
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### Installation & Setup
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
# 1. Install UAM globally or in project
|
|
260
|
+
npm install -g universal-agent-memory
|
|
261
|
+
# or
|
|
262
|
+
npm install --save-dev universal-agent-memory
|
|
263
|
+
|
|
264
|
+
# 2. Initialize in your project
|
|
265
|
+
uam init
|
|
179
266
|
|
|
180
|
-
|
|
267
|
+
# 3. Start memory services (Qdrant for vector search)
|
|
268
|
+
{{MEMORY_START_CMD}}
|
|
269
|
+
|
|
270
|
+
# 4. Generate CLAUDE.md with memory integration
|
|
271
|
+
uam generate
|
|
272
|
+
|
|
273
|
+
# 5. Verify setup
|
|
274
|
+
{{MEMORY_STATUS_CMD}}
|
|
275
|
+
```
|
|
181
276
|
|
|
182
|
-
|
|
277
|
+
### Layer 1: Working Memory (SQLite)
|
|
183
278
|
|
|
184
|
-
|
|
185
|
-
- `timestamp`: TEXT (ISO8601)
|
|
186
|
-
- `type`: TEXT (action|observation|thought|goal)
|
|
187
|
-
- `content`: TEXT
|
|
279
|
+
**Location**: `{{MEMORY_DB_PATH}}`
|
|
188
280
|
|
|
189
|
-
**
|
|
281
|
+
**Table: `memories`**
|
|
282
|
+
|
|
283
|
+
| Column | Type | Description |
|
|
284
|
+
|--------|------|-------------|
|
|
285
|
+
| `id` | INTEGER | Primary key, auto-increment |
|
|
286
|
+
| `timestamp` | TEXT | ISO8601 timestamp |
|
|
287
|
+
| `type` | TEXT | action, observation, thought, goal |
|
|
288
|
+
| `content` | TEXT | Memory content |
|
|
289
|
+
|
|
290
|
+
**BEFORE EACH DECISION**: Query recent entries
|
|
190
291
|
|
|
191
292
|
```sql
|
|
192
293
|
SELECT * FROM memories ORDER BY id DESC LIMIT {{SHORT_TERM_LIMIT}};
|
|
193
294
|
```
|
|
194
295
|
|
|
195
|
-
**AFTER EACH ACTION**:
|
|
296
|
+
**AFTER EACH ACTION**: Record what you did
|
|
196
297
|
|
|
197
298
|
```sql
|
|
198
|
-
INSERT INTO memories (timestamp, type, content)
|
|
299
|
+
INSERT INTO memories (timestamp, type, content)
|
|
300
|
+
VALUES (datetime('now'), 'action', 'Description of action and result');
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
**Or use the CLI:**
|
|
304
|
+
|
|
305
|
+
```bash
|
|
306
|
+
uam memory add --type action "Implemented user authentication with JWT"
|
|
199
307
|
```
|
|
200
308
|
|
|
201
309
|
Maintains last {{SHORT_TERM_LIMIT}} entries - older entries auto-deleted via trigger.
|
|
202
310
|
|
|
203
|
-
###
|
|
311
|
+
### Layer 2: Session Memory (SQLite)
|
|
312
|
+
|
|
313
|
+
**Table: `session_memories`** (in same database as working memory)
|
|
204
314
|
|
|
205
|
-
|
|
315
|
+
| Column | Type | Description |
|
|
316
|
+
|--------|------|-------------|
|
|
317
|
+
| `id` | INTEGER | Primary key |
|
|
318
|
+
| `session_id` | TEXT | Current session identifier |
|
|
319
|
+
| `timestamp` | TEXT | ISO8601 timestamp |
|
|
320
|
+
| `type` | TEXT | summary, decision, entity, error |
|
|
321
|
+
| `content` | TEXT | Memory content |
|
|
322
|
+
| `importance` | INTEGER | 1-10 importance score |
|
|
206
323
|
|
|
207
|
-
|
|
324
|
+
**Query session context:**
|
|
208
325
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
326
|
+
```sql
|
|
327
|
+
SELECT * FROM session_memories
|
|
328
|
+
WHERE session_id = 'current_session'
|
|
329
|
+
ORDER BY id DESC LIMIT 10;
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
**Store session decision:**
|
|
333
|
+
|
|
334
|
+
```sql
|
|
335
|
+
INSERT INTO session_memories (session_id, timestamp, type, content, importance)
|
|
336
|
+
VALUES ('current_session', datetime('now'), 'decision', 'Chose approach X because...', 7);
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
**Types**: summary, decision, entity, error
|
|
340
|
+
|
|
341
|
+
### Layer 3: Semantic Memory ({{LONG_TERM_BACKEND}})
|
|
342
|
+
|
|
343
|
+
**Collection**: `{{LONG_TERM_COLLECTION}}` at `{{LONG_TERM_ENDPOINT}}`
|
|
344
|
+
|
|
345
|
+
**Vector Schema**:
|
|
346
|
+
|
|
347
|
+
| Field | Type | Description |
|
|
348
|
+
|-------|------|-------------|
|
|
349
|
+
| `id` | UUID | Unique identifier |
|
|
350
|
+
| `vector` | float[384] | Embedding (all-MiniLM-L6-v2) |
|
|
351
|
+
| `content` | string | Original memory text |
|
|
352
|
+
| `type` | string | lesson, bug-fix, architecture, gotcha |
|
|
353
|
+
| `tags` | string[] | Categorization tags |
|
|
354
|
+
| `importance` | int | 1-10 importance score |
|
|
355
|
+
| `timestamp` | string | ISO8601 creation time |
|
|
356
|
+
| `decay_score` | float | Time-based decay factor |
|
|
357
|
+
| `content_hash` | string | MD5 hash for deduplication |
|
|
212
358
|
|
|
213
359
|
**Query memories** (semantic search):
|
|
214
360
|
|
|
215
361
|
```bash
|
|
216
362
|
{{MEMORY_QUERY_CMD}} "<search terms>"
|
|
363
|
+
|
|
364
|
+
# Examples:
|
|
365
|
+
{{MEMORY_QUERY_CMD}} "authentication JWT token"
|
|
366
|
+
{{MEMORY_QUERY_CMD}} "database connection pooling"
|
|
367
|
+
{{MEMORY_QUERY_CMD}} "React state management"
|
|
217
368
|
```
|
|
218
369
|
|
|
219
|
-
**Store new memory
|
|
370
|
+
**Store new memory** (importance 7+ recommended):
|
|
220
371
|
|
|
221
372
|
```bash
|
|
222
373
|
{{MEMORY_STORE_CMD}} lesson "What you learned" --tags tag1,tag2 --importance 8
|
|
374
|
+
|
|
375
|
+
# Examples:
|
|
376
|
+
{{MEMORY_STORE_CMD}} lesson "Always check network policies before deploying" --tags kubernetes,networking --importance 8
|
|
377
|
+
{{MEMORY_STORE_CMD}} bug-fix "Connection timeout was caused by missing egress rule" --tags networking,debugging --importance 9
|
|
378
|
+
{{MEMORY_STORE_CMD}} architecture "Chose Redis for caching due to sub-ms latency requirements" --tags caching,performance --importance 7
|
|
223
379
|
```
|
|
224
380
|
|
|
225
|
-
**
|
|
226
|
-
|
|
381
|
+
**Decay Formula**: `effective_importance = importance * (0.95 ^ days_since_access)`
|
|
382
|
+
|
|
383
|
+
**WHEN TO STORE IN SEMANTIC MEMORY** (importance 7+):
|
|
227
384
|
|
|
228
|
-
-
|
|
229
|
-
-
|
|
230
|
-
-
|
|
231
|
-
-
|
|
232
|
-
-
|
|
385
|
+
- ✅ Bug fixes with root cause + solution
|
|
386
|
+
- ✅ Architecture decisions with rationale
|
|
387
|
+
- ✅ Performance optimizations that worked
|
|
388
|
+
- ✅ Gotchas and workarounds discovered
|
|
389
|
+
- ✅ API behaviors that aren't obvious
|
|
390
|
+
- ❌ Routine actions (keep in working memory)
|
|
391
|
+
- ❌ Temporary context (keep in session memory)
|
|
392
|
+
|
|
393
|
+
**Deduplication Strategy**:
|
|
394
|
+
|
|
395
|
+
1. Compute content hash (MD5 first 16 chars)
|
|
396
|
+
2. If hash exists, skip (fast path)
|
|
397
|
+
3. If unsure, check semantic similarity (threshold 0.92)
|
|
398
|
+
4. Only add if truly new information
|
|
399
|
+
|
|
400
|
+
### Layer 4: Knowledge Graph (SQLite)
|
|
401
|
+
|
|
402
|
+
**Tables**: `entities` and `relationships` (in same database)
|
|
403
|
+
|
|
404
|
+
**Entities Table:**
|
|
405
|
+
|
|
406
|
+
| Column | Type | Description |
|
|
407
|
+
|--------|------|-------------|
|
|
408
|
+
| `id` | INTEGER | Primary key |
|
|
409
|
+
| `type` | TEXT | file, function, concept, error, config, service |
|
|
410
|
+
| `name` | TEXT | Entity name/identifier |
|
|
411
|
+
| `first_seen` | TEXT | First mention timestamp |
|
|
412
|
+
| `last_seen` | TEXT | Last mention timestamp |
|
|
413
|
+
| `mention_count` | INTEGER | How often referenced |
|
|
414
|
+
|
|
415
|
+
**Relationships Table:**
|
|
416
|
+
|
|
417
|
+
| Column | Type | Description |
|
|
418
|
+
|--------|------|-------------|
|
|
419
|
+
| `id` | INTEGER | Primary key |
|
|
420
|
+
| `source_id` | INTEGER | Source entity ID |
|
|
421
|
+
| `target_id` | INTEGER | Target entity ID |
|
|
422
|
+
| `relation` | TEXT | depends_on, fixes, causes, related_to, contains, implements |
|
|
423
|
+
| `timestamp` | TEXT | When relationship was established |
|
|
424
|
+
|
|
425
|
+
**Query related entities (1-hop):**
|
|
426
|
+
|
|
427
|
+
```sql
|
|
428
|
+
SELECT e.*, r.relation, e2.name as related
|
|
429
|
+
FROM entities e
|
|
430
|
+
LEFT JOIN relationships r ON e.id = r.source_id
|
|
431
|
+
LEFT JOIN entities e2 ON r.target_id = e2.id
|
|
432
|
+
WHERE e.name LIKE '%api%';
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
**Add entity:**
|
|
436
|
+
|
|
437
|
+
```sql
|
|
438
|
+
INSERT OR REPLACE INTO entities (type, name, first_seen, last_seen, mention_count)
|
|
439
|
+
VALUES ('file', 'auth-controller.ts', datetime('now'), datetime('now'), 1);
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
**Add relationship:**
|
|
443
|
+
|
|
444
|
+
```sql
|
|
445
|
+
INSERT INTO relationships (source_id, target_id, relation, timestamp)
|
|
446
|
+
VALUES (1, 2, 'depends_on', datetime('now'));
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
**Or use the CLI:**
|
|
450
|
+
|
|
451
|
+
```bash
|
|
452
|
+
uam memory entity add --type file --name "auth-controller.ts"
|
|
453
|
+
uam memory relation add --source "auth-controller.ts" --target "jwt-utils.ts" --relation depends_on
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
### Memory Operations Workflow
|
|
457
|
+
|
|
458
|
+
```
|
|
459
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
460
|
+
│ MEMORY OPERATION FLOW │
|
|
461
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
462
|
+
│ │
|
|
463
|
+
│ ON TASK START: │
|
|
464
|
+
│ 1. Query working memory (last 20 entries) │
|
|
465
|
+
│ 2. Query semantic memory for relevant context │
|
|
466
|
+
│ 3. Check knowledge graph for related entities │
|
|
467
|
+
│ │
|
|
468
|
+
│ DURING TASK: │
|
|
469
|
+
│ 4. Update working memory after each action │
|
|
470
|
+
│ 5. Store key decisions in session memory │
|
|
471
|
+
│ │
|
|
472
|
+
│ ON SIGNIFICANT LEARNING: │
|
|
473
|
+
│ 6. Store in semantic memory (importance 7+) │
|
|
474
|
+
│ 7. Update knowledge graph entities/relationships │
|
|
475
|
+
│ │
|
|
476
|
+
│ ON CONSOLIDATION TRIGGER (every 10 working memory entries): │
|
|
477
|
+
│ 8. Summarize working memory → session memory │
|
|
478
|
+
│ 9. Extract high-importance items → semantic memory │
|
|
479
|
+
│ 10. Deduplicate using content hash (fast) + similarity (slow) │
|
|
480
|
+
│ │
|
|
481
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
482
|
+
```
|
|
233
483
|
|
|
234
484
|
### Agent Services Setup
|
|
235
485
|
|
|
236
486
|
```bash
|
|
237
|
-
# Start Qdrant
|
|
487
|
+
# Start all memory services (Qdrant for vectors, auto-creates collections)
|
|
238
488
|
{{MEMORY_START_CMD}}
|
|
239
489
|
|
|
240
|
-
# Check status
|
|
490
|
+
# Check service status
|
|
241
491
|
{{MEMORY_STATUS_CMD}}
|
|
242
492
|
|
|
243
493
|
# Stop services
|
|
244
494
|
{{MEMORY_STOP_CMD}}
|
|
495
|
+
|
|
496
|
+
# Upgrade SQLite schema (adds session memory + knowledge graph tables)
|
|
497
|
+
uam memory migrate
|
|
498
|
+
|
|
499
|
+
# Backup all memories
|
|
500
|
+
uam memory backup
|
|
501
|
+
|
|
502
|
+
# Export memories to JSON
|
|
503
|
+
uam memory export --format json memories-backup.json
|
|
245
504
|
```
|
|
246
505
|
|
|
247
506
|
{{#if DOCKER_COMPOSE_PATH}}
|
|
248
507
|
**Docker Compose**: `{{DOCKER_COMPOSE_PATH}}` defines Qdrant with persistent storage.
|
|
508
|
+
|
|
509
|
+
```yaml
|
|
510
|
+
# Example docker-compose.yml for memory services
|
|
511
|
+
services:
|
|
512
|
+
qdrant:
|
|
513
|
+
image: qdrant/qdrant:latest
|
|
514
|
+
ports:
|
|
515
|
+
- "6333:6333"
|
|
516
|
+
volumes:
|
|
517
|
+
- ./data/qdrant:/qdrant/storage
|
|
518
|
+
```
|
|
249
519
|
{{/if}}
|
|
250
520
|
|
|
521
|
+
### Performance Benchmarks
|
|
522
|
+
|
|
523
|
+
| Operation | Latency | Throughput |
|
|
524
|
+
|-----------|---------|------------|
|
|
525
|
+
| SQLite INSERT | ~1.1ms | 875 ops/sec |
|
|
526
|
+
| SQLite SELECT (50 rows) | ~0.15ms | 6,680 ops/sec |
|
|
527
|
+
| SQLite Graph Query (1-hop) | ~0.17ms | 6,035 ops/sec |
|
|
528
|
+
| Qdrant Search (top-5) | ~1.2ms | 818 ops/sec |
|
|
529
|
+
| Embedding Generation | ~3.3ms | 305 ops/sec |
|
|
530
|
+
|
|
531
|
+
### Importance Scale Reference
|
|
532
|
+
|
|
533
|
+
| Score | Category | Examples |
|
|
534
|
+
|-------|----------|----------|
|
|
535
|
+
| 9-10 | Critical system knowledge | Auth flows, data models, breaking changes |
|
|
536
|
+
| 7-8 | Important patterns and fixes | Bug fixes, performance optimizations |
|
|
537
|
+
| 5-6 | Useful context and learnings | Code patterns, tool configurations |
|
|
538
|
+
| 3-4 | Minor observations | Style preferences, minor quirks |
|
|
539
|
+
|
|
251
540
|
---
|
|
252
541
|
|
|
253
542
|
## BROWSER USAGE
|
|
@@ -291,7 +580,7 @@ Available skills are auto-discovered. When you see a SKILL.md, follow its instru
|
|
|
291
580
|
|
|
292
581
|
---
|
|
293
582
|
|
|
294
|
-
|
|
583
|
+
## MANDATORY WORKFLOW REQUIREMENTS
|
|
295
584
|
|
|
296
585
|
1. **Git Worktrees**: ALL code changes MUST use isolated git worktrees (`{{BRANCH_PREFIX}}NNN-slug` branches)
|
|
297
586
|
2. **PR-Based Merges**: NO direct commits to `{{DEFAULT_BRANCH}}`. All changes via PR with automated review
|
|
@@ -308,7 +597,7 @@ See [Git Worktree Workflow]({{WORKFLOW_DOCS_PATH}}) for complete details.
|
|
|
308
597
|
|
|
309
598
|
```
|
|
310
599
|
{{PROJECT_NAME}}/
|
|
311
|
-
{{{
|
|
600
|
+
{{{REPOSITORY_STRUCTURE}}}
|
|
312
601
|
```
|
|
313
602
|
|
|
314
603
|
---
|
|
@@ -346,9 +635,7 @@ See [Git Worktree Workflow]({{WORKFLOW_DOCS_PATH}}) for complete details.
|
|
|
346
635
|
# Create PR with automated review
|
|
347
636
|
{{WORKTREE_PR_CMD}} <id>
|
|
348
637
|
|
|
349
|
-
{{#if ESSENTIAL_COMMANDS}}
|
|
350
638
|
{{{ESSENTIAL_COMMANDS}}}
|
|
351
|
-
{{/if}}
|
|
352
639
|
```
|
|
353
640
|
|
|
354
641
|
---
|
|
@@ -512,7 +799,7 @@ See [Git Worktree Workflow]({{WORKFLOW_DOCS_PATH}}) for complete details.
|
|
|
512
799
|
|
|
513
800
|
## Augmented Agent Capabilities
|
|
514
801
|
|
|
515
|
-
###
|
|
802
|
+
### Proactive Skills & Droids - INVOKE AUTOMATICALLY
|
|
516
803
|
|
|
517
804
|
**These must be invoked WITHOUT being asked - they ensure quality, security, and performance:**
|
|
518
805
|
|
|
@@ -556,7 +843,7 @@ Invoke with `Skill` tool. Skills expand inline with detailed instructions.
|
|
|
556
843
|
|
|
557
844
|
Launch via `Task` tool with `subagent_type`. Droids run autonomously.
|
|
558
845
|
|
|
559
|
-
|
|
846
|
+
**Proactive Quality Droids (Run before EVERY commit/PR):**
|
|
560
847
|
| Droid | Focus | When to Invoke |
|
|
561
848
|
|-------|-------|----------------|
|
|
562
849
|
| `code-quality-guardian` | Complexity, naming, SOLID, code smells | **PROACTIVE** - All code changes |
|
|
@@ -594,14 +881,14 @@ Launch via `Task` tool with `subagent_type`. Droids run autonomously.
|
|
|
594
881
|
|
|
595
882
|
High-level orchestration workflows:
|
|
596
883
|
|
|
597
|
-
| Command
|
|
598
|
-
|
|
|
599
|
-
| `/worktree`
|
|
600
|
-
| `/code-review`
|
|
601
|
-
| `/pr-ready`
|
|
602
|
-
| `/release-notes` | Generate structured release notes from changes
|
|
603
|
-
| `/test-plan`
|
|
604
|
-
| `/todo-scan`
|
|
884
|
+
| Command | Purpose |
|
|
885
|
+
| ------- | ------- |
|
|
886
|
+
| `/worktree` | Manage git worktrees (create, list, pr, cleanup) - **USE FOR ALL CHANGES** |
|
|
887
|
+
| `/code-review` | Full code review (git-summarizer → quality/security/perf/test/docs reviewers) |
|
|
888
|
+
| `/pr-ready` | Validate branch, auto-create PR, trigger reviewer agents |
|
|
889
|
+
| `/release-notes` | Generate structured release notes from changes |
|
|
890
|
+
| `/test-plan` | Produce test plans for code changes |
|
|
891
|
+
| `/todo-scan` | Scan for TODO/FIXME markers |
|
|
605
892
|
|
|
606
893
|
{{#if MCP_PLUGINS}}
|
|
607
894
|
### MCP Plugins (`.mcp.json`)
|