Magic Context
An MIT-licensed coding agent memory plugin for OpenCode, Pi and OMP that retains project knowledge and can summarize history with a local model.

Magic Context is a memory and context plugin for developers using OpenCode, Pi and OMP. It carries project knowledge across sessions and compresses older conversations in the background to avoid interrupting the agent's work.
- Project memory: Capture decisions, constraints, conventions and configuration values from conversations, then recall them across sessions and supported agents.
- History compression: Replace older messages with chronological summaries whose detail adjusts to the model's context window and the importance of the information.
- Memory upkeep: An optional background agent checks memories against the codebase, corrects stale facts, merges duplicates and records lessons from user corrections.
- Search and recall: Surface project memories each turn and let the agent search memories, conversations, git commits, notes and primers using semantic search with a full-text fallback.
The summarization model is separate from the main coding model, so that background task can use a fully local model. This doesn't make the rest of the coding workflow offline; its model choices are separate. Magic Context is part of CortexKit and is open source under the MIT license.