
A year ago Foundation Capital argued that the next great enterprise platforms would be built on context graphs. They called it a “trillion dollar opportunity“, it raised eyebrows and got everybody talking. The basic idea is that today Systems of record capture what happened: a 20% discount, a denied loan, a sustained protest. They rarely capture why that happened. But if you record the decision traces (the inputs, the exception, the approver, the precedent) and link them across systems, and you get a new system of record for decisions. Agents can then ask “why did we do that last time?”
A context graph is collection of memories. It tells you what people did, and helps an agent find similar past cases. Memory is pattern matching, it is not quite understanding. If you have 30,000 past decisions, the valuable thing is not the ability to retrieve 30 of them. It is the policy they imply. The rules the people in your organization follow, which exceptions do they make, where they contradict themselves, and what changed last week, last month, last year. Those policies can be learned, written down, executed and checked. Let’s call the result a logic graph.
I claim logic graphs are more than just the next layer. I think a logic graph eats the context graph it learned from. Anything you would ask the context graph, you can ask the logic graph, but the reverse is not true. For those of you whose attentions spans are down to seconds just look at the picture to understand the difference:

Facts, experiences and rules:
A knowledge graph says customer A signed contract B. A context graph says decision 491 gave A a 20% discount because a competitor made an offer and a VP approved it. A logic graph says that a customer with high churn risk and a competing offer qualifies for a discount exception within margin and approval limits, supported by 412 decisions, contradicted by 9, and followed less often since March 2026.
A rule in a logic graph points to the decisions that support it and the ones that contradict it, and to the source and version that produced it. Ask why application X was denied and you get the rule that fired, the decisions behind it, and the counterexamples. The context graph’s answer is still there, attached to a general statement you can test.
Precedent is also a rule. Sometimes no short rule fits, because the signal is spread over many weak features or was never recorded. Then you do what a context graph does and follow similar past cases. But “deny if most past applications that matched on these features were denied” can be compiled into the same program as the crisp rules, run, and explained. In our tests, rules with a precedent fallback compiled into one program, and on 2,363 test cases it matched an independent implementation with no mismatches. Where the rules are confident they decide, and where they are not, precedent decides, in the same graph, with the same audit trail.
So the context graph is not a competitor to the logic graph. It is a component of it: the evidence layer and the fallback.
What we measured
For the past few days I have been testing this on public decision records. The records cover US mortgage decisions (HMDA), a Dutch bank’s loan process logs (BPI 2017), US government bid protests (GAO), European human rights judgments (ECHR), GitHub pull requests and Lending Club loans.

Most decisions compress down to just to a handful of rules
For two of three large mortgage lenders, about 100,000 decisions compress to 2–5 rules within 0.4 points of gradient boosting. Memorizing every feature combination, which is what a pure precedent store basically amounts to, does worse than two rules. Ten thousand decisions do not need 10,000 traces to be understood. They just need five sentences.
Where rules fail, the logic graph falls back to its own context
The third lender is the hard case. In 2023 it denied 54% of its applications, and no short rule captures how it decides. Its best two rules get 64.0% of its 2023 decisions right. Gradient boosting gets 75.0%.
Precedent does better here. For each new application, take this lender’s past applications with the same features (dropping the least important features until at least 10 match), and follow what it usually did: “deny, because most similar past applications were denied.” That gets 75.5%, pretty much the same as gradient boosting.
The hybrid uses a rule only where the rule is at least 85% reliable, and precedent everywhere else. For this lender the rules are that reliable, on just 12% of applications, so precedent decides the other 88%, and the hybrid scores the same 75.5% as precedent alone. For the other two lenders it runs the other way: rules decide nearly every case, and the hybrid scores the same as the rules.

This is the subsumption argument. The logic graph is never worse than the context graph it contains, and where the policy is crisp it adds a great deal. Let me show you what this really looks like in Relational AI using PyRel:
a, past = Application.ref(), Application.ref()# Rule 1: deny when no automated underwriting was run and debt-to-income is over 60%.# It was right on 98.6% of the 4,794 past applications it covers.model.where( a.is_new(), a.underwriting == "none run", a.debt_to_income == ">60%",).define(a.rule_says_deny(), a.rule_confidence(0.986))# When no rule fires, the answer is "approve", which was right 80.9% of the time.model.where(a.is_new(), model.not_(a.rule_says_deny())).define(a.rule_confidence(0.809))# Precedent: past applications that look like this one on 7 features.SEVEN = ["debt_to_income", "loan_type", "underwriting", "loan_purpose", "loan_to_value", "income", "loan_amount"]looks_alike = [getattr(past, f) == getattr(a, f) for f in SEVEN]model.where(a.is_new()).define( a.similar(aggs.count(past).per(a).where(past.is_past(), *looks_alike) | 0), a.similar_denied(aggs.count(past).per(a).where(past.was_denied(), *looks_alike) | 0),)# Enough of them (at least 10), and most were denied: precedent says deny.model.where(a.similar >= 10, a.similar_denied * 2 > a.similar).define(a.precedent_says_deny())# Trust the rule when it is at least 85% reliable; otherwise follow precedent.model.where(a.rule_confidence >= 0.85, a.rule_says_deny()).define(a.denied())model.where(a.rule_confidence < 0.85, a.precedent_says_deny()).define(a.denied())
The rule and the precedent are written the same way with a few conditions, then a conclusion. Precedent is not a separate retrieval system bolted on. It is a count, a threshold and a comparison, inside the same program as the rule.
This is simplified for reading. The deployed program, which the compiler generates, has four learned rules instead of one. It tries 11 levels of similarity, from 11 matching features down to 1, and uses the most specific level with at least 10 matches, rather than always 7. The version above runs as written. If you are new to PyRel that may look a little unfamiliar. But it’s readable, auditable, and most importantly executable code… which your LLM can write for you.
Consistency is a property of compiled logic, not of retrieval
Give an LLM the precedents and ask it to decide. Run it twice on the same 200 cases and it changes up to 4% of its decisions. Let an LLM agent decide a lender’s applications on its own and it flips 10–12% between runs. The compiled rules, the precedent lookup and the hybrid flip 0%, because they are deterministic.
The same goes for explanations. When the cited rule is executed alone, it reproduces the decision 100% of the time. We checked all 3,783 explanations a deployed model served. An LLM’s account of its own reasoning has no such guarantee.
What only a logic graph can tell you
Precedent retrieval answers “what did we do in cases like this?” Once decisions are compiled into rules, you can ask questions a pile of traces cannot answer.
Do we do what we say we do? Mortgage lenders must state a reason for every denial, and HMDA records both the reason and the application. For one national lender, “collateral” was the stated reason on 8,993 denials in 2025. On 63% of them the recorded combined loan-to-value was under 80%, its six largest peers’ median is 40%. That is either collateral trouble the public data does not show (an appraisal, a property type) or reason codes applied loosely. A context graph would hold all 8,993 traces without showing the gap. It appears only when you compare the stated reason with the recorded application, lender by lender.
Where do we disagree with each other? Learn each lender’s logic and run all of them on the same applications, and the disagreements show up. For conventional loans at 50 to 60% debt-to-income that skipped Freddie Mac’s automated underwriting, four Colorado lenders deny nearly all of them, one approves three in four, and another approves nine in ten.
What changed? A rule that stops matching behavior is a measurable event. Our drift monitor flagged one lender’s policy shift a year before a fairness gap appeared in its decisions.
What would change the outcome? Rules also give exact minimal counterfactuals, such as “approved if debt-to-income were under 50%.” Where a lender’s logic was crisp, these held up against its own later decisions: approval for those profiles rose from 0 to 6% to 82 to 83%. Where it wasn’t, 0% stayed 0%. So you can tell which kind of lender you have before promising an applicant anything.
What can’t we see? The best accuracy any rule over the recorded fields can reach is computable. When a lender sits far below it, or most of its denials cite credit history, which public data omits, you learn that the deciding information is missing from the records.
Every lender at once
HMDA’s bulk files hold 97 million approve/deny decisions from 2018 to 2025, and 2,149 lenders had enough history for a brief (at least 200 applications in 2025 and two earlier years). Learning, scoring and comparing all of them took two hours on one machine, with no failures and no fees.
Most lenders’ public decisions reduce to very little. 1,488 lenders get at least one rule, and the median among them has two. For 58% of all lenders the rules come within a point of gradient boosting. Weighted by volume, rules reproduce 85.2% of 2025 decisions and gradient boosting 87.9%, against 79.4% for always guessing the majority and a ceiling of 91.8% for any rule over the public fields. The other 661 lenders approve almost everything (median denial rate 7%), and nothing in the public fields beats “approve” for them, gradient boosting included.
Rules also stop being true. Another large lender learned “deny cash-out refinances not run through automated underwriting”: 69% of 37,527 such applications were denied in 2018 to 2024, but only 30% of 5,393 in 2025. Across all lenders, 105 have a rule their own 2025 decisions no longer follow. 216 have a group of at least 200 of their applications where their denial rate differs by 30 points or more from what their national peers’ rules would decide.
Stated reasons hold up unevenly. “Debt-to-income” is contradicted by the recorded debt-to-income on 4% of 764,000 denials, and only one lender of 1,152 is above half. “Collateral” is contradicted by the recorded loan-to-value on 41% of 359,000 denials. The median lender is at 35%, 160 lenders are above half, and one large lender is at 98.5% of 2,273. For the median lender, 42% of denials cite only reasons the public data doesn’t record, such as credit history, so the briefs also say how much of each lender’s decisions they can’t see.

Learning rules is getting cheap. Open-source rule learners exist and coding LLMs are good at it. What lasts is the checking around the rules (verified explanations, a record of where each rule came from, drift and fairness gates, replay inside the warehouse) and the loop that keeps them current.
What this is all for
The idea for this blog post came from a LinkedIn post worrying about moats. Most of it makes sense, but I don’t agree with the text in red:

If a frontier model can write your software in a week, the code isn’t what makes you hard to copy. What’s left is how your organization decides things: which discounts it grants, which claims it pays, which suppliers it trusts, which exceptions it makes and why. Most of that lives in people’s heads and in the traces their decisions leave behind. People retire, change jobs and forget. Traces pile up faster than anyone reads them. Their post argues that “deep domain expertise isn’t easy to codify“, I am pretty sure they are wrong.
A context graph keeps the traces. That’s necessary, and most of the money that followed the Foundation Capital essay went into it. Investment went to agents that log their decisions, and memory layers that store and retrieve them. But a store of traces still needs a model to reread it every time a question comes in, and it can’t say what the organization does in general, only what it did in cases like this one. Compile the traces into rules and you get a different asset. The rules can be read by the people who own the policy and tested against decisions they haven’t seen. They run without a model, and they don’t change when you switch models. Each rule keeps the decisions that support and contradict it, so nothing in the context graph is lost.
None of this is specific to mortgages. Any decision that leaves a record works: pricing exceptions, insurance claims, procurement awards, hiring screens, code review. We ran the same pipeline on court judgments, bid protests, pull requests and a bank’s process logs as well as on mortgage decisions. How much compiled depended on how much of each decision had been written down. Where it had been, a few rules covered most cases. Where it hadn’t, the pipeline said so and gave a number for how much was missing.
That changes what an organization should be collecting. A context graph is worth building, but as the raw material. The thing to own is the step after it, the loop that keeps turning decisions into tested rules and checks them as new decisions and outcomes arrive. I’d call that loop an expertise acquisition platform. A context graph records what an organization did. The logic graph learned from it describes what the organization knows how to do. Agents can run it and auditors can read it, and it still works after the people who made those decisions have moved on.
The test I haven’t run is an organization’s own private records. For mortgage lending that means the credit scores, underwriting findings and underwriter notes that public HMDA leaves out; for the median lender, 42% of denials cite only reasons that aren’t in the public fields. I want to know how much of that missing logic is written down somewhere inside the lender, and how much of it compiles. If you have records like these, in lending or anywhere else, and want to find out, I’d like to hear from you.