opencode-agent-memory  by joshuadavidthomas

Agent memory plugin for structured, persistent, and self-editable knowledge

Created 5 months ago
257 stars

Top 98.2% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides editable, persistent memory blocks for the OpenCode agent, inspired by the Letta framework. It enables agents to maintain long-term memory across sessions, enhancing their ability to retain context, learn, and self-reflect. The target audience is OpenCode users seeking to empower their AI agents with structured, persistent, and self-manageable memory capabilities.

How It Works

The core approach adapts Letta's shared memory blocks pattern, where markdown files on disk act as persistent, shared state accessible across OpenCode sessions. The agent interacts with these memory blocks using dedicated tools for listing, creating, updating, and replacing content. Additionally, memory blocks are injected into the system prompt, ensuring they remain in context. An optional journal feature allows for append-only entries with semantic search powered by local embeddings, capturing insights and decisions.

Quick Start & Requirements

  • Installation: Add "plugin": ["opencode-agent-memory"] to your ~/.config/opencode/opencode.json configuration file.
  • Requirements: OpenCode v1.0.115 or later.
  • Local Development: Clone the repository, run bun install, and symlink src/plugin.ts to ~/.config/opencode/plugin/memory.ts.
  • Documentation: Refer to the README for detailed configuration and usage.

Highlighted Details

  • Persistent memory blocks survive across sessions and context compaction.
  • Memory blocks are shared across sessions (global or project-scoped).
  • Agent self-editing capabilities via memory_list, memory_set, and memory_replace tools.
  • Optional journal feature with semantic search (using all-MiniLM-L6-v2 embeddings) and tools for writing, searching, and reading entries.
  • Default seeded blocks include persona, human, and project for initial agent configuration.

Maintenance & Community

No specific details regarding contributors, sponsorships, or community channels were found in the provided README.

Licensing & Compatibility

Licensed under the MIT license. Compatible with OpenCode. No explicit restrictions for commercial use are mentioned.

Limitations & Caveats

This plugin is marked as experimental. It requires a specific minimum version of OpenCode (v1.0.115 or later) to function.

Health Check
Last Commit

2 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
3
Star History
51 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.