opencode-mem  by tickernelz

AI coding agents with persistent, searchable memory

Created 3 months ago
420 stars

Top 70.0% on SourcePulse

GitHubView on GitHub
Project Summary

This OpenCode plugin provides AI coding agents with persistent memory using a local vector database, enabling long-term context retention across sessions. It targets OpenCode users seeking to enhance their agents' ability to recall past interactions and project details, thereby improving efficiency and continuity in development workflows.

How It Works

The system employs SQLite as the primary data store, augmented by USearch for efficient in-memory vector indexing, with an ExactScan fallback for robustness. It automatically learns user profiles, maintains a unified timeline of memories and prompts, and intelligently extracts relevant information based on user queries. The architecture supports multiple AI providers and over a dozen local embedding models, offering flexibility and privacy.

Quick Start & Requirements

  • Installation: Add "plugin": ["opencode-mem"] to ~/.config/opencode/opencode.json. The plugin downloads automatically on OpenCode startup.
  • Runtime: Recommended runtime is Bun. USearch is preferred for vector indexing; fallback to ExactScan is automatic if USearch is unavailable.
  • Configuration: Essential settings like storagePath, embeddingModel, and AI provider details are configured in ~/.config/opencode/opencode-mem.jsonc.
  • Web UI: Accessible at http://127.0.0.1:4747 for visual browsing and management.
  • Docs: Full documentation is available within the README.

Highlighted Details

  • Local vector database leveraging SQLite with USearch (in-memory) and ExactScan (fallback).
  • Automatic user profile learning and unified memory-prompt timeline.
  • Support for 12+ local embedding models and multi-provider AI (Anthropic, OpenAI) via OpenCode's authentication.
  • Intelligent prompt-based memory extraction and smart deduplication.
  • Built-in privacy protection and optional auto-capture of chat messages.

Maintenance & Community

The project actively seeks contributions for bug fixes, feature additions, and documentation improvements, with a commitment to quick pull request reviews. The codebase is described as well-structured and ready for enhancement.

Licensing & Compatibility

Licensed under the MIT License, permitting broad use, modification, and distribution, including for commercial purposes.

Limitations & Caveats

As a plugin for the OpenCode platform, its functionality is dependent on the host environment. The project is actively seeking contributions, suggesting it is still under active development and may evolve.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
16
Issues (30d)
18
Star History
228 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.