Skip to content

feat(memory): add agent_memory table and memory-tools plugin#4

Open
herjarsa wants to merge 2 commits intodevfrom
feat/agent-memory-plugin
Open

feat(memory): add agent_memory table and memory-tools plugin#4
herjarsa wants to merge 2 commits intodevfrom
feat/agent-memory-plugin

Conversation

@herjarsa
Copy link
Copy Markdown
Owner

@herjarsa herjarsa commented Apr 25, 2026

Issue for this PR

Closes # (new feature, no issue)

Type of change

  • New feature

What does this PR do?

Adds the �gent_memory table and memory-tools plugin for cloud backup/restore of OpenCode AgentMemory via Supabase.

Changes:

  1. �gent_memory table with FTS5 full-text search and tags support
  2. AgentMemory service in Effect (save, search, consolidate)
  3. memory-tools plugin with 5 tools:
    • memory.configure - Configure Supabase connection
    • memory.backup - Push local memories to cloud
    • memory.restore - Pull cloud memories to local (merge)
    • memory.status - Show sync status
    • memory.schedule - Get/set auto-sync interval

Cloud sync features:

  • Conflict resolution: newest wins by timestamp
  • Auto-scheduler with configurable intervals (5m, 15m, 1h, 1d, manual)
  • Works with existing OpenCode AgentMemory data

How did you verify your code works?

  • TypeScript compiles without errors in memory-tools package
  • All Bun.sqlite bindings use proper type casts
  • Plugin follows the correct Plugin interface from @opencode-ai/plugin
  • Code follows OpenCode module conventions (Effect, self-export pattern)

Checklist

  • I have not included unrelated changes in this PR

Sisyphus-AI added 2 commits April 25, 2026 21:19
When the primary model fails after all retries, automatically try the next model from the fallback chain. This adds:

- fallbackModels field to MessageV2.User schema
- resolveFallbackChain helper to Provider service
- outer fallback loop in SessionProcessor.process()
- error classification: only retryable errors trigger fallback
  - No fallback for: AuthError, AbortedError, non-retryable APIError
  - Fallback for: rate limits, 5xx, other transient errors
- Add agent_memory table with full-text search and tags support
- Add AgentMemory service (save, search, consolidate) in Effect
- Add memory-tools plugin for cloud backup/restore via Supabase
- Plugin tools: memory.configure, memory.backup, memory.restore, memory.status, memory.schedule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant