DEV Community

Cover image for Why “More Context” Still Doesn’t Fix Infrastructure
Siddharth Pandey
Siddharth Pandey

Posted on

Why “More Context” Still Doesn’t Fix Infrastructure

A common reaction to AI hallucinating infrastructure is:

“Just give it more context.”

More code.
More docs.
More Terraform.
More logs.
More everything.

It sounds reasonable.

But it quietly assumes something important:

infrastructure understanding is a “volume problem”.

It is not.


More Context Doesn’t Fix Wrong Structure

Let’s say you give an AI agent access to:

  • Terraform
  • CloudFormation
  • CDK
  • schema definitions
  • deployment configs
  • API code
  • docs

It can now “see more”.

But infrastructure problems are rarely about missing visibility.

They are about missing relationships.

For example:

  • Which service consumes this queue?
  • Which Lambda depends on this table?
  • Which schema version is actually deployed?
  • Which environment is stale?
  • Which index is required by this access pattern?

These are not text retrieval problems.

These are graph problems.


RAG Works on Similarity, Not Truth

RAG retrieves things that are:

  • semantically similar
  • textually relevant
  • contextually close

But infrastructure requires:

  • exact state
  • exact relationships
  • exact deployment reality

Similarity is not enough when:

  • a resource exists in dev but not prod
  • a schema changed but code didn’t
  • an index was removed but code still assumes it exists
  • two services are loosely coupled but heavily dependent

The system becomes inconsistent very quickly.

And AI happily reasons over that inconsistency as if it is unified truth.


The Real Issue: No Deterministic Infrastructure Graph

What AI actually needs is not just more text.

It needs a deterministic representation of the system itself:

  • services
  • dependencies
  • data flows
  • infrastructure topology
  • runtime relationships

In simple terms:
a graph where nodes are real infrastructure resources and edges are verified relationships between them — not assumptions inferred from code similarity.

Without that, the model is still guessing.

Even if it has access to your entire repository.

Because repos do not fully represent production systems.

Production systems are behavior.


This Is Where Things Start Breaking Quietly

Most infra failures don’t come from obvious mistakes.

They come from:

  • outdated assumptions
  • invisible dependencies
  • forgotten services
  • implicit coupling
  • undocumented flows

AI systems are especially vulnerable here because they treat code as the system.

But production systems are not code.

They are behavior.


This Is the Gap I Keep Thinking About

This is the gap that pushed me toward building Infrawise.

The goal is not just:

“give AI more context.”

It is to make infrastructure relationships structurally understandable for AI systems.

Things like:

  • real schema relationships
  • actual index existence
  • service dependencies
  • infrastructure topology

Derived from infrastructure state and system analysis — not guessed purely from source code patterns.


Closing

A lot of current AI tooling assumes that if the model sees enough files, eventually it will understand the system.

I don’t think that is true.

Because infrastructure problems are fundamentally relationship problems.

Not autocomplete problems.

Not retrieval problems.

And definitely not “just increase the context window” problems.

Current AI coding assistants are already very good at understanding source code.

The next generation will need to understand:

  • infrastructure topology
  • operational relationships
  • deployment reality
  • system behavior

Because repos do not fully represent production systems.

Production systems are behavior.

Top comments (0)