mirror of
https://github.com/sdwolf4103/opencode-working-memory.git
synced 2026-07-17 12:56:42 +02:00
docs: prepare v1.3.0 release notes
This commit is contained in:
+27
-18
@@ -2,7 +2,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
The Working Memory Plugin implements a **three-layer memory architecture** designed to preserve context across OpenCode session compactions.
|
||||
OpenCode Working Memory implements a **three-layer memory architecture** designed to preserve context across OpenCode session compactions.
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────────────┐
|
||||
@@ -73,7 +73,7 @@ Long-term memory that persists across sessions within the same workspace. Perfec
|
||||
|
||||
### Memory Extraction
|
||||
|
||||
During compaction, the plugin scans for `Memory candidates:` sections:
|
||||
During compaction, OpenCode Working Memory scans for `Memory candidates:` sections:
|
||||
|
||||
```
|
||||
Memory candidates:
|
||||
@@ -81,32 +81,39 @@ Memory candidates:
|
||||
- [project] This repo uses TypeScript with strict mode
|
||||
```
|
||||
|
||||
**Legacy Format**: The plugin also accepts `<workspace_memory_candidates>` XML blocks for backward compatibility, but this format is deprecated.
|
||||
**Legacy Format**: OpenCode Working Memory also accepts `<workspace_memory_candidates>` XML blocks for backward compatibility, but this format is deprecated.
|
||||
|
||||
**Quality Gate**: Not all candidates become memories. The plugin rejects:
|
||||
**Quality Gate**: Not all candidates become memories. OpenCode Working Memory rejects:
|
||||
- Git commit hashes (e.g., `abc1234`)
|
||||
- Raw errors (e.g., `Error: something failed`)
|
||||
- Stack traces
|
||||
- Path-heavy facts (>50% paths)
|
||||
- Very short text (<20 chars)
|
||||
|
||||
### Deduplication
|
||||
### Consolidation and Deduplication
|
||||
|
||||
Memories are deduplicated using **canonical text matching**:
|
||||
1. Normalize: lowercase, strip punctuation, collapse whitespace
|
||||
2. Hash the canonical text
|
||||
3. Keep the entry with highest confidence
|
||||
Memories are deduplicated and consolidated with accounting:
|
||||
|
||||
1. Normalize exact text: lowercase, strip punctuation, collapse whitespace.
|
||||
2. Group project/reference entries by identity where possible.
|
||||
3. Group decisions and feedback by topic where possible.
|
||||
4. Keep the best surviving entry by source, confidence, type, and freshness rules.
|
||||
5. Emit accounting events so pending memories can be classified as promoted, absorbed, superseded, or rejected.
|
||||
|
||||
This prevents absorbed or superseded pending memories from retrying forever while still preserving the active surviving memory.
|
||||
|
||||
### System Prompt Injection
|
||||
|
||||
Workspace memory is injected at the top of every message:
|
||||
|
||||
```
|
||||
<workspace_memory>
|
||||
- [decision] Use npm cache for plugin loading, not npm link
|
||||
- [project] This repo uses opencode-agenthub plugin system
|
||||
- [reference] Storage: ~/.local/share/opencode-working-memory/...
|
||||
</workspace_memory>
|
||||
Workspace memory (cross-session, verify if stale):
|
||||
decision:
|
||||
- Use npm cache for plugin loading, not npm link
|
||||
project:
|
||||
- This repo uses the opencode-agenthub plugin system
|
||||
reference:
|
||||
- Storage: ~/.local/share/opencode-working-memory/...
|
||||
```
|
||||
|
||||
## Layer 2: Hot Session State
|
||||
@@ -211,7 +218,7 @@ Delegate task tracking to OpenCode's native features.
|
||||
|
||||
## Plugin Hooks
|
||||
|
||||
The plugin hooks into OpenCode lifecycle events:
|
||||
OpenCode Working Memory hooks into OpenCode lifecycle events:
|
||||
|
||||
### `experimental.chat.system.transform`
|
||||
|
||||
@@ -227,13 +234,15 @@ Injects workspace memory and hot session state into system prompt.
|
||||
### `experimental.session.compacting`
|
||||
|
||||
Extracts workspace memory candidates from conversation.
|
||||
Applies quality gate, deduplication, and source priority.
|
||||
Applies quality gate, redaction, migration, consolidation accounting, deduplication, and source priority.
|
||||
|
||||
### `event` (session.compacted, session.deleted)
|
||||
|
||||
- `session.compacted`: Promote session decisions to workspace memory
|
||||
- `session.deleted`: Clean up session state files
|
||||
|
||||
Promotion uses accounting results from workspace memory normalization. Pending memories that are kept are promoted; duplicate memories are absorbed; obsolete same-topic memories are superseded; stale or over-capacity compaction memories are rejected.
|
||||
|
||||
## Quality Guarantees
|
||||
|
||||
### No False Positive Errors
|
||||
@@ -349,9 +358,9 @@ Modify `src/extractors.ts` to add new extraction patterns.
|
||||
|
||||
### Memory V1 to V2
|
||||
|
||||
The plugin automatically migrates old format files to the new three-layer architecture. No manual intervention needed.
|
||||
OpenCode Working Memory automatically migrates old format files to the new three-layer architecture. No manual intervention needed.
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: April 2026
|
||||
**Implementation**: `src/plugin.ts`, `src/extractors.ts`, `src/workspace-memory.ts`, `src/session-state.ts`
|
||||
**Implementation**: `src/plugin.ts`, `src/extractors.ts`, `src/workspace-memory.ts`, `src/session-state.ts`
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
The Working Memory Plugin works out-of-the-box with sensible defaults. Configuration is defined in `src/types.ts` as constants.
|
||||
OpenCode Working Memory works out-of-the-box with sensible defaults. Configuration is defined in `src/types.ts` as constants.
|
||||
|
||||
## Workspace Memory Limits
|
||||
|
||||
@@ -192,21 +192,21 @@ rm ~/.local/share/opencode-working-memory/workspaces/*/sessions/*.json
|
||||
## Best Practices
|
||||
|
||||
1. **Workspace Memory Hygiene**:
|
||||
- Let the plugin extract memories automatically
|
||||
- Let OpenCode Working Memory extract memories automatically
|
||||
- Use explicit "remember this" for important information
|
||||
- Don't manually edit memory files unless testing
|
||||
|
||||
2. **Session State**:
|
||||
- Let the plugin track active files automatically
|
||||
- Let OpenCode Working Memory track active files automatically
|
||||
- Errors are cleared when commands succeed
|
||||
- No manual intervention needed
|
||||
|
||||
3. **Memory Extraction**:
|
||||
- Use `<workspace_memory_candidates>` during compaction
|
||||
- Use `Memory candidates:` during compaction
|
||||
- Follow the pattern: `- [type] text`
|
||||
- Quality gate rejects invalid candidates
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: April 2026
|
||||
**Configuration File**: `src/types.ts`
|
||||
**Configuration File**: `src/types.ts`
|
||||
|
||||
+13
-13
@@ -10,7 +10,7 @@ Add to your `~/.config/opencode/opencode.json`:
|
||||
}
|
||||
```
|
||||
|
||||
Restart OpenCode. The plugin activates automatically — no manual setup needed.
|
||||
Restart OpenCode. OpenCode Working Memory activates automatically — no manual setup needed.
|
||||
|
||||
> **Note**: The correct key is `plugin` (singular), not `plugins`.
|
||||
|
||||
@@ -25,22 +25,22 @@ Restart OpenCode. The plugin activates automatically — no manual setup needed.
|
||||
After restarting OpenCode, memory context appears automatically in system prompts. You'll see:
|
||||
|
||||
```
|
||||
<workspace_memory>
|
||||
- [decision] ... (if any long-term memories exist)
|
||||
</workspace_memory>
|
||||
Workspace memory (cross-session, verify if stale):
|
||||
decision:
|
||||
- ... (if any long-term memories exist)
|
||||
|
||||
---
|
||||
<workspace_memory_candidates>
|
||||
Memory candidates:
|
||||
- [project] ... (candidates for long-term memory)
|
||||
</workspace_memory_candidates>
|
||||
|
||||
Active Files:
|
||||
Hot session state (current session):
|
||||
active_files:
|
||||
- path/to/file.ts (action, count)
|
||||
|
||||
Open Errors: (none, or listed)
|
||||
open_errors: (none, or listed)
|
||||
```
|
||||
|
||||
**No tools to call**. The plugin works automatically via hooks.
|
||||
**No tools to call**. OpenCode Working Memory works automatically via hooks.
|
||||
|
||||
## How Memory Works
|
||||
|
||||
@@ -72,8 +72,8 @@ Tracks current session:
|
||||
|
||||
**Solution**:
|
||||
1. Ensure OpenCode has write permissions in home directory
|
||||
2. Trigger memory operations by working normally (plugin creates files on-demand)
|
||||
3. Check that plugin is listed in config
|
||||
2. Trigger memory operations by working normally (memory files are created on-demand)
|
||||
3. Check that `opencode-working-memory` is listed in config
|
||||
|
||||
### Memory Not Persisting
|
||||
|
||||
@@ -81,7 +81,7 @@ Tracks current session:
|
||||
|
||||
**Solution**:
|
||||
1. Verify you're in the same workspace (different workspace = different memory)
|
||||
2. Ensure `<workspace_memory_candidates>` were captured during compaction
|
||||
2. Ensure `Memory candidates:` were captured during compaction
|
||||
3. Check `workspace-memory.json` exists
|
||||
|
||||
### Type Errors During Development
|
||||
@@ -132,4 +132,4 @@ rm -rf ~/.local/share/opencode-working-memory/workspaces/*/sessions/*.json
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: April 2026
|
||||
**Last Updated**: April 2026
|
||||
|
||||
Reference in New Issue
Block a user