Architecture & AI patterns
How to structure a whole application, and how to build reliable systems around language models.
Architecture
Big-picture shapes for an application and its teams.
Structure a system around events: components announce what happened, and other components react, instead of calling each other directly.
Put the business logic at the centre with no dependencies on frameworks or databases; everything else plugs in through ports and adapters.
Organise an application into horizontal layers (presentation, business logic, data access) where each layer only talks to the one below it.
Build a system as small, independently deployable services, each owning one business capability and its own data, run by one team.
One deployable application split internally into modules by business capability, each with its own code, data and public interface.
AI systems
Proven shapes for products built on large language models.
Let a language model work in a loop: decide the next action, call a tool, look at the result, and repeat until the goal is reached.
One model call produces a draft, another evaluates it against clear criteria, and the draft is revised until it passes or a limit is reached.
Check what goes into and comes out of a language model with separate, independent rules, so unsafe input and bad output are stopped before they cause harm.
Break a task into fixed steps, each a focused model call whose output feeds the next, with ordinary code checking results in between.
Before asking a language model to answer, look up the most relevant passages from your own documents and give them to the model as context.