Skip to content

feat: persistent cross-session memory tool #20869

@sebamar88

Description

@sebamar88

Problem

Every session starts cold. The agent can't remember project conventions, previously discovered patterns, or facts worth preserving across independent sessions. TodoWrite tracks task state within a session but nothing survives session boundaries.

Proposed approach

  • A MemoryTable in the database (project-scoped key-value facts)
  • A memory tool (read/write/list) the agent can call explicitly
  • Memory injection in SystemPrompt — load relevant entries and append them to the prompt at session start

Follows the same injection pattern as SystemPrompt.skills() and SystemPrompt.environment().

Why it belongs here

Reduces redundant re-exploration across sessions on the same project. Complements compaction (which manages context within a session) by bridging sessions.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions