↓Skip to main content
Zeitgeist — a spike by Chris Gathercole
  1. Topics/
  2. AI Code Architecture/

Gather — 29 August 2026

A Formalism for Agent-Consumable Architecture: The Context Graph & Protocol #

A significant pattern is emerging that treats architectural and operational knowledge not as documentation to be searched, but as a queryable, structured graph. Instead of providing agents with raw files and expecting them to infer relationships, this approach provides a formal API for agents to understand service boundaries, ownership, dependencies, and governance rules, aiming to solve the “operational awareness” gap in current tools.

  • Why AI coding agents need context graphs (Postman Blog) — This post argues that the key failure of current coding agents is in retrieval and grounding, as they lack “operational awareness.” It posits that simply increasing context token windows is insufficient. The proposed solution is to move from letting agents grep a codebase—which returns matches without meaning—to having them query a “context graph.” This graph represents entities like services, endpoints, owners, and dependencies as a set of structured, three-part statements (e.g., Service X exposes Endpoint Y). The article names an open protocol, the Model Context Protocol (MCP), as the interface for agents to query this graph, allowing them to get back structured entities instead of unstructured text, thus preventing them from inventing new endpoints or using deprecated libraries.
  • mnemo-agent-memory (Pi Packages) — This open-source package is a concrete implementation of the context graph concept. It provides a lightweight, Node.js-based memory engine for AI coding agents that operates over the Model Context Protocol (MCP). It is explicitly designed to solve context window contamination and token waste by providing high-precision information. Its features directly map to the “context graph” idea, including a cross-file AST dependency and symbol graph, automated ingestion of Git commit history to understand change intent, and monorepo-aware project scoping. This tool demonstrates how the abstract concept of a context graph can be implemented in a practical tool that integrates with agents like Claude and Cursor.

Codifying Architectural Intent for AI Consumption #

A clear theme is the development of explicit, machine-readable formats to provide architectural rules and context directly to AI agents. This moves beyond prose documentation towards conventions and configurations that an agent can deterministically parse and follow, effectively creating a “Human-to-AI Handoff” layer to prevent architectural drift.

  • The AI-Native Frontier: Everything-as-Code (EaC) Monorepos (GitHub) — This document proposes the concept of an “AI-Native Monorepo” designed specifically for an AI coding agent as its primary user. The core idea is that to achieve agent autonomy, all project context must be explicit and machine-readable. It introduces the convention of placing a CONTEXT.md or CLAUDE.md file in every major directory. This file serves as a “Human-to-AI Handoff,” containing explicit rules on tech stack (“We use Next.js 15”), patterns (“Always use Drizzle for DB queries”), and invariants (“Never touch /infra without updating /docs/security-log.md”). This approach treats context as a formal part of the architecture, enabling an agent to perform an “Atomic Feature Cycle” across different domains (backend, frontend, docs) in a single pass.
  • Custom ESLint Rules for AI Determinism: Teaching LLMs Through Structured Errors (linkedin.com) — This article presents a highly specific and practical technique for enforcing architectural decisions: encoding them as custom ESLint rules. The core principle is that “Error messages are teaching prompts.” When an AI agent generates code that violates a project-specific pattern (e.g., incorrect layer boundaries, DTOs in the wrong location), a custom lint rule provides a deterministic, structured error message that explains the violation and teaches the correct pattern. This transforms linting from simple error detection into an automated architectural teaching mechanism, allowing the LLM to learn a project’s specific design patterns through iterative feedback.
  • Clean Context Strategies for AI Coding Agents in Monorepos (M365 FM Podcast) — This piece addresses the challenge of agents producing locally functional but globally flawed code in large enterprise monorepos. It advocates for “clean context” strategies to prevent architectural violations. The primary techniques are using development tools like Nx to define strict dependency boundaries and project metadata that agents can respect, and codifying team-specific conventions and tribal knowledge in instruction files like AGENTS.md. This captures architectural intent in a way that provides scoped, relevant information to the agent, preventing it from being overwhelmed by the noise of a large repository.
  • Engineering Log: Building Non-Trivial Systems with an AI Coding Assistant (GitHub) — This detailed log of building a complex system with an AI assistant reveals the necessity of creating a “structured agent memory.” The author’s workflow evolved to rely on a set of explicit documents that provide continuity and architectural guidance across hundreds of sessions. The system consists of four key components: a curated memory file summarizing the current state, a gap analysis document outlining remaining work, an issue tracker, and, crucially, a collection of Architectural Decision Records (ADRs) to explain why past decisions were made. This demonstrates a practical, human-driven approach to creating a persistent, explicit architectural context for an AI partner.

Emerging Patterns in Multi-Agent System Architecture #

As teams move from single coding assistants to coordinated multi-agent systems, several distinct architectural patterns are being documented. The choice between these patterns involves critical trade-offs in control, complexity, cost, and latency, and the consensus is to start with the simplest viable structure.

  • Multi-agent system architecture: a comparison guide + best practices (Openlayer) — This analysis identifies five core multi-agent patterns: Supervisor (orchestrator-worker), Hierarchical, Peer-to-peer, Blackboard, and Swarm. It provides a crucial data-driven insight into the architectural trade-offs, noting that while multi-agent systems can improve performance on parallelizable tasks, they can degrade performance by 39-70% on tasks requiring sequential reasoning. This highlights that choosing a multi-agent architecture is a significant decision with a direct, measurable impact on performance based on the nature of the work.
  • Multi-Agent Systems for Developers (JetBrains) — This article provides a structured comparison of common multi-agent patterns, evaluating them on the dimensions of “Coordination cost (tokens and latency)” and “Adapts at runtime.” It contrasts patterns like Planner-Executor (low cost, low adaptability) with Supervisor-Worker (high cost, high adaptability). This framing provides a clear model for architects to choose a pattern based on whether their workflow is fixed and predictable or requires dynamic re-routing and decision-making at each step.
  • AI Agent Architecture: Patterns and Production Design (Mastra) — This guide makes a strong architectural recommendation: “climb the complexity ladder one rung at a time.” It argues that most enterprise use cases are best served by a single agent with a good toolset, and that multi-agent systems should only be adopted when a task genuinely cannot be handled by a single agent. It categorizes multi-agent patterns into three primary shapes—Vertical (leader/specialist), Horizontal (peer-to-peer), and Hybrid—and emphasizes that each step up in complexity adds significant overhead in latency, cost, and potential failure modes.
  • Multi-Agent Orchestration: An AI Agents Guide for Mid-Market (Easyflow - AI Agency) — Focusing on the specific constraints of mid-market companies, this piece makes a pragmatic architectural choice, advocating for the “hub-and-spoke” (or supervisor) pattern over “mesh” (peer-to-peer) almost every time. The justification is not based on theoretical elegance but on operational reality, specifically the “2 a.m. test”: which architecture is easier to debug when a failure occurs? The hub-and-spoke model provides a single point of control and observability, which is critical for teams without large, dedicated operational capacity.

The Human Role Shifts to Architectural Governance and Intent Definition #

With AI handling more implementation, the focus of senior human developers is shifting from writing code to defining and enforcing the architectural rules of the system. This involves a new emphasis on structured reviews, managing the “productivity-reliability paradox,” and making high-level design decisions.

  • Software Architecture Review Checklist for AI Codebases (Jetruby) — This article provides a formal checklist for conducting software architecture reviews specifically for AI-intensive codebases. It highlights the core risk: AI-generated solutions may optimize for an immediate, local task while being ignorant of the “broader architectural context,” leading to the introduction of circular dependencies, unstable interfaces, or duplicated business rules. The guidance is not to distrust AI code, but to formalize the human review process to focus on validating that local changes remain consistent with global architectural boundaries and goals.
  • Building Effective AI Teams for the AI-Native Development Life Cycle (Medium) — This essay names the “productivity-reliability paradox,” describing the tendency of ungoverned AI code generation to increase output speed while degrading overall system reliability and creating technical debt. It makes a powerful architectural claim: in the age of the AI-driven lifecycle, Domain-Driven Design’s “Bounded Contexts” are no longer just good practice but have become a “precondition for the model working at all.” Scoping an agent’s context to a well-defined domain is presented as the primary mechanism for reducing hallucinations and preventing architectural drift.
  • Architecture erosion problem with AI coding agents (Reddit) — This discussion thread captures the widespread developer concern that AI agents, by making many small, locally-correct changes, can relentlessly cause architectural erosion that converts a well-designed system into a “big ball of mud.” The problem is framed as one of speed and scale, where human code review cannot keep up. The proposed solution is to create deterministic checks, like a “structural linter,” that can automatically detect when a change violates intended module boundaries or introduces a forbidden dependency, thus catching erosion early.

Meta-observations #

  • Emerging theme: A dominant theme is the need to make architectural knowledge explicit and machine-readable for agents. This is manifesting in several forms, from CONTEXT.md files and custom linters to full-fledged knowledge graphs, all aimed at giving agents the necessary guardrails to prevent architectural drift.
  • Emerging pattern: The “Context Graph,” accessed via a formal interface like the Model Context Protocol (MCP), is a significant emerging pattern. It represents a leap from providing agents with unstructured text (files) to giving them a queryable, structured understanding of a system’s components and their relationships.
  • Keyword suggestion: “Context Graph,” “Model Context Protocol (MCP),” “AI-Native Monorepo,” “Architectural Governance,” “Productivity-Reliability Paradox.”
  • Source to watch: The Postman blog provided a very high-quality, forward-looking piece on context graphs. The concept of agentskills.io also represents a novel approach to packaging expert knowledge for agents.