magic-context  by cortexkit

AI coding agent context and memory management

Created 2 months ago
726 stars

Top 47.0% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

Magic Context is an OpenCode plugin addressing AI coding agent context and memory limitations. It provides persistent, cache-aware, "infinite" context across sessions, enhancing agent recall and consistency for developers using OpenCode.

How It Works

A background historian transparently compresses conversation history into structured compartments and extracts durable facts. Operations are cache-aware and deferred. Cross-session memory persists project knowledge by promoting facts into memories, injected into new sessions. An optional "dreamer" agent refines memories and maintains documentation overnight. This ensures agents retain context without explicit user management.

Quick Start & Requirements

Installation uses an interactive wizard (curl ... | bash or powershell ... | iex) or bunx --bun @cortexkit/opencode-magic-context@latest setup. Manual setup requires disabling OpenCode's built-in compaction and creating magic-context.jsonc. Prerequisites include Bun ≥ 1.0 and OpenCode. Oh-My-OpenAgent users may need hook adjustments.

Highlighted Details

  • Cache-aware, deferred context compaction and cross-session memory persistence.
  • Asynchronous background historian and optional overnight "dreamer" agent for memory consolidation.
  • TUI sidebar visualizes context, token usage, and memory status.
  • Experimental features: Temporal Awareness, Git Commit Indexing, Auto Search Hints, User Memories.
  • Companion desktop app for state management and diagnostics.

Maintenance & Community

The project welcomes bug reports and pull requests, requiring code formatting (bun run format) before submission. Specific community channels or contributors are not detailed.

Licensing & Compatibility

Released under the MIT license, permitting broad commercial use. Requires disabling OpenCode's native context compaction and may need configuration for tools like Oh-My-OpenAgent.

Limitations & Caveats

Advanced features (Temporal Awareness, Git Commit Indexing, User Memories) are experimental and opt-in. Relies on a local SQLite database; failure disables the plugin. Conflicts with other plugins are detected via a doctor command.

Health Check
Last Commit

5 days ago

Responsiveness

Inactive

Pull Requests (30d)
13
Issues (30d)
51
Star History
326 stars in the last 30 days

Explore Similar Projects

Starred by Elie Bursztein Elie Bursztein(Cybersecurity Lead at Google DeepMind), Dan Guido Dan Guido(Cofounder of Trail of Bits), and
5 more.

claude-mem by thedotmack

2.3%
79k
AI coding assistant memory system
Created 8 months ago
Updated 1 day ago
Feedback? Help us improve.