Favicon of Magic Context

Magic Context

An open-source coding agent memory plugin for OpenCode, Pi, and OMP, licensed under MIT, with support for a local model to summarize history.

Screenshot of Magic Context website

Magic Context is a context and memory plugin for developers working with coding agents in OpenCode, Pi, and OMP. Part of CortexKit, it keeps project knowledge across sessions and handles history compression in the background so context management doesn't interrupt ongoing work.

As it summarizes conversations, it saves decisions, constraints, conventions, and configuration values as project memories. Those memories carry into future sessions and across the supported agents, reducing the need to explain the same project rules again. The agent can also record or delete memories directly.

Older conversations become chronological summaries with importance scores. Their level of detail adjusts to the model's context window, keeping the active context smaller while retaining the thread of earlier work. The summarization model is separate from the main coding model: you can use a fully local model for that background task while keeping a different model for coding. That choice applies to summarization, rather than establishing that the whole workflow runs offline.

An optional background agent checks stored memories against the codebase, corrects stale facts, merges duplicates, and records lessons from corrections. Relevant memories surface automatically each turn. When an agent needs more detail, it can search project memories, past conversations, git commits, notes, and primers through semantic search with a full-text fallback.

Magic Context is open source under the MIT license.

Similar to Magic Context