Deskree
Research

ResearchEngineering knowledge

Compiling a system into facts: how Metafour builds its context graph

Metafour generates a context graph of a software system with no language model involved, and automatically keeps it up-to-date. Agents connected to Metafour produce the same, grounded results in every single run.

Dmytro Grechko, CEO at Deskree

What Metafour does

Metafour generates a context graph of a software system and keeps it up to date as the system changes. The graph covers code, infrastructure, runtime and operations. It is generated from the system itself, with no language model involved, and AI agents query it to learn what exists, how the parts relate and who owns them.

Here we want to explain why agents cannot work this out for themselves in a large enterprise system, what the graph holds, how it is generated and kept up to date, the two ways it is used, and where it stops. What it changes for an agent is measured in a separate piece.

Your cloud

  • Code
  • Infrastructure
  • Runtime
  • Operations
The context graph

Agents and automation

  • Cursor
  • Claude Code
  • API
The graph is generated inside the customer’s cloud and reaches engineers through the tools they already use.

A change that crosses repositories

Take a routine request: retire a field from an internal API. Inside the repository that defines the API, a coding agent does this well. It finds the definition, updates the handlers and fixes the tests.

The field’s consumers live elsewhere. A mobile client in another repository reads it. A reporting job written in a different language parses it. An infrastructure template passes it through as a variable. None of these appear in a search of the repository the agent was started in.

The agent finishes, the tests pass, and the change is wrong. Nothing in its output says so.

Why searching does not scale

Today an agent learns about a system by searching it. It opens files, follows references and builds a picture as it goes. Inside one repository that works. An enterprise system is hundreds of repositories, several clouds, and years of pipelines, configuration and incident history. The approach breaks down there, for three reasons.

The system does not fit

An agent can hold only what fits in its context window, and an enterprise system is far larger than any context window. The agent sees a slice, chosen by whatever it happened to search for, and answers as if the slice were the whole. A larger window moves the limit. The system is still bigger than the window, and the agent still has to choose what to leave out before it knows what is there.

Agents hallucinate

When an agent lacks a fact, it supplies a plausible one. A dependency that does not exist reads exactly like one that does. That risk is tolerable in a draft. In a live production system, a wrong answer about what a change reaches becomes an outage.

Discovery is most of the bill

Searching is also expensive. More than 75% of an agent’s token spend went to discovery: reading files and gathering context before any work began. The picture the agent builds is thrown away when the session ends and paid for again in the next one.

Why a better model does not fix it

These limits come from what a language model is. A language model is probabilistic: it produces the most likely continuation of what it has been given. That is what makes it useful, and it is also why the same question can get a different answer on Tuesday than it got on Monday.

The facts of a production system are of another kind. A service is deployed to a cluster or it is not. A team owns a service or it does not. A probable answer to a question like that is of no use to the engineer who has to act on it. A stronger model guesses better, and it is still guessing whenever the fact lies outside what it was shown.

So we keep the two jobs apart. The model reasons and writes. The facts come from a source that does not guess.

What is in the graph

The context graph covers four areas of a system. For each one it records what exists and how the parts relate, within an area and across areas.

AreaWhat the graph holds
CodeRepositories, the services and APIs defined in them, how they depend on one another across repositories and languages, and the changes made to them.
InfrastructureCloud resources, clusters and environments, the pipelines that build and deploy, configuration, and which service is deployed where.
RuntimeWhat is running and how it behaves. Which services and versions are live, and where, is read from orchestrators and cloud platforms. Metrics, logs, traces and alerts are read from monitoring and observability tools, and the largest of these are retrieved on demand.
OperationsTeam structure, projects and tasks, incidents, and who is on call.

The relationships that matter most cross areas: which code is running where, which deploy preceded which incident, which team owns the service behind an endpoint. These are the questions no single repository can answer.

Because the graph ties people and teams to the system, it also knows who is responsible for what: which team owns a service, who is on call for it, and who to ask about a part of the system.

Coverage is broad. Metafour reads code written in most languages, and it connects to the main developer tools and data sources an enterprise runs on, from infrastructure to observability and incident response tools.

We call it a graph because relationships are its core. Underneath, each type of data is kept in the data structure best suited to it, and these range from graphs to vectors to traditional databases.

How the graph is generated

Metafour connects to a system’s sources with read-only access and generates the graph from what it finds there. No language model takes part. The same system yields the same graph, whoever asks and whenever they ask, and that is what lets an answer be reproduced and audited.

The graph is generated when Metafour is first connected. For a large system that first pass takes a while, because everything has to be read. From then on the graph is kept up to date.

How it stays up to date

A graph of last month’s system is of little use, so keeping the graph current matters more than generating it. Metafour does this automatically, and each kind of source is handled in the way that suits it.

Code is the clearest case. Whenever the code changes, for example through a pull request, the graph is updated to match. It reflects the code agents wrote last night as well as the code people wrote last year.

Some data is too large to copy. Telemetry and logs are retrieved on demand, at the moment a question needs them, because of their sheer volume.

Two layers: engineering and intelligence

Metafour is used in two ways, and we call them its two layers. Both draw on the same graph.

The engineering layer

This is what engineers use day to day. An engineer connects Metafour to their AI tools through the Model Context Protocol, from tools such as Cursor and Claude Code, and it gives those tools up-to-date context of the entire system. Programs reach the same context through an API.

That context helps with whatever task is in hand: changing something, building a new feature, or asking a question about what already exists. Nothing changes in how the engineer works. They ask their agent, the agent asks Metafour, and Metafour returns the part of the system the task needs, already connected. The agent spends its context window on the work.

The intelligence layer

The intelligence layer provides insights that are unique to each organization. A team can learn how its engineers work and how they are adopting AI tools, how productive it is, what state its system is in, how a modernization could be carried out, and where it overspends on resources.

These answers come from the same graph. They are possible because it holds an organization’s people and work alongside its code and infrastructure.

Answers cite their sources

Every item Metafour returns is traced to where it came from in the system: the repository, the resource, the record. An engineer or an agent can open the source and check it.

Take the question an engineer asks during an incident: who is on call for the service that just failed? The answer is a chain. The service is deployed. The deployment is running as an instance. An alert watches the instance. The alert pages a team. Each link joins two things that live in different places, and each one is shown by the system.

Shown by the system, link by link

  1. CodeService paymentsdeployed as
  2. InfrastructureDeployment payments in prodrunning as
  3. RuntimeRunning instance payments-7c9dwatched by
  4. RuntimeAlert payments error ratepages
  5. OperationsTeam on call Payments

Claimed by a tag

  1. InfrastructureA resource with a misleading tagtag claims
  2. InfrastructureDeployment none found

Held asUnconfirmed

  • The system shows it
  • Something claims it
One answer is a chain across all four areas, and every link is shown by the system. A tag that claims a deployment where none is found is held as unconfirmed. Illustrative: the names are invented.

No false positives

A system holds two kinds of evidence about itself. Some of it is the system: code in a repository, a deployment in a cluster. Some of it is a claim about the system, such as a tag on a resource. Metafour reports a relationship as confirmed only when the system itself shows it. A relationship that rests only on a claim is held as unconfirmed and is reported that way.

This is why Metafour does not return false positives. Nothing in the graph was produced by a model that could have invented it, and nothing is reported as a fact on the strength of a claim. When Metafour says a service is deployed, there is a deployment.

The difference shows when a claim is wrong. A resource can carry a tag that says it is deployed when no deployment exists. An agent that reads the tag reports the resource as deployed. An agent that reads the graph reports it as unconfirmed. One of our tests is built on exactly this case.

Where it runs

Metafour is deployed as a container in the customer’s own cloud, on AWS, GCP or Azure. The context graph is generated and kept there. Metafour is read-only: it does not execute code and does not change infrastructure.

Where it stops

What it cannot see

The graph holds only what Metafour can see. A part of the system it has no access to is missing from the graph, and the graph says so. We call these parts dark matter. The relationships the graph already holds point at things it cannot see, and Metafour marks those gaps and asks the team to confirm what is there.

Documentation and conversations

In many organizations documentation is poorly maintained and drifts from the system quickly, and a stale document can mislead the graph. The same holds for meeting transcripts and conversations in Slack or Teams, which often contradict what the system shows. The graph therefore relies only on what it sees in the system itself. What a team knows only from those places, such as the reason behind a decision, is not in the graph.