Skip to main content

Supermemory

tip

1,234 GitHub stars — Persistent memory across OpenCode sessions. Agents remember context, decisions, and project knowledge between conversations.

Overview

Supermemory gives OpenCode agents durable memory that persists across sessions. Instead of starting fresh each time, the agent can recall past decisions, known patterns, project conventions, and important context from previous conversations — enabling a continuous, learning interaction model.

When to Use

ScenarioBenefit
Long-term projectsAgents remember architectural decisions and conventions
Onboarding new agentsShared context reduces ramp-up time for new sessions
Repeated workflowsAgents learn and optimize familiar procedures
Cross-session knowledgeDecisions from one session inform the next

How It Works

  1. Capture — During a session, the agent identifies important context: decisions, patterns, file locations, conventions.
  2. Store — Supermemory persists this information to a durable store (local file or cloud-backed).
  3. Retrieve — In subsequent sessions, the agent pulls relevant memories into context automatically.
  4. Update — Memories can be refined, corrected, or invalidated as the project evolves.

Installation

{
"plugin": ["opencode-supermemory"]
}

Configuration

Basic Setup

{
"plugin": ["opencode-supermemory"],
"supermemory": {
"store": "local",
"path": "~/.opencode/memory.json"
}
}

Cloud-Backed Storage

{
"plugin": ["opencode-supermemory"],
"supermemory": {
"store": "cloud",
"api_key": "${SUPERMEMORY_API_KEY}"
}
}

Usage

Automatic Memory

Once installed, the agent automatically saves and retrieves context:

When working on authentication, remember we decided to use session-based auth with refresh tokens.

The next session will recall this decision when authentication topics arise.

Manual Memory Management

/supermemory list # Show all stored memories
/supermemory search auth # Search for authentication-related memories
/supermemory delete <id> # Remove a specific memory

Memory in Commands

{
"command": {
"with-context": {
"description": "Work with full project memory",
"template": "Load the project context from Supermemory and help me implement $ARGUMENTS."
}
}
}

Best Practices

Be Explicit About What to Remember

  • Tell the agent explicitly when something should be persisted.
  • Use structured statements: "Remember that the API base URL is https://api.example.com/v2."

Review and Curate Memories

  • Periodically review stored memories for accuracy.
  • Remove or update memories that are no longer relevant.
  • Contradictory memories confuse agents — keep them clean.

Granularity

  • Save high-level decisions and conventions, not every minor detail.
  • Avoid storing code snippets that will change; store patterns and references instead.

GitHub