Writing

What I'm learning, made useful.

Notes on backend engineering, distributed systems, applied AI, and the decisions that make software last.

  1. Applied AI11 min read

    Agent Architecture: Should the Program or the Model Decide the Next Step

    The difference between Workflow, Autonomous, and Hybrid is not the framework but who decides the next step. This article covers when each pattern fits, how each one fails, and a selection method that starts from task conditions.

  2. Applied AI12 min read

    Making Agent Output Verifiable: Specs, Context, and Checks

    Three words separate one person writing code with AI from enterprise-grade delivery: reliable, efficient, sustainable. This piece covers spec-driven development, context engineering, verifiers, and Skill assets, and how the engineering center of gravity has moved from Prompt to Harness.

  3. Applied AI13 min read

    LLM Runtime: Which Layer Should Own Rate Limits, Retries, and Routing

    Once the second business, the second provider, and the second tenant show up, calling the SDK directly is no longer enough. This piece covers the responsibility boundary of an LLM Runtime, multi-model routing, reliability under high concurrency, and how to choose an observability approach.

  4. Applied AI10 min read

    Where the Cost of a Model Call Comes From, and Where It Can Go Wrong

    Token, Context, Prefill, Decode, and caching determine an Agent’s cost and latency; hallucination and Prompt Injection determine the floor of its risk. Without understanding these, none of the later architectural trade-offs has a basis.

  5. Applied AI8 min read

    Five Questions to Answer Before Putting Agents into Production

    Cost and risk, who holds control, how delivery is verified, which layer owns model calls, and how it is evaluated after launch: answer these in order before writing Agent code.

  6. Architecture7 min read

    Work Habits I Changed as My Scope Grew

    Over years on commerce, risk, and fintech platforms, I stopped measuring a good week by features shipped and started measuring decision quality, blast radius, and whether the team works without me.

  7. Distributed Systems9 min read

    Rebuilding a Real-Time Risk Platform: Decision Record

    After separating rule management, stream processing, and decision records, P99 decision latency fell from minutes to under a minute. The trade-offs, and which choices I would make again.

  8. RAG13 min read

    Local RAG Design: Store the Evidence First, Then Retrieve

    How mt_rag separates replayable evidence, rebuildable query views, verified graph paths, and bounded generation—and why current source still wins.

  9. RAG9 min read

    Why a Code Hit Is Not Yet an Answer

    Engineering retrieval has to bind results to a repository, a commit, and a symbol; a hit that is missing, stale, or from the wrong repository is only a locating lead.

  10. RAG10 min read

    Turning Retrieval Candidates into an Engineering Conclusion You Can Deliver

    Retrieval finds the entry point and the original source confirms the fact; the final answer must keep verified, inferred, and unknown apart.

  11. RAG11 min read

    One Question, Three Sources: How Far Code, Jira, and Confluence Can Each Answer It

    The hard part of cross-source retrieval is not finding more text; it is judging what the requirement, the design, and the current code can each prove.

  12. RAG9 min read

    When Local RAG Is Worth Calling, and When Reading the Source Is Faster

    Am I missing a fact, or an entry point? That one question decides whether to retrieve at all.

  13. Workflow23 min read

    How My AI Development Workflow Changed: From a Harness to Lightweight Prompts to Enterprise Agents

    First a self-built Harness to make up for what models could not do, then a cut down to lightweight Prompts and four gates after Codex 5.6, then the same principles applied to enterprise Agents. What each step removed and kept.

  14. Workflow12 min read

    Goal Routing: Deciding Permissions and Done Criteria by Request Type

    Routing is not about labeling a request. It first determines which side effects this request authorizes and what evidence counts as done.

  15. Workflow14 min read

    Patch Promotion: Writing Changes from an Isolated Environment Back Safely

    PatchBundleV1 packages candidate file states from an isolated environment into a verifiable artifact, which a trusted Host then writes in journaled steps, reads back, and seals with an immutable receipt.

  16. Workflow12 min read

    Loading Context on Demand: How It Works and What It Costs

    Using evidence priority, rebuildable handles, and freshness fingerprints to control the material each round of reasoning actually needs to see.

  17. Workflow12 min read

    The Stage Graph: Managing Task Stages with a Dependency Graph

    Using a verifiable DAG to express node dependencies, execution authority, completion barriers, failure propagation, and recovery boundaries.

  18. Workflow17 min read

    State, Events, and Artifacts: Recording Task Progress So It Can Be Resumed

    Using revision/CAS, lease fencing, causal event chains, and content hashes to turn recovery and auditing from model narration into a verifiable protocol.

  19. Workflow14 min read

    Verification and Readback: What Tests, CI, and Production Each Prove

    From local tests to production readback, every layer of evidence must be bound to an explicit scope of conclusion, and none can substitute for another.

  20. Workflow16 min read

    Multi-Agent Review: Splitting the Work, Isolating It, and Combining Results

    Controlling multi-Agent collaboration with risk-driven selection, immutable execution plans, isolated context, completion barriers, and evidence-backed reports.

  21. Workflow13 min read

    Write Grants and Isolated Workspaces: Limiting Which Files an Agent Can Change

    StageWriteGrantV1 compresses task permission into a one-time capability bound to a version, paths, operations, and an executor instance, enforced jointly by an isolated worktree and layer-by-layer readback.

  22. RAG9 min read

    Why the LLM Controller Is Allowed at Most Two Retrieval Rounds

    System Shadow starts from the original question; the LLM may rerank or request one supplementary retrieval, but it cannot override deterministic evidence checks or search without bound.

  23. RAG8 min read

    Why a Local Immutable CAS Holds the Evidence Foundation

    Vector stores and graph databases are rebuildable projections; the CAS stores raw data, IR, and the CPG, and a Manifest Generation references those immutable objects.

  24. RAG10 min read

    Balancing 70/30 Hybrid Retrieval and the Graph Anchor

    Vector, keyword, parent-child context, and verified graph paths are combined in layers so that similar content is never mistaken for proof of a call.

  25. RAG9 min read

    How Incremental Projection Lets Vector, Keyword, and Graph Evolve Independently

    Layered hashes, a delta planner, consumer cursors, and shadow projections together handle updates, failure recovery, and rollback.

  26. RAG9 min read

    Why Vector, Keyword, and Neo4j Use Different Stores

    Semantic similarity, exact identifiers, and relationship traversal are three different query problems; forcing them into one database sacrifices correctness and explainability.

  27. RAG9 min read

    Why DocumentIR, Issue IR, and CodeIR Have to Be Split

    Documents, tickets, and code have different structures; only with a typed IR in place first can you chunk correctly, build the graph, and keep traceable locations.

  28. Applied AI18 min read

    Four Safety Gates for Coding Agents: Which Actions Need Confirmation First

    Let the Agent handle routine work on its own; production, persistent data, cost, and irreversible actions need a stated risk and explicit confirmation first.

  29. Applied AI16 min read

    The Overall Architecture of an AI Development Harness

    A file-based control layer for an AI development workflow: how it records progress, recovers from interruptions, and limits write access.