Magic Context: Unbounded, Self-Managing Memory for AI Coding Agents
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
Magic Context is a powerful GitHub repository that provides unbounded, self-managing memory for AI coding agents. Acting as the 'hippocampus' for agents, it ensures continuous learning and recall across sessions without disruptive context compaction. This tool, part of CortexKit, allows agents to build lasting project knowledge and maintain context efficiently.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
Magic Context is an innovative solution designed to address the persistent memory challenges faced by AI coding agents. It provides an "unbounded context" and a self-managing memory system, akin to a hippocampus, enabling agents to retain knowledge and context across long-running sessions. This crucial component of the CortexKit ecosystem ensures that agents can learn, remember, and recall project-specific information without the typical limitations of short-term memory or disruptive context management processes.
Why Use It & Key Benefits
Magic Context transforms how AI agents interact with their environment and tasks, offering several significant advantages:
- Uninterrupted Workflow: Agents never stop to manage their context, eliminating disruptive "compaction" pauses. The system handles context management continuously in the background, ensuring a smooth and uninterrupted workflow.
- Persistent Memory: Agents never forget. Magic Context builds lasting project knowledge, allowing agents to accumulate and recall information across weeks, months, or even years.
- Historian for Knowledge Capture: The historian component automatically compresses old raw history into tiered chambers, summarizing permanent knowledge, such as decisions, constraints, and conventions, into project memory. This process builds your agent's memory from the work it already performs.
- Dreamer for Memory Consolidation: An optional dreamer agent works in the background, similar to how sleep consolidates human memories. It checks memories against the current codebase, organizes redundancies, refines phrasing, and upgrades recurring insights, ensuring memory quality over time.
- Intelligent Recall: Active project memories and compressed session history are automatically injected into the agent's context. Agents can also use
ctx_searchto query project memories, raw conversation history, and indexed Git commits, providing relevant information precisely when needed. - Cache-Aware Design: The system is designed with a stable cache layout, ensuring that background operations never invalidate the cached prompt prefix. This maintains efficiency and reduces costs with cache-aware providers.
- Cross-Session and Cross-Harness Persistence: Memories persist seamlessly across different sessions and are shared between various harnesses like OpenCode and Pi, allowing for a unified knowledge base.
Installation
Getting started with Magic Context is straightforward. You can use the interactive setup wizard which detects your models, configures everything, and handles compatibility.
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/cortexkit/magic-context/master/scripts/install.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/cortexkit/magic-context/master/scripts/install.ps1 | iex
Or run directly (any OS):
npx @cortexkit/magic-context@latest setup
The wizard automatically detects your harnesses, adds the necessary plugin, disables built-in compaction, and helps you select models.
Examples
Magic Context provides powerful agent tools for memory management and recall.
Writing to Project Memory with ctx_memory:
Agents can explicitly record cross-session knowledge into specific categories.
ctx_memory(action="write", category="ARCHITECTURE", content="Event sourcing for orders.")
Searching Across Memories, Conversations, and Git with ctx_search:
Agents can query multiple layers of information simultaneously for relevant context.
ctx_search(query="why did we pick event sourcing for orders")
Links
Explore Magic Context further through these official resources:
- GitHub Repository: https://github.com/cortexkit/magic-context
- Official Documentation: https://docs.cortexkit.io/magic-context
- Desktop Application: https://github.com/cortexkit/magic-context/releases
Related repositories
Similar repositories that may be relevant next.

ADK-Rust: Build AI Agents in Rust with a Powerful Development Kit
September 1, 2026
ADK-Rust is a robust Agent Development Kit (ADK) for building AI agents in Rust. It offers a flexible framework with modular components for models, tools, memory, and real-time voice capabilities. Designed to be model-agnostic and deployment-agnostic, ADK-Rust empowers developers to create powerful and efficient AI agents.

OpenViking: A Self-Evolving Context Database for AI Agents
August 29, 2026
OpenViking is an open-source context database designed for AI agents, unifying agent memory, knowledge RAG, and skills into a virtual filesystem. It allows agents to browse their context deterministically using familiar commands like `ls` and `tree`. This innovative approach aims to enhance agent performance and reduce token spend by loading content in tiered layers.

Craft Agents: An Agent-Native Desktop App for LLM Interaction
August 27, 2026
Craft Agents is an open-source desktop application designed for effective interaction with large language model (LLM) agents. It enables intuitive multitasking, seamless connection to any API or service, and a document-centric workflow within a fluid user interface. Built with agent-native software principles, it offers high customizability and supports multiple LLM providers.

LoopX: Long-Horizon Agent Control Plane for Governed AI Workflows
August 25, 2026
LoopX is an open, provider-neutral, and stateful control plane designed for long-horizon AI agents. It enables durable, governed work across various agent harnesses, including Codex App and Claude Code. LoopX provides essential capabilities for managing complex, long-running tasks, ensuring objectives, gates, and handoffs remain stable and reviewable.
Source repository
Open the original repository on GitHub.