I Built an AI Football Team That Doesn’t Want the Ball

What Divided United taught me about specialised agents, constrained decision-making and why smarter isn’t always better

I appear to have accidentally become Luke Klopp.

This wasn’t the objective.

I started playing with an agentic football simulation because it seemed like an entertaining way of exploring multi-agent AI. Five autonomous agents, each controlling a footballer, each receiving information about the state of a match and independently deciding what to do next.

Naturally, I approached this as any responsible technologist would.

I became absurdly competitive.

The result is Divided United, a team that has developed a rather peculiar footballing philosophy.

In four recent matches they’ve won:

7–1, 5–1, 6–1 and 4–0.

That’s not even mentioning the 5-0 above. Or the 10-3 shellacking administered to another team.

That’s 22 goals scored and three conceded.

They’ve done that while averaging roughly 32% possession.

In the last of those matches, Fort Knox Athletic had 77% of the football.

They didn’t manage a shot.

And that’s where this stopped being just an amusing football simulation for me.

Because underneath the ridiculous player names, questionable punditry and my Brazilian striker Promptinho apparently developing a Julio Geordio accent, there are some genuinely useful lessons about designing agentic systems.

Screenshot

The first mistake: trying to make every agent intelligent

My initial instinct was fairly predictable.

Give the agents rich instructions.

Tell them how I wanted the team to play.

Explain pressing, positioning, passing, shooting, covering teammates and reacting to different situations.

In other words, give each agent enough information to play football intelligently.

It sounds reasonable.

It wasn’t necessarily effective.

The more decisions an agent has available, the more reasoning it has to perform about which decision is appropriate right now.

And football in this environment moves quickly.

An agent doesn’t need to construct a beautiful theory of football.

It needs to make the right decision for the current state before that state disappears.

That led me towards something much more interesting:

decision compression.

Instead of asking:

What’s the best footballing action in this situation?

I increasingly designed each role so that the question became:

Which of these two or three actions applies to the state I’m currently in?

That distinction changed the team.

Five agents. Five different jobs.

Divided United nominally play a 1–1–2 formation.

There’s a goalkeeper, defender, midfielder and two forwards.

But that’s not really the architecture.

The architecture is five specialised agents with deliberately different operating envelopes.

GorAIm — Goalkeeper

GorAIm has perhaps the least glamorous prompt.

He protects the goal.

He tracks the ball laterally.

He attacks reachable loose balls inside his penalty area.

He distributes quickly when he gets possession.

And, crucially:

he is forbidden from leaving the penalty area.

That last instruction came from experience.

Giving an autonomous goalkeeper the freedom to decide whether joining the action might be useful is an excellent way to discover that artificial intelligence can reproduce human overconfidence remarkably accurately.

So I removed the decision.

GorAIm doesn’t need to determine whether leaving his area is tactically sensible.

He simply can’t.

That’s bounded autonomy.

And sometimes the best way of making an agent more reliable isn’t making it smarter.

It’s reducing the number of stupid things it’s permitted to do.

AImoruso — Defender

AImoruso is where things get more entertaining.

His instructions are brutally simple.

Stay in our half.

If the opponent has the ball nearby, pressure them.

If the ball is loose in our half, attack it.

And if AImoruso gets possession:

SHOOT.

Immediately.

Don’t dribble.

Don’t recycle possession.

Don’t search for an elegant progressive pass.

Shoot.

This sounds ridiculous.

It has also resulted in our defender repeatedly scoring goals.

That’s because the instruction isn’t really about shooting from distance.

It’s about recognising the state in which AImoruso tends to gain possession.

He’s often just won the ball while the opposition is transitioning into attack.

At that instant their defensive organisation is poor.

Giving him another three decisions before exploiting that state can actually make the situation worse.

So I removed them.

Recovery → shot.

AImoruso has become one of the team’s most effective agents partly because his world is incredibly simple.

V Prompthurst — the state machine

The midfielder takes this idea even further.

When V Prompthurst gets the ball, the decision tree is roughly:

Am I within 30 units of goal?

Yes:

SHOOT.

No:

PASS FORWARD TO PROMPTINHO.

If Promptinho isn’t available:

SHOOT.

That’s not much of a football brain.

It’s practically an if statement.

And that’s the point.

Prompthurst isn’t being asked to orchestrate midfield.

He’s a transition agent.

His purpose is to transform one useful game state into another with the minimum possible number of intermediate decisions.

He’s scored a hat-trick in one match and another two in our latest 4–0 win.

It turns out an if statement can have a surprisingly good left foot.

Promptinho — the focal agent

Promptinho has more freedom.

He stays primarily in the opposition half, looks for useful central space and acts as the team’s principal forward outlet.

When a teammate gains possession, Promptinho tries to become immediately available for the forward ball.

But I’ve still deliberately constrained what happens when he receives it.

Close enough to goal?

Shoot immediately.

Further away?

Find the forward in better space.

No unnecessary dribbling.

No repositioning before shooting.

No additional action merely because another action exists.

In four recent matches, by my own observation rather than the simulation’s occasionally creative scorer attribution, Promptinho has scored 12 goals.

Five in one game.

One in the next.

Five in another.

Then one more.

His tactical analysis of this run is probably best summarised as:

“Ah, you know, ball come, Promptinho shoot-a the ball. Sometimes she go in-a the goal. Is fantastic.”

There is a serious point hiding underneath the stupidity.

Promptinho is given more reasoning where reasoning creates value.

But once the system reaches a state where the optimal intent is obvious, I remove the reasoning again.

Super AIlly — reason about space, not the ball

Super AIlly is different again.

He’s the agent I’m asking to perform more sophisticated spatial reasoning.

Promptinho wants to become available for the ball.

AIlly wants to find the space the ball should eventually enter.

When Promptinho drops towards possession, AIlly should attack behind him.

When defenders move towards the ball, AIlly should attack the resulting gap.

And one particularly useful instruction tells him not to stand next to the goalkeeper waiting for a pass.

If he’s made his run and ends up too close to goal without possession, he should retreat into useful space and create another opportunity to attack it.

In football terms, Promptinho is the focal striker.

AIlly is the runner.

Or, put another way:

Promptinho wants the ball. AIlly wants the space.

That distinction matters enormously.

My actual football philosophy

All of this eventually produced a philosophy that I can reduce to two rules.

1. Control the space

If you control the useful spaces, it doesn’t particularly matter how much possession the opposition has.

They can pass the ball around.

They can register 65%, 70%, even 77% possession.

The question is:

What can they actually do with it?

Against Fort Knox, the answer was literally nothing.

They had 77% possession and didn’t produce a shot.

2. Use the ball effectively when you have it

When we regain possession, I don’t want possession for possession’s sake.

If you can score:

score.

If you can’t:

give the ball to somebody who can.

That’s why Divided United can occasionally finish matches with virtually no passing.

I’m not anti-passing.

I’m anti-passing without purpose.

A pass is valuable when it creates a better state.

Possession itself isn’t the objective.

The interesting bit: local intelligence creates team behaviour

This is probably the lesson I’ve found most interesting.

None of these agents understands the entire tactical system.

GorAIm doesn’t need to understand why Super AIlly is making a run.

AImoruso doesn’t need to reason about Promptinho’s positioning before deciding what happens when he wins the ball.

Prompthurst doesn’t need a representation of the entire formation.

Each agent has:

a role, an operating area, a small number of priorities and clear transition rules.

Yet collectively they produce recognisable team behaviour.

That’s emergence — although I use that word cautiously because there’s nothing mystical happening.

The behaviour emerges because the agents’ local rules are designed to complement one another.

Promptinho dropping creates space.

AIlly attacks it.

Prompthurst knows where his forward outlet should be.

AImoruso attempts to win possession before the opposition can establish an attack.

GorAIm remains behind all of them rather than suddenly deciding he’s Franz Beckenbauer.

Nobody has been told:

Execute this exact five-agent transition.

But the transition happens because their individual operating rules intersect.

That’s much closer to how I think useful agentic architectures should work.

Different jobs don’t necessarily need the same model

Another experiment was model selection.

It is tempting with an agentic system to put your most capable model everywhere.

Why wouldn’t you want every agent to be as intelligent as possible?

Because intelligence has cost.

And latency.

And sometimes additional reasoning isn’t useful.

The current team deliberately uses different models for different roles.

The tightly constrained defender and midfielder can use smaller, faster models.

Agents performing more nuanced spatial tasks can justify additional capability.

The question isn’t:

What’s the best model?

It’s:

What’s the least expensive and fastest model that can reliably perform this particular job?

That’s a very different engineering question.

And one I’d argue becomes increasingly important as agentic systems scale.

The scoreboard became my observability layer

Another thing changed as I iterated.

I stopped treating a win as sufficient evidence that something worked.

The environment exposes useful behavioural telemetry:

possession
shots
shots on target
agent latency
command distribution
success rate

That lets me inspect how a result happened.

A 5–1 victory in which every agent abandons position and charges towards the ball isn’t necessarily evidence of a good system.

It may simply mean I got lucky.

Likewise, a high PRESS count isn’t automatically good pressing.

What matters is the resulting state.

How many useful shots did the opposition create?

Did my agents retain their positional responsibilities?

Did the transition still work?

Were particular agents unusually slow?

The football match effectively became an observability environment for the agents.

And that produced a familiar engineering loop:

Observe → identify undesirable behaviour → constrain or clarify → test again → compare telemetry.

Not:

Write enormous prompt → hope.

I also discovered the observability can lie

There is a particularly entertaining example.

The generated match reports occasionally attribute goals to the wrong player.

At one point GorAIm was credited with scoring.

This was surprising.

Mostly because his instructions explicitly tell him:

DO NOT SHOOT.

Reviewing the match showed Super AIlly had actually scored.

In another game the report credited Prompthurst with five goals that I’d watched Promptinho score.

That’s amusing in a football simulation.

In a production agentic system, it’s a serious lesson.

Observability isn’t useful merely because telemetry exists.

You need confidence that identity, events and causal relationships are being propagated correctly through the system.

Otherwise you can have an extremely sophisticated dashboard giving you an extremely detailed explanation of something that didn’t happen.

That’s perhaps the most enterprise lesson Divided United have taught me.

So where did I actually exploit the system?

Not through a loophole.

I exploited its economics of decision-making.

The environment rewards successful actions.

It doesn’t award additional points because an agent considered six alternatives first.

So I progressively removed unnecessary decisions.

I constrained where agents could operate.

I gave different agents different objectives.

I separated ball-seeking behaviour from space-seeking behaviour.

I made transitions explicit.

I gave numeric shooting thresholds instead of vague instructions such as “shoot when there’s a good opportunity”.

And I stopped trying to make five individually brilliant footballers.

Instead, I tried to create five agents that were individually predictable and collectively effective.

That distinction matters.

Smarter agents aren’t necessarily better agents

If there’s one broader lesson I’d take from Divided United, it’s this.

We talk about agentic AI as though autonomy is inherently desirable.

Give the model tools.

Give it context.

Give it memory.

Give it freedom to reason.

Let it determine what happens next.

Sometimes that’s exactly what’s required.

But autonomy has a cost.

Every additional option increases the decision space.

Every additional responsibility creates another opportunity for conflicting objectives.

Every additional reasoning step introduces latency and another chance to make the wrong decision.

Sometimes good agent architecture means giving an intelligent model less to think about.

GorAIm doesn’t need to understand the whole match.

AImoruso doesn’t need to become a playmaker.

Prompthurst doesn’t need 15 passing options.

Promptinho doesn’t need to contemplate the meaning of life when he’s 20 units from goal.

They need to recognise the state they’re responsible for and act decisively.

Control the space

Which brings me back to Luke Klopp.

My pretend football philosophy turns out to be a reasonably good description of my emerging view of agentic systems too.

Control the space.

Define where an agent operates.

Define what it’s responsible for.

Define what it must not do.

Reduce ambiguity.

Then:

when an opportunity enters that space, act effectively.

Don’t add another agent call merely because you can.

Don’t add another reasoning loop merely because it looks sophisticated.

Don’t orchestrate seven steps when two will achieve the objective.

And don’t optimise a proxy metric — whether that’s possession in football or token-heavy “intelligence” in an AI system — when it isn’t the thing you’re actually trying to achieve.

Divided United currently average roughly a third of the football.

They’ve just scored 22 goals in four games.

Perhaps Promptinho understands agentic architecture better than I thought.

“Ball come. Promptinho shoot.”

Sometimes the simplest agent really does have the right idea.

Why My AI Agent Stopped Calling the LLM

I built an AI-powered fantasy football product, discovered it was repeatedly paying an LLM to reconsider facts that had not changed, and eventually arrived at the slightly awkward conclusion that one of the best ways to improve an AI system was to use considerably less AI.

Originally published on Medium.
This is an expanded version of an article originally published on my Medium account. Read the original on Medium →


I have been building a fantasy football application as a personal project, which is the sort of sentence that sounds perfectly harmless until you have been a developer for long enough to know that “personal project” usually means “an unpaid second job involving a database, several scheduled processes, an increasingly elaborate deployment pipeline and at least one dashboard that absolutely nobody asked for.”

Like an entirely normal middle-aged man, rather than simply watching the Chicago Bears disappoint me on a Sunday and getting on with my life, I decided what I really needed was a software platform capable of analysing that disappointment in considerably more detail, preferably with enough data, charts and automated recommendations to make the disappointment feel scientifically rigorous.

The application pulls together player data, fantasy rosters, transactions, injuries, news, values, schedules and other information from several sources, stores and processes that data locally, and then uses an LLM to reason about what has changed and suggest things I might actually want to do about it.

Trade this player.

Pick up that player.

Keep an eye on somebody else.

Perhaps stop drafting Bears players merely because I like the Bears.

The last requirement remains stubbornly resistant to automation.

The first version worked surprisingly well.

The problem was that it worked in roughly the same way as employing an extremely expensive consultant and phoning them every five minutes to ask whether anything had happened, despite the fact that you were standing in the same room and could plainly see that nobody had moved.

Most of the time the answer was:

No.

And I was paying for the privilege of finding out.

That turned out to be a useful lesson, because it forced me to stop thinking about the LLM as the application and start treating it as what it really was: one comparatively expensive, comparatively slow and deliberately non-deterministic component inside a much larger software system.

The first architecture was obvious

The original architecture followed the pattern that I suspect quite a lot of AI prototypes follow:

Get data → build prompt → call model → display answer.

There is nothing particularly wrong with that.

In fact, I would still argue that it is often exactly the right way to build the first version of something, because the purpose of a prototype is to determine whether the idea produces anything useful before you spend three weeks building an abstraction layer, an event bus and seventeen interfaces around something users ultimately do not want.

The problem comes when the prototype works.

Because working software has an unfortunate tendency to become production software.

That is how systems acquire a “temporary” database that survives for five years, a “quick script” that becomes business-critical and a function called processEverything() which eventually requires its own incident response procedure.

My fantasy application runs automatically, which means it periodically collects the latest information about the same players, rosters and leagues.

But American football has the inconvenient characteristic of not completely reinventing itself every few hours.

At 6am, a player’s situation might be exactly the same as it was the previous evening.

The roster probably has not changed.

There may be no new transaction.

There may be no injury.

There may be no meaningful news.

The waiver wire may be identical.

There may not, in fact, be a single new piece of information capable of changing the previous recommendation.

Yet the application could happily collect everything again, construct another large prompt and ask an LLM to reconsider the entire universe.

And because an LLM is not a deterministic function, it would usually oblige.

Perhaps yesterday I should “strongly consider” trading a player.

Today I might be advised to “seriously explore” trading him.

Tomorrow I might be told that moving him would be “a prudent roster-management strategy.”

Three different sentences.

One recommendation.

Several API calls.

At some point I realised I had essentially built a thesaurus with a billing account.

That bothered me, and not simply because of the token cost.

Architecturally, it was stupid.

An LLM call is not a normal function call

This distinction became increasingly important as I worked on the system.

Developers are accustomed to calling functions constantly, and we do not normally stop before invoking:

calculatePlayerValue()

and have a small architectural meeting about whether we can afford it.

Assuming the function is reasonably implemented, it is cheap, fast and deterministic enough that calling it twice is unlikely to trouble either the CFO or the planet.

An LLM call has a rather different set of characteristics.

There is an obvious financial cost, because somebody is charging for input tokens, output tokens, cached tokens, model tier or some combination thereof.

There is latency, because the request leaves your process and goes to an external inference service.

There are rate limits, which become rather more interesting when an application scales beyond the three people you originally expected to use it.

There is an additional availability dependency, because your product is now relying on another provider remaining responsive.

There is model drift, because the service behind your API endpoint can change.

And then there is the particularly interesting characteristic:

non-determinism.

Call a conventional function twice with identical inputs and, unless something has gone badly wrong, you expect identical outputs.

Ask an LLM the same question twice and you can receive two different, perfectly defensible answers.

That variability is part of what makes these models useful; I am not criticising it.

But if the underlying state has not changed, repeatedly invoking a probabilistic reasoning system can introduce variation into a product where no variation is actually warranted.

Your recommendation changes.

The user assumes something happened.

Nothing happened.

The model just fancied a different adjective.

That led me to what became the most important architectural question in the project.

Instead of asking:

“What should the AI think about this?”

I started asking:

“Has anything happened that requires the AI to think at all?”

That sounds like a small change.

It was not.

The agent became a change-detection system

Once I started thinking about the problem that way, the architecture shifted.

The LLM moved towards the end of the pipeline rather than sitting in the middle of everything.

The flow became:

Collect → Normalise → Compare → Decide → Analyse

rather than:

Collect → Analyse everything

That Decide stage is probably the most important component in the entire application.

The collection layer retrieves information from the various upstream sources.

The normalisation layer converts those sources into a consistent internal representation.

The state layer records the information the system currently believes to be true.

The comparison layer establishes what has changed since the previous successful analysis.

The decision layer determines whether any of those changes are capable of affecting an existing recommendation.

Only then does the application construct a prompt and invoke the LLM.

The clever bit, therefore, is increasingly not the model call.

It is everything that prevents the model call.

And this is not particularly exotic AI technology.

It is persistence.

Canonicalisation.

Hashing.

Comparison.

Filtering.

Event detection.

Cache invalidation.

Dependency tracking.

The sort of engineering that does not usually feature heavily in AI product demonstrations because “look at this beautifully designed state fingerprint” does not produce quite the same conference reaction as a chatbot generating a limerick about the CEO.

It is nevertheless where a significant amount of the value lives.

Because:

The cheapest LLM call is the one you never make.

A concrete example: league analysis

Take the league analysis itself.

The original implementation could analyse a league every time the scheduled process ran.

Imagine that at 6am the system sees this simplified state:

league_id: 12345
roster_version: 84
player_news_version: 317
injury_version: 102
transaction_version: 46

It generates its recommendations and stores them.

At midday the collector runs again.

There are newer API retrieval timestamps, because naturally there are, but after normalisation the meaningful state is still:

league_id: 12345
roster_version: 84
player_news_version: 317
injury_version: 102
transaction_version: 46

What exactly am I hoping the LLM will discover?

The answer is nothing.

So now it does nothing.

The existing analysis remains valid.

If, however, injury_version becomes 103 because a starting running back has been ruled out, that is potentially significant.

The system can invalidate the affected analysis, identify which leagues contain that player, construct the appropriate context and ask the model to reconsider the relevant recommendations.

This changes the semantics of the model invocation.

The question is no longer:

“Please analyse my fantasy team.”

It is closer to:

“This was the previous state and recommendation. This meaningful event has occurred. Given the new state, does the recommendation need to change?”

That is a much better question.

It is also a much smaller one.

State fingerprints became surprisingly useful

There are several ways to implement the change detection itself.

One straightforward technique is to build a canonical representation of the relevant state.

Take the fields that actually matter.

Sort collections consistently.

Remove volatile metadata.

Serialise the resulting structure deterministically.

Hash it.

You now have a state fingerprint.

Conceptually:

state_fingerprint =
    hash(
        roster +
        injuries +
        relevant_news +
        transactions +
        player_values
    )

If the fingerprint has not changed since the analysis was generated, there is no obvious reason to repeat the analysis.

Of course, production systems become more nuanced than that.

Different changes invalidate different pieces of analysis.

A roster transaction might affect the whole team.

An injury might affect one player and their likely replacements.

A new article might affect nothing at all.

A change in trade value might matter only when it crosses some threshold.

That means a single giant hash eventually becomes less useful than explicit dependency tracking, but the underlying principle remains the same:

Store enough information about the state that produced an answer to determine whether that answer is still valid.

That changed the way I thought about caching.

The cache became part of the intelligence

Initially I thought about caching in the conventional sense.

Make an expensive request.

Store the response.

Give it a TTL.

Reuse it until the TTL expires.

That works, but it is a fairly crude approach to this particular problem because the passage of time is not necessarily what makes an analysis stale.

Changes in the underlying facts make it stale.

Suppose I analyse my roster at 10am.

If absolutely nothing relevant happens for the next 24 hours, why should the recommendation automatically expire at 11am merely because I chose a one-hour cache duration?

Conversely, if my starting quarterback is unexpectedly ruled out at 10:03am, I do not particularly want to wait until 11am because Redis says the previous answer still has 57 minutes left to live.

The better cache key is therefore not simply:

time

but:

state.

The important artefact isn’t:

“Here is what the model said last time.”

It is:

“Here is what the world looked like when the model said it.”

That makes caching part of the reasoning architecture rather than simply a performance optimisation.

New data is not the same thing as new information

This became another surprisingly important distinction.

APIs produce new data all the time.

Timestamps change.

Records get refreshed.

News feeds return the same stories again.

Providers correct formatting.

A player’s display name changes.

An article receives an updated timestamp because somebody fixed a typo.

Technically, something changed.

Semantically, nothing happened.

If every raw data mutation invalidates an analysis, the application will repeatedly wake the model up to tell it that the universe remains essentially identical.

That is not intelligence.

That is a very expensive heartbeat monitor.

The system therefore needs to distinguish between a raw delta and a semantic delta.

A player going from:

healthy → questionable

is potentially meaningful.

A player going from:

Luke McCaffrey → Luke McCaffrey 

because somebody added whitespace is not.

A new article saying that a player attended a charity event is new data.

A new article saying that he left training wearing a walking boot is new information.

The interesting engineering problem is therefore not simply change detection.

It is meaningful change detection.

Don’t hire an LLM to decide whether to hire an LLM

There is an obvious temptation here.

We have a model capable of interpreting language.

Why not give every new item to the LLM and ask whether it is important?

Sometimes that is absolutely appropriate.

But if you do it indiscriminately, you have created a rather beautiful circular architecture in which you call the model to determine whether you should call the model.

You have, in effect, hired a consultant to decide whether you need to hire a consultant.

So I push as much of that classification as possible into deterministic code.

Known injury-state transitions can be rules.

Roster transactions are structured events.

Value changes can use thresholds.

Duplicate news can be identified through IDs, canonical URLs, hashes or similarity mechanisms.

Known irrelevant metadata can be excluded before comparison.

Only ambiguous cases need probabilistic interpretation.

That is an important general principle I have taken away from the project:

Use deterministic computation to reduce the problem before asking probabilistic computation to reason about what remains.

Then I made the prompts smaller

Once I had reduced the number of calls, the next obvious question was whether the calls I was still making contained far too much information.

The answer was yes.

Early LLM applications have a tendency to behave like nervous junior developers preparing their first production handover:

“Here is absolutely everything I know, just in case.”

Full player objects.

Complete roster dumps.

Repeated news articles.

Historical information.

Provider metadata.

Previous analysis.

Fields nobody remembers adding.

Fields I was too frightened to remove because perhaps the model had secretly become emotionally attached to them.

All of this consumes tokens, but token cost is only part of the problem.

More context does not automatically mean better context.

Irrelevant information competes with relevant information.

Duplicated information can distort importance.

Old information can conflict with new information.

Large contexts make failures harder to understand.

So prompt construction became a deliberate pipeline of its own.

Select the relevant entities.

Resolve identifiers.

Filter stale information.

Deduplicate news.

Include only the state necessary for the current decision.

Include the previous recommendation when revision is required.

Represent uncertainty explicitly.

Ask a specific question.

Request a constrained output.

In other words, the model stopped receiving the database and started receiving a purpose-built data product.

Prompt engineering became data engineering

This was probably one of the more interesting conclusions.

People talk a lot about prompt engineering, and there is obviously skill involved in specifying tasks clearly, but in a real application the quality of the prompt is heavily determined before anybody writes the instruction.

The difficult questions are things like:

Which player does this record refer to?

How old is this information?

Which source produced it?

Has it already been processed?

Does it supersede another fact?

Is this the current roster state?

Was the previous recommendation generated before or after this event?

Those are data engineering questions.

A prompt is ultimately the presentation layer over those decisions.

Stable identifiers matter.

Timestamps matter.

Provenance matters.

Schemas matter.

Freshness matters.

Ordering matters.

The prompt is not your database.

It is not your event log.

It is not your cache.

It is not your state store.

And despite some heroic attempts I have seen, it is definitely not a substitute for having a schema.

The prompt is an interface between structured application state and a probabilistic reasoning system.

Once I started treating it that way, the entire design became easier to reason about.

Something unexpected happened

I originally made these changes to reduce token consumption.

That worked.

But something more interesting happened.

The application got better.

Responses became more focused because the model received less irrelevant information.

Repeated runs became more consistent because unchanged state did not trigger fresh inference.

Latency improved because there were fewer model calls.

Debugging improved because every model invocation had an identifiable reason.

The deterministic components became responsible for things deterministic software is very good at:

comparison, filtering, deduplication, state management, validation and rules.

The model became responsible for something LLMs are actually rather good at:

reasoning about ambiguous information when something meaningful has happened.

That separation seems obvious now.

It was not obvious when I started.

Debugging AI stopped being quite so mystical

This architecture also improved observability enormously.

When every scheduled run sends a giant prompt to a model and receives another block of prose, answering the question “why did the recommendation change?” can become surprisingly difficult.

Was the input different?

Was there a new news article?

Was the article duplicated?

Did the prompt template change?

Did a provider change some metadata?

Did the model simply interpret identical evidence differently?

Did I accidentally include a player from another league because two people have similar names?

Did Mercury enter retrograde?

With explicit state tracking, the problem becomes much more conventional.

I can inspect the previous snapshot.

I can inspect the new snapshot.

I can see the delta.

I can see which event invalidated the previous analysis.

I can inspect the exact model input.

I can compare the old and new output.

I can record model version, prompt version, token usage, timestamps and relevant state identifiers alongside the result.

“The AI did something weird” stops being a diagnosis and becomes what it should always have been:

the beginning of the investigation.

The architecture became event-driven

The first implementation was fundamentally polling-driven.

A timer fired.

The application collected everything.

The model analysed everything.

The improved version still polls some sources because the real world stubbornly refuses to provide a beautifully designed event stream for every API I would like to consume.

But polling is now a mechanism for discovering events, not a reason to run analysis.

That gives us a much more useful conceptual pipeline:

Poll → Detect → Classify → Invalidate → Schedule → Analyse → Persist

A new injury report does not necessarily require every league to be reanalysed.

It affects leagues containing that player.

Perhaps it affects only decisions involving that player and their replacements.

A roster transaction invalidates the appropriate roster analysis.

A trade-value movement may matter only if it crosses a decision threshold.

This starts looking suspiciously like traditional distributed systems engineering.

Idempotency matters.

Event keys matter.

Deduplication matters.

Retries matter.

Backoff matters.

Observability matters.

Failure handling matters.

The application needs to know whether an event has already been processed.

It needs to avoid running an expensive analysis twice because a worker timed out after the model responded but before the result was committed.

It needs to distinguish retryable provider failures from permanent failures.

It needs enough metadata to reconstruct what happened afterwards.

None of those requirements disappeared because I put an LLM into the architecture.

If anything, they became more important, because the operation in the middle is now slower, more expensive and less deterministic than most of the functions surrounding it.

“Agentic” does not mean “ask an LLM everything”

This is probably the biggest lesson I have taken from the whole project.

There is a temptation at the moment to equate “agentic” with putting an LLM inside a loop.

Get some information.

Call model.

Get more information.

Call model.

Call another model.

Ask the first model what it thinks about what the second model thought.

Perhaps introduce a third model to adjudicate.

Eventually somebody receives an invoice large enough to qualify as an architectural artefact.

Useful agency does not require constant inference.

A good agent should know when not to think.

It should know when to wait.

It should know when nothing has changed.

It should know when a deterministic rule is more reliable than generated reasoning.

It should know when its previous answer remains valid.

It should know when it does not have enough information.

It should know which state has been invalidated and which has not.

Nobody is going to produce an exciting conference demo in which an AI agent examines a state fingerprint and proudly announces:

“I have decided to do absolutely nothing.”

But in production systems, doing nothing can be the correct behaviour.

And correct behaviour is generally more useful than an impressive animation.

The model is not the architecture

One of the traps in AI development is becoming so obsessed with model selection that everything around the model becomes secondary.

Which model?

Which context size?

Which benchmark score?

Which reasoning mode?

Which provider?

Those questions matter.

But a better model does not rescue an application that sends stale information, duplicates records, loses state, cannot explain why an answer changed and repeatedly asks expensive probabilistic systems to perform work that could have been handled by a database query.

The surrounding software determines:

  • which facts reach the model;
  • whether those facts are current;
  • whether they are duplicated;
  • whether they are relevant;
  • what previous state is available;
  • what changed;
  • why analysis was triggered;
  • whether the output can be explained later;
  • whether failures can be retried safely;
  • and whether the economics still work when usage increases by a factor of 100.

This is why AI engineering increasingly looks to me like a mixture of software engineering, data engineering and probabilistic systems engineering rather than an entirely new discipline in which we throw away everything we learned over the previous fifty years.

You still need schemas.

You still need queues.

You still need caches.

You still need indexes.

You still need logs.

You still need metrics.

You still need regression tests.

You still need to understand failure modes.

And occasionally you need to remember that a SQL query has been sitting quietly in the corner for decades, waiting patiently for everyone to finish talking about agents.

The irony of building AI software

The more I have worked on this project, the less impressed I have become by applications that demonstrate their sophistication by making lots of AI calls.

Calling an LLM is easy.

Knowing when to call one is architecture.

Knowing when not to call one is architecture.

Knowing what context to give it is architecture.

Knowing what state to retain between calls is architecture.

Knowing what invalidates an existing answer is architecture.

Knowing which decisions should remain deterministic is architecture.

Knowing why an answer changed is architecture.

Knowing how the application behaves when the model is unavailable, slow or confidently wrong is architecture.

The model matters enormously, but it is still a component.

The software surrounding it determines whether you have built a useful product or an expensive demonstration with a very persuasive loading spinner.

My fantasy football application still uses AI.

It just uses considerably less of it.

And the result is cheaper, faster, more deterministic, more observable and easier to debug.

Most importantly, the model is now being used for judgement rather than bookkeeping.

That is probably the most important lesson I have taken from building it.

The objective should not be to find as many opportunities as possible to invoke an LLM.

The objective is to identify the relatively small number of places where probabilistic reasoning genuinely improves the system, engineer everything around those points properly, and then have the discipline to leave the model alone when it has nothing useful to do.

Which, somewhat inconveniently for anyone measuring AI adoption by token consumption, means that using less AI has made this a considerably better AI product.

As for whether it can finally explain what the Chicago Bears are doing?

Some problems may simply be beyond artificial intelligence.

Although, to be fair, I have not yet tried giving it a larger context window.


This is an expanded version of an article originally published on Medium.

If you enjoyed this, you can read the original article and follow my other writing on AI, software engineering, agentic systems and the occasionally questionable things I build with them on Medium.

Read the original article on Medium →

The Gaffer Next: It Is Starting to Become a Football Management Game

A few weeks ago, The Gaffer Next was mostly a specification, a collection of ideas, and a slightly unreasonable desire to build a football management game for the ZX Spectrum Next.

Now it actually does things.

That feels like progress.

(This is an in-progress screenshot from the loading screen – recognise the manager?)

The project is a homage to One-Nil Soccer Manager, the old DOS football management game from Scottish developer New Era Software. I wanted to capture some of what made those older management games so compelling: relatively simple presentation, lots happening underneath, and that dangerous ability to make you think, “I will just play one more match.”

The important bit is that I am not trying to build Football Manager on an 8-bit machine. The aim is to build something that feels like it belongs on the Spectrum, while taking advantage of what the Next can do.

And the foundations are now starting to appear.

What is working?

The loader is complete, including a proper loading image. See above!

That might sound like a small thing, but there is something enormously satisfying about seeing a game actually load into its own title screen rather than staring at whatever temporary developer screen happens to be there.

More importantly, the competition structure is now taking shape.

Three tournament types are implemented:

  • League
  • Cup
  • FA Cup

The game can also generate the teams needed to populate those competitions.

Underneath that, some of the less glamorous but rather important management-game machinery is appearing. There is now logic for arranging friendlies, along with the logic required to settle everything at the end of a season.

That last part is particularly significant.

A football management game is not really a collection of individual matches. It is a simulation that needs to survive the transition from August to May and then correctly turn itself back into August again.

Promotion, relegation, competition state, squads and the new season all have to remain coherent. Getting that lifecycle designed early should make everything built on top of it considerably easier.

And now there are players

The initial squad display logic is also in place.

This is where the project starts becoming noticeably more tangible.

Until this point, much of the work has been infrastructure: tournaments, teams, scheduling and season state. Necessary, but largely invisible to the person eventually playing it.

Once you can open a squad and start looking at footballers, however, it begins to feel like a management game.

The eventual idea is that the player should be able to move naturally between the high-level club view and individual footballers, seeing their value, position and abilities without drowning in information.

That simplicity is deliberate.

The old management games were remarkably good at giving you just enough information to make a decision — and then allowing you to convince yourself that signing a 34-year-old midfielder with questionable pace was somehow tactical genius.

Building the boring bits first

One thing I have deliberately resisted is immediately jumping to the glamorous parts: match graphics, transfers, tactics and all the other things that make good screenshots.

The underlying simulation needs to work first.

At the moment the rough progression looks something like:

load game → create football world → create competitions → populate teams → schedule matches → manage squads → play season → settle season → repeat

If that loop is solid, I have a foundation on which the actual management game can grow.

If it is not, I have a very attractive ZX Spectrum Next program that eventually collapses in a heap sometime around the third Saturday in February.

I have written enough software over the years to know which one I would prefer.

Still a long way to go

There is obviously plenty left to build.

The squad system needs to develop further. Player attributes and progression need to feed into matches. Transfers and finances need to become meaningful. Tactical decisions need consequences. The match engine needs to turn all of that data into believable football.

And, critically, it all needs to remain achievable within the constraints of the machine.

But the interesting milestone this week is not any individual feature.

It is that The Gaffer Next has crossed a small but important boundary.

It is no longer just a design document for a football management game.

There is now a football world being generated underneath it.

And somewhere in there, presumably, there is already a chairman preparing to sack me.

More soon.