Architecting for AI means designing systems in which some behaviour is produced by machine learning models (today, mostly large language models) whose outputs are probabilistic, so that the system as a whole is still useful, safe, observable and affordable.

Start with the outcome

The first question isn’t “which model?” but “what problem are we solving, and how will we know it’s solved?” Be clear about the business value: which customer problem gets solved, which opportunity gets seized. Then ask whether the problem can tolerate a component that is sometimes wrong. Summarising, drafting, classifying, searching and extracting usually can, with the right checks. Calculating an invoice usually can’t, and doesn’t need to.

Don’t start with a model looking for a problem. Start with a problem, and a way to measure the answer.

AI and the mental model

The same mental model applies: start at the top and only drop down a level when you must.

Building your own foundation model is the clearest possible example of building a commodity. Your advantage is in your data and your workflow, not in the model weights.

Common architectures

From simplest to most complex, and we recommend you climb only as far as you need:

  1. Prompt and call: a well-designed prompt sent to a model, with the response validated before use.
  2. Retrieval-augmented generation (RAG): retrieve relevant content from your own data (via search or vector indexes) and include it in the prompt, so answers are grounded in your information and can cite sources.
  3. Tool use: the model can call functions you define (look up an order, query a database) and use the results in its answer.
  4. Agents: the model decides which tools to call, in what order, in a loop, to pursue a goal.
  5. Fine-tuning: adapting a model to your domain. This is useful in specific cases, but it’s often reached for before simpler options have been exhausted.
Climb only as far as you needPrompt& callRetrieval(RAG)TooluseAgentsFine-tuningsimplest: start heremore complexity, cost and risk
Each step up adds capability, but also complexity, cost and risk. Most problems are solved on the lower steps.

The new non-functional requirements

AI adds dimensions to the architectural profile that traditional systems didn’t have:

Evaluation is testing

Because model outputs vary, you can’t test AI features with exact assertions alone. Evaluations (“evals”) are the equivalent of a test suite:

Evals are fitness functions for AI behaviour. Without them, every prompt tweak is a guess and every model upgrade is a gamble.

Treat AI work as complex

New AI features usually sit in the complex domain: cause and effect only become clear in hindsight. Big up-front design doesn’t work well here. Spike quickly, measure with evals, put something real in front of users early, and be prepared to stop. In a portfolio of AI experiments, stopping the ones that aren’t working is a success, not a failure.

The model is the most replaceable part of an AI system. Design so you can swap it.

Keep model calls behind your own interface, keep prompts and evals in version control, and make the choice of model a configuration setting rather than an architectural commitment.