Concept Reference

Shared Context Layer

Deep dive into the core architecture of persistent memory for AI coding workflows.

What is Shared Context?

In traditional LLM interactions, context is ephemeral. An agent operates inside a single prompt session, with access only to the files you explicitly attach or search.

Shared Context represents a continuous, decoupled state engine. Instead of feeding agents raw directories and hoping they parse everything, Megas Moves acts as a structured context translation server. It parses project metadata, tracks active task lists, extracts design tokens, and packages them into a clean JSON context format that can be easily parsed by AI models at the beginning of their execution window.

Why it Matters

Without a persistent context engine, AI agents run into three major issues:

  • Context Decay: As conversations lengthen, the model forgets initial configuration instructions.
  • Work Silos: An agent working inside a browser tool does not know what an agent in the terminal just changed.
  • Loss of Intent: The agent fails to prioritize tasks, refactoring secondary files while critical features remain broken.

Examples of Useful Context

Megas Moves groups development parameters into structured categories. Here is what you should map inside your workspace context:

Product Goal

The core business purpose. Keeps the agent aligned on what we are building, who the user is, and what value the feature delivers.

Current Sprint Details

The targeted milestones for the active cycle. Prevents the agent from wandering off and editing files out of scope.

Technology Stack Policies

Explicit constraints (e.g. Next.js 16 App Router, TypeScript, Tailwind CSS v4, FastAPI, PostgreSQL). Prevents agents from introducing incompatible libraries.

Coding & Design Rules

Custom conventions, formatting specs, and styling preferences (e.g., using pure HSL CSS gradients instead of default utilities, or naming endpoints in camelCase).

Known Bugs & Glitches

A synchronized record of current blockers. Aids the agent in avoiding known issues or directly solving related bugs.

Architecture & Schema Notes

Table designs, API structures, or folder structures. Essential context for database integrations and routing handlers.

Launch Checklist

Tests that must pass, configuration files that must be validated, and permission checks that are required before deployment.

User Feedback Logs

Direct customer issue statements. Gives context to UI bugs and helps the agent understand user pain points.

How Agents Use the Context Layer

During agent startup (such as running megas in your terminal or using our IDE extension), the developer assistant performs an API handshake with the local Megas daemon.

For cross-platform installation and uninstallation guides (Linux, macOS, Windows PowerShell/CMD, and Pip), please refer to the CLI Installation Guide.

Once paired, the client connects to retrieve the workspace context payload:

GET /api/v1/context/current-workspace
Response:
{
  "active_sprint": "sprint-4-auth",
  "guardrails": {
    "styling_standard": "pure-css-dark-gold",
    "forbidden_directories": ["/backend/backups"],
    "allowed_packages": ["lucide-react", "next", "react"]
  },
  "current_milestones": [
    { "id": "m1", "title": "Setup Let's Encrypt SSL", "status": "completed" },
    { "id": "m2", "title": "Configure Next.js 16 layout", "status": "in-progress" }
  ]
}

By referencing this payload before compiling file edits, the coding agent automatically aligns its code suggestions with your target specs, eliminating redundant setup instructions.