Architecture complete

Agentic Repo

How we built a multi-agent system that lets engineering teams coordinate complex code work without introducing technical debt.

Visual preview of Agentic Repo

01

The Vibe Coding Dilemma: Productivity vs. Technical Debt

Single-LLM long-conversation systems have a fundamental problem: they don't maintain true understanding of your codebase. They see your repo as a flat text-matching problem.

Result: the model generates code that duplicates existing logic, skips central transaction wrappers, introduces hidden regressions, and doesn't generate test suites.

In small teams, this doesn't matter—you just rewrite the code and move on. But in larger teams maintaining complex systems, each unintended duplication of logic becomes technical debt that haunts you for years.

The question: How do you get the productivity of AI agents while protecting your codebase from unintended duplication?

The answer: Structured memory. Clear role separation. Specifications before code.

02

The Foundation: Codebase Knowledge Graph

Most developer tools rely on vector search (RAG) to retrieve context. While vector embeddings identify semantic similarity, they struggle with basic structural questions: Which module calls this function? Is this handler tested? Where does the frontend API call meet the backend router?

Agentic Repo solves this by maintaining a unified, three-tier Knowledge Graph powered by LadybugDB (an embedded, in-process columnar graph database) paired with an embedded `sqlite-vec` vector engine.

Layer 1: Structural AST (what your code actually does)

  • File → Contains → Class
  • Function → Calls → Function (detects duplication)
  • Function → Calls API → Route (bridges frontend/backend)
  • Function → Tested By → TestFile (detects test gaps)

Layer 2: Domain Model (what it means in your business)

  • Entity ("Order") → Enforces → BusinessRule ("Total > 0")
  • Feature ("Checkout") → Implements → Function

Layer 3: Feature Mapping (what features exist)

  • Feature → Implements → Multiple Functions
  • Feature → Dependencies → Other Features

Every relationship is deterministically navigable. It's not "best guess". It's structural truth about your codebase.

Agentic Repo codebase knowledge graph

03

Multi-Agent Architecture: Separation of Powers

Multi-agent systems can suffer from compounding errors. If three agents communicate in unconstrained chat loops, a small misunderstanding by the first can compound into major hallucinations down the line.

Agentic Repo eliminates this with artifact-driven coordination, not chat.

Each agent has a clear role:

Manager: Captures requirements, makes graph-grounded clarifications, writes specs, decomposes tasks.

Architect: Enforces system invariants, performs impact analysis, flags code duplications or test gaps.

Coder: Operates in an isolated Git worktree, modifying only assigned files. Runs local tests. Generates diffs.

Reviewer: Independently assesses diffs against the original spec and project conventions.

All agents communicate through immutable TaskCards stored in the graph. No chat. No "telephone game". Structured coordination.

04

Specifications vs. Conversational Chat

Conversational chat interfaces can be inefficient for complex multi-file engineering tasks:

  • No structural traceability: Decisions and constraints get buried in chat histories.
  • Context overload: Combining task planning, coding, debugging, and review in a single thread degrades reasoning performance.
  • No multi-developer visibility: Chat sessions are isolated to a single user.

Agentic Repo replaces this with a Spec-Driven Kanban State Machine:

Capture (Intent) → Clarify (Graph) → Specify (Spec Gate) → Plan (Tasks) → Execute (Worktree) → Review (Verify) → Done (Commit)

The Manager queries the graph to ask graph-grounded clarification questions:

"I found two distinct discount calculators (LegacyPricing vs. SubscriptionBilling). Which system should this change apply to?"

Once answered, the system compiles a formal Specification Card containing explicit modifications, untouched modules, and strict acceptance criteria. This specification serves as the contract governing downstream execution and automated review.

Agentic Repo spec-driven task conversation

05

Dynamic Model Routing: Cost vs. Capability

Relying exclusively on frontier cloud models for every minor code edit is neither cost-effective nor necessary. Conversely, relying solely on small local models for complex architectural planning leads to lower-quality outputs.

Agentic Repo incorporates a Dynamic Model Router that scores each sub-task across four technical dimensions:

Low Complexity (1-3): Docs, simple edits → Local/Small Models (Phi-4, Gemma 3)

Medium Complexity (4-6): Feature implementation → Workhorse Models (Qwen-Coder, Sonnet)

High Complexity (7-10): Architecture, security → Advanced Cloud APIs (Claude Opus, GPT-4o)

And to ensure local models operate reliably, I use constrained decoding. Rather than hoping a smaller model follows JSON-injected prompt instructions, the inference engine enforces the JSON schema at the token-generation level. This guarantees that tool calls, task cards, and code diffs parse correctly.

06

Traditional IDEs vs. Vibe Coding vs. Enterprise AI Engineering

The developer tools landscape is undergoing significant transition. Three categories compete:

Traditional IDEs: Manual interaction, LSP, basic autocomplete. Developer maintains full control. High manual overhead.

Vibe Coding Tools (Cursor, v0): Conversational chat, multi-file broad edits. Fast for prototypes. Low architectural awareness. Hard to verify.

Agentic Repo (Enterprise AI Engineering): Spec-driven Kanban, structured artifact generation. High architectural awareness. Automated verification gates. Complete audit trails.

The "production gap" is real. Vibe coding is effective for quick prototypes. But scaling an enterprise application requires architectural consistency, test coverage, and clear audit trails.

Agentic Repo bridges this gap. It provides the productivity advantages of autonomous agent workflows while enforcing the structural discipline, verification gates, and architectural governance required by professional engineering teams.

07

The Road Ahead: Continuous Architecture and Human-Agent Collaboration

Software development is moving toward a model where engineers increasingly act as system architects and specification designers, while autonomous agents handle implementation, verification, and maintenance.

As Agentic Repo evolves, my focus is expanding into several key areas:

1. Automated Continuous Architecture Refactoring: Actively monitoring the codebase graph to flag emerging circular dependencies and structural anti-patterns before they become legacy debt.

2. Dynamic Cross-Layer Synchronization: Automatically verifying that database schema updates, backend API signatures, and frontend UI components remain aligned across releases.

3. Collaborative Multi-Human Workspaces: Enabling engineering teams to collaborate alongside specialist agent pools within a shared, self-hosted knowledge environment.

By grounding AI agents in explicit repository memory, structured specifications, and verifiable governance, I can move beyond throwaway prototype generation toward sustainable, automated software engineering.

What I built

Architecture of Agentic Repo
Specialist agents share repository memory through a three-strata graph while the orchestrator controls routing and authority.

Related writing

The part of the work worth explaining.

Published articles and prepared topics documenting decisions, problems and lessons.

Article in preparation

Preventing duplicate code with a repository knowledge graph

Linking syntax, domain concepts and existing capabilities before generation.

Article in preparation

Permission boundaries for coding agents

A three-zone model for safe autonomous changes.

Article in preparation

Why reviewer agents need different context

Separating implementation context from architectural and quality review.