Build an AI-Powered Software Factory, Not a Chat Habit

Build an AI-Powered Software Factory, Not a Chat Habit

AI can write a function in seconds and still waste an afternoon: repeating checks, carrying irrelevant context and asking a powerful model to do routine work. I see the gap between a useful coding assistant and productive engineering as a systems problem, not a model-selection problem.

For an engineering team, the important decision is not simply which assistant to adopt. It is which parts of software delivery are ready to become managed agent workflows, and what controls will make those workflows dependable and affordable.

Move from chat sessions to a software factory

A coding assistant usually waits for a person to ask, review and ask again. A software factory connects specialised agents to repeatable work across the development lifecycle. An agent might prepare a change and open a pull request; another could review it, investigate a failing build or run end-to-end and visual tests. Further workflows could help debug production issues, triage on-call alerts or handle routine maintenance and refactoring.

That does not mean handing over the whole engineering organisation. It means designing bounded jobs with clear inputs, permissions, checks and escalation points. A change-making agent should work in a controlled environment, run relevant tests and leave a reviewable result. An alert-triage agent should gather evidence and recommend action, while a person retains responsibility for decisions with operational risk.

As control over an agent’s environment improves, so does the ability to tune cost, quality and model choice. Ad-hoc chat makes that difficult: each session can have different context, tools and expectations. Managed, specialised agents make behaviour easier to evaluate and improve.

Reduce waste without suppressing useful adoption

The cost equation is simple: total AI spend = users × sessions per user × turns per session × requests per turn × tokens per request × price per token. I want the first two factors—users and sessions per user—to grow when the work is useful. The sustainable savings come from removing wasted work inside each session, not discouraging engineers from using AI.

Choose the model for the task

Benchmark models against real engineering tasks from your own workflow, not a generic demo. Compare whether the result is correct, how much review it needs, how reliably it uses tools and what it costs to complete the job. Keep capable models for work that needs planning or evaluation; use cheaper models for well-defined subagent tasks, such as extracting fields or classifying a known kind of failure. Recheck the choices when tasks or models change.

Keep context lean

Long conversations accumulate old decisions, repeated logs and details that no longer matter. Compact them automatically into a useful working summary, preserving decisions, constraints and unresolved questions. Start with moderate reasoning effort rather than maximum effort by default. Increase it where evaluation shows that the task benefits; otherwise, extra deliberation may add cost without improving the result.

Make prompt caching match real use

Interactive sessions often pause while an engineer reads a diff, runs a test or joins a meeting. If cached prompt material expires during ordinary pauses, the next turn may need to process it again. Set cache lifetime to match observed session patterns: longer for interactive work and shorter for quick subagent tasks. Check cache hits and misses against actual usage rather than assuming a single setting suits every workflow.

Load tools when they are needed

Every tool definition placed in context adds material before the agent has even received its task. Avoid loading every integration up front. Discover tools as needed, provide only the relevant definitions and route integrations through a central gateway. A gateway gives the team a consistent place to manage access, observe calls and change integrations without distributing bespoke tool wiring across every agent.

Let scripts handle repetitive tool loops

For multi-step operations, use code mode: let the agent write or run a small script that submits a query, waits or polls, fetches the result and processes it. Return the useful answer, not every intermediate response to the model. Keep scripts reviewable, bounded and observable; a compact loop is helpful, while opaque automation that can run indefinitely is not.

Give agents useful context upfront

A connected map of services, owners, incidents, pull requests, architecture documents, deployments and datasets can help an agent find the relevant evidence quickly. Good context often matters more than a smarter model. Begin with reliable sources and clear links between them. Stale ownership or conflicting documentation can mislead an agent, so show provenance and make it possible to flag gaps rather than treating every retrieved answer as authoritative.

That's the job MindGraph is built for. It's our open-source, local-first memory package for AI agents, @localminds/mindgraph, and it's MIT licensed. It keeps a knowledge graph of architecture decisions, conventions and entities inside the repo, so an agent can pull a short summary and file hints before it starts searching the filesystem. You install it with npm, set up a .mindgraph/ store, and either call retrieve() from your own agent or connect it over MCP so tools such as Cursor and Claude check memory first.

Make cost and quality visible

Engineers need live cost for their work, with spending tiers and alerts that make unexpected use visible early. A bill alone does not explain what to change. Analyse sessions for specific sources of waste: an over-powered model on a routine task, bloated context, cache expiry during normal pauses or heavy start-up overhead. Pair each finding with a practical adjustment and then check whether the change affects quality.

Set safeguards around the workflow as well as the spend. Keep permissions narrow, record important actions, and decide when an agent must stop and ask for help. A limitation to recognise is that cost optimisation can make results worse if teams judge success only by lower token use. Human review, testing and clear rollback paths remain important, especially for production changes and incident response.

Start with an outcome, then improve the system

I would begin with a repetitive workflow that already has a clear definition of done. Use this action plan:

  1. Choose a bounded task. Pick work such as preparing a pull request summary, checking a known class of CI failure or gathering evidence for an alert. Avoid starting with a high-impact task that has no reliable review path.

  2. Record the current process. Note the inputs, tools, hand-offs, checks and failure cases. Establish what a good result looks like before introducing an agent.

  3. Build a managed workflow. Give the agent only the context and tools it needs. Set limits, preserve a human approval point where appropriate, and make its output easy to inspect.

  4. Evaluate and tune. Test against representative past tasks. Adjust model choice, context, caching or tool handling based on observed errors and waste, not intuition alone.

  5. Measure the outcome. Track cost per merged pull request, cost per code review or cost per alert triaged, alongside quality, revert rates and mean time to recovery. Expand only when results justify it.

Presence Digital helps teams design these systems, but the next step is practical and small: pick one repetitive engineering workflow and measure its cost per outcome before you automate it.

The future is not developers using AI tools in isolation; it is engineering teams running AI-powered software factories. That factory is built, not bought. Start with a workflow you can inspect, improve and trust.

// Share this post

Newsletter

New articles, in your inbox

One email when we publish. No digests and no product pitches. Unsubscribe any time. Privacy policy