{"slug": "running-a-fleet-of-ai-coding-agents-stop-context-reset-and-wire-in-a-knowledge", "title": "Running a Fleet of AI Coding Agents? Stop Context Reset—and Wire in a Knowledge Graph", "summary": "A developer published a guide arguing that teams running fleets of AI coding agents should replace per-session context resets with a queryable knowledge graph of architectural decisions, dependencies, ownership boundaries and constraints. The writeup contends that parallel agents each infer a locally reasonable but mutually inconsistent architecture from limited context, and that a durable, structured, scoped, versioned and auditable graph-backed context layer lets agents retrieve only the relevant slice of system knowledge before planning or writing code.", "body_md": "*Originally published on [tamiz.pro](https://tamiz.pro/insights/ai-coding-agent-fleet-knowledge-graph-architecture-memory).*\n\nMost teams adopting AI coding agents expect a productivity gain. They get something more complicated: a fleet of brilliant, amnesiac contractors. Each agent starts with a clean context window, reads a few files, and produces a plausible implementation that ignores the service boundaries, naming conventions, and architectural decisions your team spent months documenting.\n\nThe problem is not usually model capability. It is context architecture. A coding agent is a stateless reasoning engine attached to a temporary workspace, while your codebase is a long-lived, interconnected system of constraints. Asking an agent to “read the docs” is not a memory strategy; it is a suggestion.\n\nThe durable fix is to treat architectural knowledge as a **queryable graph** rather than a pile of Markdown files. Agents should retrieve the smallest relevant slice of your system—decisions, dependencies, ownership boundaries, and constraints—before they plan or write code. This guide explains why multi-agent fleets amplify context drift, how to model architecture as a knowledge graph, and how to wire a graph-backed context layer into an agent workflow that remains auditable and cheap enough to run at scale.\n\nConsider a common scenario. You run five coding agents in parallel:\n\nEvery agent receives a ticket, some file paths, and a prompt such as:\n\nImplement this feature following our architecture guidelines.\n\nThe agents work independently. Two weeks later, you discover:\n\nNone of these agents made an obviously absurd choice. Each inferred a reasonable architecture from the limited context it had. But “reasonable” is not “consistent,” and consistency is what turns a collection of changes into a coherent system.\n\nThis is the difference between **local correctness** and **architectural coherence**. An agent can write a clean function that violates a company-wide boundary. It can pass a unit test while creating a dependency cycle. It can follow a file-level style guide while ignoring a decision record explaining why a particular pattern was rejected.\n\nThe failure mode is not “the agent forgot the rules.” It is “the agent never received the rules in a form it could reliably use.”\n\nModern coding agents have long context windows, but length is not the same thing as memory. There are three distinct mechanisms teams often conflate.\n\nA context window holds the tokens for the current run: the prompt, selected files, tool output, and intermediate reasoning. It is useful for reasoning about the task at hand. It is not a durable knowledge store, because:\n\nYour codebase contains a great deal of architectural knowledge, but it encodes it implicitly. A dependency rule might live in an ESLint configuration. A boundary might be visible only in import statements. A rejected design might be documented in a proposal that no longer resembles the code.\n\nRetrieving raw files is therefore noisy. An agent that reads twenty files may still miss the rule that matters most.\n\nConversation history helps an agent remember what happened within a session. It does not help a different agent, a different branch, or a run three weeks later. In a fleet, conversation history is particularly weak as shared state because each agent owns a separate thread.\n\nA useful architecture-memory layer needs to be:\n\n| Requirement | Why it matters | \n|---|---|\n| Durable | Knowledge survives sessions, branches, and agent restarts | \n| Structured | Relationships and constraints can be queried, not just semantically matched | \n| Scoped | An agent receives only the context relevant to its task | \n| Versioned | Agents can distinguish current rules from superseded ones | \n| Auditable | A human can inspect why an agent received a given fact | \n| Mutable | New decisions update future behavior without rewriting every prompt | \n\nA knowledge graph satisfies all six when it is modeled around engineering semantics rather than generic document chunks.\n\nA single agent can sometimes reconstruct enough architecture by reading the repository. A fleet multiplies the cost of inconsistency because agents do not merely share a codebase—they share a codebase with **concurrent, mutually unaware mutations**.\n\nTwo agents can independently infer that a module is owned by the platform team. One may add a public method; the other may bypass it to meet a deadline. No single prompt was wrong. The assumptions were simply incompatible.\n\nA branch is an excellent unit of code change but a poor unit of architectural reasoning. If one agent changes an event schema, every downstream consumer should know. If another changes an API contract, every client and test should know. Without a shared semantic layer, those dependencies are discovered through compilation failures—or, worse, at runtime.\n\nPrompt engineering treats architectural guidance as prose embedded in a template. That works until the template grows too large, guidance becomes ambiguous, or different agents interpret it differently. As the fleet scales, prompt quality becomes a hidden central bottleneck.\n\nDocumentation retrieval is useful, but plain text lacks the relationships needed for impact analysis. If a decision says “the billing service owns subscription state,” an agent changing a checkout flow needs to know which services, tables, events, and teams are affected. That is a graph traversal, not a keyword search.\n\nThe core shift is from **prompt-centric context** to **architecture-centric context**:\n\n```\nPrompt-centric:  task → retrieve text → ask model → write code\n\nArchitecture-centric: task → resolve scope → traverse graph →\n                    retrieve justified facts → plan → write code → validate\n```\n\nA knowledge graph represents entities and the relationships between them. For software architecture, the entities are not abstract concepts; they are the things engineers actually reason about:\n\nThe relationships capture why those entities matter to one another.\n\nA graph does not need to duplicate every function or line of code. Instead, it provides a **semantic index over the codebase**. The graph says:\n\nThe agent then retrieves the concrete source files and snippets needed to act on those facts.\n\nThis division of labor is important:\n\nThe graph supplies relevance and authority. The repository supplies implementation detail.\n\nWithout a graph, the unit of work is “a ticket plus a prompt.” With a graph, the unit of work becomes “a ticket plus a resolved architectural scope.”\n\nFor example:\n\n```\n{\n  \"task\": \"Add a refund webhook to the checkout service\",\n  \"scope\": {\n    \"owned_components\": [\"checkout-api\", \"refund-events\"],\n    \"forbidden_dependencies\": [\"payment-ledger\"],\n    \"required_patterns\": [\"outbox\", \"idempotency-key\"],\n    \"affected_consumers\": [\"orders-web\", \"notification-worker\"]\n  }\n}\n```\n\nThe agent no longer has to rediscover that it must use a transactional outbox, cannot call the ledger directly, and must update two downstream consumers. It receives that scope as structured context, with links back to the source of each fact.\n\nBecause the graph is external to any individual agent session, it can serve as a coordination substrate. When an agent changes an event contract, it updates the graph. Subsequent agents see the new relationship and affected components.\n\nThis does not eliminate the need for branch review, tests, or deployment coordination. It makes those mechanisms less likely to be the first place architectural inconsistency becomes visible.\n\nYou do not need a massive ontology. Start with a small schema that captures the relationships your agents most often violate.\n\n| Entity | Purpose | Example | \n|---|---|---|\n| `Component` | A deployable or logically bounded unit | `checkout-api` | \n| `Module` | A code-level unit within a component | `refunds` | \n| `Interface` | A contract between components | `RefundRequested` | \n| `DataStore` | A persistent data boundary | `billing_db.orders` | \n| `Decision` | A ratified architectural choice | `ADR-014: use outbox` | \n| `Policy` | A machine-checkable or human-enforced rule | `No direct ledger access` | \n| `Team` | An ownership domain | `Payments` | \n\n| Relationship | Direction | Example | \n|---|---|---|\n| `OWNS` | Team → Component | Payments owns checkout-api | \n| `CONTAINS` | Component → Module | checkout-api contains refunds | \n| `DEPENDS_ON` | Component → Component | checkout-api depends on inventory-api | \n| `IMPLEMENTS` | Component → Interface | orders-worker implements RefundRequested | \n| `PRODUCES` /`CONSUMES` | Component → Interface | checkout-api produces RefundRequested | \n| `READS` /`WRITES` | Component → DataStore | checkout-api writes orders | \n| `GOVERNED_BY` | Any entity → Policy | checkout-api governed by outbox policy | \n| `DECIDED_BY` | Any entity → Decision | outbox governed by ADR-014 | \n| `APPLIES_TO` | Policy → Scope | policy applies to checkout-api | \n\nA graph edge should carry enough metadata to answer “Can I rely on this?”\n\n```\n{\n  \"from\": \"checkout-api\",\n  \"type\": \"GOVERNED_BY\",\n  \"to\": \"pol:outbox-for-external-events\",\n  \"properties\": {\n    \"source\": \"docs/architecture/adr-014.md#decision\",\n    \"status\": \"accepted\",\n    \"effective_from\": \"2025-02-10\",\n    \"confidence\": \"verified\",\n    \"observed_at\": \"2025-03-01T12:00:00Z\"\n  }\n}\n```\n\nUseful edge properties include:\n\n`status`: proposed, accepted, deprecated, superseded` scope`: where the rule applies` source`: the file, ADR, pull request, or schema that establishes it` effective_from`: when the rule became authoritative` confidence`: verified, inferred, or unknown` observed_at`: when the extractor last saw the evidence\nThe `confidence` field is especially important. A graph that silently mixes verified policy with machine-generated guesses is worse than no graph, because agents cannot calibrate their behavior against uncertainty.\n\nThe graph does not retrieve itself. You still need a retrieval strategy that combines graph traversal with semantic search.\n\nStart with the ticket, changed files, repository name, and explicit service names. Extract candidate identifiers and search the graph for matching components, modules, interfaces, and teams.\n\nDo not assume the ticket title contains the canonical component name. “Add refund support” might map to `checkout-api` and `refund-events`, not to a directory literally named `refund`.\n\nTraverse a small number of relationship hops:\n\n```\ntask component\n  ├─ governed_by → policies and decisions\n  ├─ depends_on → upstream components\n  ├─ produces/consumes → interfaces\n  ├─ reads/writes → data stores\n  └─ owned_by → team and runbooks\n```\n\nA depth of two or three is often sufficient. Unlimited traversal recreates the “dump the whole repository” problem in graph form.\n\nRank candidate facts using:\n\nA policy such as “all external events use Kafka” may be globally accepted but explicitly scoped to a particular region or team. Scope-aware filtering prevents false universalization.\n\nUse the graph to identify the files that matter, then search or read those files. For example, if the graph says `checkout-api` implements `RefundRequested`, retrieve:\n\nDo not paste entire files into the prompt. Retrieve the smallest useful code region, ideally with symbol boundaries and a stable reference.\n\nThe model should receive a compact, structured packet rather than a raw graph dump:\n\n```\n{\n  \"task\": \"Add a refund webhook\",\n  \"architecture\": [\n    {\n      \"fact\": \"External events must be published through the transactional outbox\",\n      \"applies_to\": [\"checkout-api\"],\n      \"source\": \"docs/architecture/adr-014.md\",\n      \"status\": \"accepted\"\n    },\n    {\n      \"fact\": \"checkout-api must not call payment-ledger directly\",\n      \"applies_to\": [\"checkout-api\"],\n      \"source\": \"architecture/policies/boundaries.yaml\",\n      \"status\": \"active\"\n    }\n  ],\n  \"relevant_code\": [\n    {\n      \"path\": \"services/checkout/src/events/refund_publisher.ts\",\n      \"reason\": \"Canonical publisher for refund events\"\n    },\n    {\n      \"path\": \"packages/events/src/refund_requested.ts\",\n      \"reason\": \"Event contract to extend\"\n    }\n  ],\n  \"affected_consumers\": [\"orders-web\", \"notification-worker\"]\n}\n```\n\nThis packet is auditable. Every fact has a source, and every file has a reason.\n\nThe runtime should make graph retrieval a **mandatory phase**, not an optional tool the model may forget to call.\n\n```\n1. Scope\n   Identify the component, interface, and files involved.\n\n2. Retrieve\n   Resolve architecture facts and implementation evidence.\n\n3. Plan and implement\n   Use the retrieved constraints while editing code.\n\n4. Validate and record\n   Check the diff against graph-derived constraints and update the graph.\n```\n\nThe validation phase is what turns the graph from passive documentation into an active control plane.\n\nDo not rely on the model to “remember” a rule while generating code. Validate the resulting diff against the same graph facts:\n\nAfter a successful change, emit an event such as:\n\n```\n{\n  \"type\": \"ArchitectureChangeRecorded\",\n  \"component\": \"checkout-api\",\n  \"change\": {\n    \"operation\": \"add_interface\",\n    \"interface\": \"RefundRequested.v2\",\n    \"source_pr\": 1842\n  },\n  \"evidence\": [\"services/checkout/src/events/refund_publisher.ts\"],\n  \"recorded_at\": \"2025-03-01T12:00:00Z\"\n}\n```\n\nThe graph updater should validate the event before applying it. A pull request number alone is not proof that a decision was accepted; a schema change may still be under review.\n\nWhen the graph lacks a fact, the agent should be told to do one of three things:\n\nIt should not silently invent an architectural pattern and then treat that invention as project knowledge.\n\nThe following example uses Python, SQLite, and a simple graph store implemented as an adjacency table. It demonstrates the important mechanics without requiring a dedicated graph database.\n\n`services/` directory\nThe example is intentionally compact. In production, you would likely use a graph database or an embedded vector-plus-graph store, but the retrieval contract remains the same.\n\n```\npython -m venv .venv\nsource .venv/bin/activate\npip install networkx\n```\n\n`architecture_graph.py`\n\n``` python\nfrom __future__ import annotations\n\nimport json\nfrom dataclasses import dataclass\nfrom pathlib import Path\nfrom typing import Any\n\nimport networkx as nx\n\n@dataclass(frozen=True)\nclass ContextRequest:\n    task: str\n    components: list[str]\n    changed_paths: list[str]\n    max_hops: int = 2\n\nclass ArchitectureGraph:\n    def __init__(self) -> None:\n        self.graph = nx.MultiDiGraph()\n\n    def add_entity(self, entity_id: str, entity_type: str, **properties: Any) -> None:\n        self.graph.add_node(entity_id, type=entity_type, **properties)\n\n    def add_relation(\n        self,\n        source: str,\n        relation: str,\n        target: str,\n        **properties: Any,\n    ) -> None:\n        self.graph.add_edge(source, target, type=relation, **properties)\n\n    def load_repository(self, root: Path) -> None:\n        \"\"\"Infer a minimal component graph from the repository layout.\"\"\"\n        services_dir = root / \"services\"\n        if not services_dir.exists():\n            return\n\n        for service_dir in sorted(services_dir.iterdir()):\n            if not service_dir.is_dir():\n                continue\n\n            component_id = f\"component:{service_dir.name}\"\n            self.add_entity(component_id, \"component\", path=str(service_dir))\n\n            for source_file in service_dir.rglob(\"*.ts\"):\n                module_id = f\"module:{service_dir.name}/{source_file.stem}\"\n                self.add_entity(\n                    module_id,\n                    \"module\",\n                    path=str(source_file.relative_to(root)),\n                )\n                self.add_relation(component_id, \"CONTAINS\", module_id)\n\n    def load_policies(self, path: Path) -> None:\n        \"\"\"Load simple YAML-like policy records without external dependencies.\"\"\"\n        # This example uses JSON to keep the file runnable without PyYAML.\n        records = json.loads(path.read_text(encoding=\"utf-8\"))\n\n        for record in records:\n            policy_id = f\"policy:{record['id']}\"\n            self.add_entity(\n                policy_id,\n                \"policy\",\n                text=record[\"text\"],\n                status=record.get(\"status\", \"active\"),\n                source=record.get(\"source\", str(path)),\n            )\n\n            for component in record.get(\"applies_to\", []):\n                component_id = f\"component:{component}\"\n                self.add_entity(component_id, \"component\")\n                self.add_relation(\n                    component_id,\n                    \"GOVERNED_BY\",\n                    policy_id,\n                    status=record.get(\"status\", \"active\"),\n                    source=record.get(\"source\", str(path)),\n                )\n\n    def resolve_component(self, name: str) -> str | None:\n        candidates = [\n            node\n            for node, data in self.graph.nodes(data=True)\n            if data.get(\"type\") == \"component\"\n            and (\n                node == f\"component:{name}\"\n                or node.endswith(f\":{name}\")\n                or name in node\n            )\n        ]\n        return candidates[0] if candidates else None\n\n    def collect_neighborhood(self, component_id: str, max_hops: int) -> set[str]:\n        nodes = {component_id}\n        frontier = {component_id}\n\n        for _ in range(max_hops):\n            next_frontier: set[str] = set()\n            for node in frontier:\n                for neighbor in self.graph.successors(node):\n                    if neighbor not in nodes:\n                        nodes.add(neighbor)\n                        next_frontier.add(neighbor)\n\n                for neighbor in self.graph.predecessors(node):\n                    if neighbor not in nodes:\n                        nodes.add(neighbor)\n                        next_frontier.add(neighbor)\n\n            frontier = next_frontier\n\n        return nodes\n\n    def build_context(self, request: ContextRequest) -> dict[str, Any]:\n        component_ids = [\n            component_id\n            for name in request.components\n            if (component_id := self.resolve_component(name)) is not None\n        ]\n\n        if not component_ids:\n            return {\n                \"task\": request.task,\n                \"architecture\": [],\n                \"relevant_code\": [],\n                \"warnings\": [\n                    \"No component matched the task. \"\n                    \"Ask for clarification before implementing.\"\n                ],\n            }\n\n        relevant_nodes: set[str] = set()\n        for component_id in component_ids:\n            relevant_nodes.update(\n                self.collect_neighborhood(component_id, request.max_hops)\n            )\n\n        architecture: list[dict[str, Any]] = []\n        relevant_code: list[dict[str, Any]] = []\n\n        for node_id in relevant_nodes:\n            node = self.graph.nodes[node_id]\n\n            if node.get(\"type\") == \"policy\" and node.get(\"status\") == \"active\":\n                architecture.append(\n                    {\n                        \"fact\": node.get(\"text\", node_id),\n                        \"source\": node.get(\"source\", node_id),\n                        \"status\": node.get(\"status\", \"active\"),\n                    }\n                )\n\n            if node.get(\"type\") == \"module\":\n                relevant_code.append(\n                    {\n                        \"path\": node.get(\"path\"),\n                        \"reason\": f\"Module within {node_id.split(':')[1]}\",\n                    }\n                )\n\n        # Include changed paths explicitly, even if the graph is incomplete.\n        known_code_paths = {item[\"path\"] for item in relevant_code}\n        for changed_path in request.changed_paths:\n            if changed_path not in known_code_paths:\n                relevant_code.append(\n                    {\n                        \"path\": changed_path,\n                        \"reason\": \"Explicitly included by the task\",\n                    }\n                )\n\n        return {\n            \"task\": request.task,\n            \"architecture\": architecture,\n            \"relevant_code\": relevant_code,\n            \"warnings\": [],\n        }\n\ndef main() -> None:\n    root = Path.cwd()\n    graph = ArchitectureGraph()\n    graph.load_repository(root)\n    graph.load_policies(root / \"architecture_policies.json\")\n\n    request = ContextRequest(\n        task=\"Add a refund webhook\",\n        components=[\"checkout-api\"],\n        changed_paths=[\"services/checkout/src/refunds.ts\"],\n    )\n\n    context = graph.build_context(request)\n    print(json.dumps(context, indent=2))\n\nif __name__ == \"__main__\":\n    main()\n```\n\n`architecture_policies.json`\n\n```\n[\n  {\n    \"id\": \"outbox-for-external-events\",\n    \"text\": \"External events must be published through the transactional outbox.\",\n    \"applies_to\": [\"checkout-api\"],\n    \"status\": \"active\",\n    \"source\": \"docs/architecture/adr-014.md\"\n  },\n  {\n    \"id\": \"no-direct-ledger-access\",\n    \"text\": \"checkout-api must not call payment-ledger directly.\",\n    \"applies_to\": [\"checkout-api\"],\n    \"status\": \"active\",\n    \"source\": \"architecture/policies/boundaries.json\"\n  }\n]\n```\n\nCreate the expected directory structure:\n\n```\nmkdir -p services/checkout/src\ncat > services/checkout/src/refunds.ts <<'EOF'\nexport function createRefund() {\n  return { status: \"pending\" };\n}\nEOF\n```\n\nThen execute:\n\n```\npython architecture_graph.py\n```\n\nExpected output will include the two active policies and the relevant checkout module:\n\n```\n{\n  \"task\": \"Add a refund webhook\",\n  \"architecture\": [\n    {\n      \"fact\": \"checkout-api must not call payment-ledger directly.\",\n      \"source\": \"architecture/policies/boundaries.json\",\n      \"status\": \"active\"\n    },\n    {\n      \"fact\": \"External events must be published through the transactional outbox.\",\n      \"source\": \"docs/architecture/adr-014.md\",\n      \"status\": \"active\"\n    }\n  ],\n  \"relevant_code\": [\n    {\n      \"path\": \"services/checkout/src/refunds.ts\",\n      \"reason\": \"Explicitly included by the task\"\n    }\n  ],\n  \"warnings\": []\n}\n```\n\nThe example demonstrates the essential pattern: **resolve scope, traverse a bounded neighborhood, filter by status, and return a small auditable context packet**.\n\nA framework-neutral integration looks like this:\n\n``` python\nfrom pathlib import Path\nfrom architecture_graph import ArchitectureGraph, ContextRequest\n\ndef build_agent_prompt(task: str, components: list[str]) -> str:\n    graph = ArchitectureGraph()\n    graph.load_repository(Path.cwd())\n    graph.load_policies(Path.cwd() / \"architecture_policies.json\")\n\n    context = graph.build_context(\n        ContextRequest(task=task, components=components, changed_paths=[])\n    )\n\n    return f\"\"\"\nImplement the task while obeying the architecture constraints below.\n\nTASK:\n{task}\n\nARCHITECTURE CONTEXT:\n{json.dumps(context, indent=2)}\n\nIf a required fact is missing, inspect the referenced implementation or ask for\nclarification. Do not invent a new architectural pattern.\n\"\"\n```\n\nIn a real agent runtime, the same packet should be produced before the model is allowed to call edit tools.\n\nA stale knowledge graph is dangerous. If a policy was retired but remains in the graph, agents will preserve obsolete architecture. If a dependency is missing, agents will invent one.\n\nStore provenance and confidence on every edge. An inferred dependency from an import statement is useful, but it should not outrank an explicit ownership boundary.\n\nUse static analysis for imports, exposed interfaces, database access, and dependency declarations. These are mechanically verifiable and should not depend on an LLM guess.\n\nUse language models for softer extraction—intent, rationale, ownership ambiguity—but require validation before treating the result as authoritative.\n\nNever delete the history of a decision. Mark the old decision as superseded and link it to the new one:\n\n```\n{\n  \"from\": \"decision:adr-014\",\n  \"type\": \"SUPERSEDES\",\n  \"to\": \"decision:adr-031\",\n  \"properties\": {\n    \"effective_from\": \"2025-06-01\",\n    \"source\": \"docs/architecture/adr-031.md\"\n  }\n}\n```\n\nRun periodic checks that compare graph facts with code:\n\nSurface drift as an explicit queue rather than silently rewriting the graph. Human review is valuable for architectural meaning, even if it is not valuable for every file-level fact.\n\nA common mistake is to make the graph authoritative for everything. That creates a second codebase with a second set of bugs.\n\nUse this authority model:\n\n| Information | Source of truth | \n|---|---|\n| Business behavior | Source code and tests | \n| API schemas | Versioned schema files | \n| Architecture decisions | ADRs and accepted proposals | \n| Ownership | Ownership registry or service catalog | \n| Dependency relationships | Static analysis and deployment metadata | \n| Graph | Derived index linking the above | \n\nThe graph should point to authoritative sources, not compete with them.\n\nA graph-backed agent fleet can become another expensive platform. The key is to retrieve narrowly and cache aggressively.\n\nCache context packets using a key derived from:\n\n```\ncomponent scope + graph revision + task archetype + policy revision\n```\n\nIf the graph has not changed and the task maps to a known archetype, reuse the packet. Do not cache model reasoning itself unless your framework supports safe, versioned reuse.\n\nRetrieval should be fast and cheap. Graph traversal, metadata filtering, and code lookup should not require a large model call. Use the model for semantic interpretation only where deterministic matching is insufficient.\n\nA practical stack often combines:\n\nEach source has a different strength. The graph is particularly valuable for **joining** results that other retrieval methods return independently.\n\nSet hard limits for:\n\nA useful default is a small architecture packet, a handful of focused code regions, and explicit uncertainty instead of exhaustive context.\n\nTypical agent metrics—tests passed, tickets closed, lines changed—do not reveal whether the fleet is becoming less coherent. Add metrics such as:\n\nThese metrics tell you whether the memory layer is actually working.\n\nA practical sequence is:\n\nDo not begin by trying to model every architectural concept in your company. Begin with the rules agents most often violate.\n\nA vector database is useful for finding semantically similar code and documents, but it does not directly answer relationship questions such as “Which consumers are affected if this event changes?” or “Which components are allowed to depend on this package?” That is where a graph adds value. A hybrid system is usually best: vectors for semantic discovery, a graph for relationships and provenance, and deterministic analysis for hard dependencies.\n\nThey should share a consistent view, but not necessarily mutate it freely. Read access can come from a shared graph revision, while updates should pass through validation and merge workflows. Otherwise, one agent can record an unapproved architectural decision and immediately contaminate the context of every other agent.\n\nTreat graph entries as derived, versioned facts with explicit sources and confidence. Generate hard facts from code and schemas, record decisions from approved ADRs, and run reconciliation jobs that detect divergence. Most importantly, make agents cite the graph facts they used so reviewers can immediately verify whether the context was correct.\n\nNo. A knowledge graph reduces avoidable violations and makes architectural knowledge machine-accessible; it does not replace human judgment. The strongest setup uses the graph to narrow context, deterministic checks to catch violations, and humans to approve genuinely new architectural choices.", "url": "https://wpnews.pro/news/running-a-fleet-of-ai-coding-agents-stop-context-reset-and-wire-in-a-knowledge", "canonical_source": "https://dev.to/tamizuddin/running-a-fleet-of-ai-coding-agents-stop-context-reset-and-wire-in-a-knowledge-graph-1bh", "published_at": "2026-11-22 00:07:35+00:00", "updated_at": "2026-11-22 00:11:47.373123+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "large-language-models", "ai-safety"], "entities": ["tamiz.pro"], "also_reported_by": [], "takeaway": "Give each coding agent a scoped query against a versioned architecture knowledge graph of decisions, dependencies and boundaries instead of a fresh context window plus 'read the docs', so parallel agents retrieve the same constraints before planning.", "recommendation": {"advice": "Before scaling to parallel coding agents, model architectural decisions and boundaries as a versioned, auditable graph and have each agent query only the slice relevant to its ticket.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/running-a-fleet-of-ai-coding-agents-stop-context-reset-and-wire-in-a-knowledge", "markdown": "https://wpnews.pro/news/running-a-fleet-of-ai-coding-agents-stop-context-reset-and-wire-in-a-knowledge.md", "text": "https://wpnews.pro/news/running-a-fleet-of-ai-coding-agents-stop-context-reset-and-wire-in-a-knowledge.txt", "jsonld": "https://wpnews.pro/news/running-a-fleet-of-ai-coding-agents-stop-context-reset-and-wire-in-a-knowledge.jsonld"}}