Back to list
whiteboardev

memory-summary-retrieve

by whiteboardev

0🍴 0📅 Jan 15, 2026

SKILL.md


name: memory-summary-retrieve description: Retrieve memory summaries by ID, project, or recency. Returns structured JSON with compression metrics. Use to access compressed historical context for LLM prompts. license: Apache-2.0 compatibility: Requires BrAIny API at localhost:3000, Bun runtime metadata: author: brainy version: "1.1" category: memory-management subagent: summarizer allowed-tools: Bash(bun:*)

Memory Summary Retrieval

Retrieves existing memory summaries from BrAIny storage.

Execution Path

┌─────────────────────────────────────────────────────────┐
│                   EXECUTION DECISION                    │
├─────────────────────────────────────────────────────────┤
│                                                         │
│  ┌──────────┐     ┌───────────────────┐                │
│  │  START   │────▶│ SUBAGENT AVAILABLE?│                │
│  └──────────┘     └─────────┬─────────┘                │
│                             │                           │
│              ┌──────────────┴──────────────┐           │
│              ▼                             ▼           │
│       ┌────────────┐                ┌────────────┐     │
│       │    YES     │                │     NO     │     │
│       └─────┬──────┘                └─────┬──────┘     │
│             │                             │            │
│             ▼                             ▼            │
│  ┌─────────────────────┐      ┌─────────────────────┐  │
│  │ Task(summarizer,    │      │ Bash(bun scripts/   │  │
│  │   prompt: "...")    │      │   list-summaries.ts)│  │
│  └─────────────────────┘      └─────────────────────┘  │
│                                                         │
└─────────────────────────────────────────────────────────┘

Path A: Subagent Available (Preferred)

Use the summarizer subagent for lower token cost:

Task(
  subagent_type: "summarizer",
  description: "Retrieve summaries",
  prompt: "List summaries for project 3afb861a-b783-45a6-bba2-4b6d96468aeb limit 5"
)

Path B: Script Fallback

If subagent unavailable, execute scripts directly:

bun .opencode/skills/memory-summary-retrieve/scripts/list-summaries.ts PROJECT_ID [LIMIT]
bun .opencode/skills/memory-summary-retrieve/scripts/get-summary-by-id.ts SUMMARY_ID
bun .opencode/skills/memory-summary-retrieve/scripts/format-summary-context.ts SUMMARY_ID

State Machine

┌─────────────────────────────────────────────────────────────┐
│                  RETRIEVAL WORKFLOW                         │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  ┌──────────┐     ┌─────────────────┐                      │
│  │  START   │────▶│ DETERMINE_MODE  │                      │
│  └──────────┘     └────────┬────────┘                      │
│                            │                                │
│         ┌──────────────────┼──────────────────┐            │
│         ▼                  ▼                  ▼            │
│  ┌────────────┐    ┌────────────┐     ┌────────────┐       │
│  │ BY_ID      │    │ BY_PROJECT │     │ FORMAT     │       │
│  │            │    │            │     │            │       │
│  └─────┬──────┘    └─────┬──────┘     └─────┬──────┘       │
│        │                 │                  │              │
│        ▼                 ▼                  ▼              │
│  ┌────────────┐    ┌────────────┐     ┌────────────┐       │
│  │ FETCH_ONE  │    │ FETCH_LIST │     │ FETCH_ONE  │       │
│  └─────┬──────┘    └─────┬──────┘     └─────┬──────┘       │
│        │                 │                  │              │
│        ▼                 ▼                  ▼              │
│  ┌────────────┐    ┌────────────┐     ┌────────────┐       │
│  │ OUTPUT_JSON│    │OUTPUT_LIST │     │OUTPUT_MD   │       │
│  └─────┬──────┘    └─────┬──────┘     └─────┬──────┘       │
│        │                 │                  │              │
│        └─────────────────┼──────────────────┘              │
│                          ▼                                 │
│                   ┌────────────┐                           │
│                   │    END     │                           │
│                   └────────────┘                           │
│                                                             │
└─────────────────────────────────────────────────────────────┘

States

StateEntry ConditionActionExit Condition
DETERMINE_MODEStartParse argumentsMode selected
BY_IDSUMMARY_ID providedFetch single summaryData retrieved
BY_PROJECTPROJECT_ID providedFetch summary listList retrieved
FORMAT--format flag setFetch and formatContent formatted
OUTPUT_JSONJSON modePrint JSONEnd
OUTPUT_LISTList modePrint tableEnd
OUTPUT_MDFormat modePrint MarkdownEnd

Commands

Get Summary by ID

bun .opencode/skills/memory-summary-retrieve/scripts/get-summary-by-id.ts SUMMARY_ID

Input: SUMMARY_ID (UUID)

Output:

ID: abc-123
Type: coding_session
Compression: 6.25x (5000 → 800 tokens)
Memories: 44
Created: 2026-01-07T10:30:00Z

File: /tmp/summary-abc-123.json

List Project Summaries

bun .opencode/skills/memory-summary-retrieve/scripts/list-summaries.ts PROJECT_ID [LIMIT]

Input:

  • PROJECT_ID: UUID (required)
  • LIMIT: integer (default: 50)

Output:

Found: 3 summaries

1. abc-123
   Type: coding_session
   Compression: 6.25x
   Memories: 44

2. def-456
   Type: conversation
   Compression: 4.50x
   Memories: 30

Format for LLM Context

bun .opencode/skills/memory-summary-retrieve/scripts/format-summary-context.ts SUMMARY_ID

Input: SUMMARY_ID (UUID)

Output (Markdown):

## OBJECTIVE: Implement authentication

## PROGRESS:
- Created AuthService → JWT generation working
- Added middleware → Routes protected

## FILES TOUCHED:
| Path | Operation | Changes |
|------|-----------|---------|
| src/auth/service.ts | created | JWT logic |

## CURRENT STATE: Tests passing

## CRITICAL DETAILS:
- JWT_SECRET required in production
- Token expiry: 24h

Summary Structure

interface Summary {
  id: string;                    // UUID
  summaryType: string;           // coding_session | conversation | custom
  sections: object;              // Type-specific structured data
  content: string | null;        // Formatted text for LLM
  originalMemoryIds: string[];   // Source memory UUIDs
  originalTokenCount: number;    // Pre-compression tokens
  compressedTokenCount: number;  // Post-compression tokens
  compressionRatio: number;      // original / compressed
  model: string;                 // AI model used
  createdAt: string;             // ISO timestamp
}

Section Schemas

coding_session

{
  objective: string;
  progress: string[];
  filesTouched: { path: string; operation: string; changes: string }[];
  currentState: string;
  criticalDetails: string[];
}

conversation

{
  topics: string[];
  decisions: string[];
  actionItems: string[];
  context: string[];
  openQuestions: string[];
}

custom

{
  prompt: string;
  content: string;
  keyPoints: string[];
}

Configuration

VariableDefaultDescription
BRAINY_API_URLhttp://localhost:3000API endpoint
SUMMARY_OUTPUT_FORMATjsonOutput format (json | markdown)

Error Codes

ErrorCauseResolution
"Summary not found"Invalid SUMMARY_IDVerify UUID
"Project not found"Invalid PROJECT_IDVerify UUID
Empty listNo summaries existRun memory-summarize first

Decision Tree

What do you need?
├── Single summary by ID → get-summary-by-id.ts
├── List of project summaries → list-summaries.ts
└── Formatted text for LLM → format-summary-context.ts

Exit Codes

CodeMeaning
0Success
1Error (invalid input, API failure)
2Not found
3No content

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon