The book

Fact-Based Agents

ORM 2, FORML and Factum for agentic memory. The long version of everything this site argues.

The cover of Fact-Based Agents by Volodymyr Pavlyshyn.

Coding agents reconstruct your domain from schemas and code, and nothing on disk disagrees with them. This book gives them something that does: an ORM 2 conceptual schema that verbalizes into checkable English.

Eighteen chapters, 61 diagrams and 38 working models — the notation in full, Halpin's design procedure worked end to end, the Factum toolchain in depth, and three real schemas modelled properly, including a promise graph for multi-agent work.

18 chapters 61 diagrams 38 working models PDF · EPUB · web pay what you want

The argument

Ask a coding agent what a row in subscription means and you will get a confident, fluent, well-organised account of your domain. Most of it will be right. The parts that are wrong will not be marked, because the agent has no way to know which parts those are — and, on a first reading, neither do you.

That is not a reasoning failure. The agent did the only thing available to it: it inferred a conceptual model from a logical one. The trouble is that many conceptual models are consistent with the same logical one. A nullable column is equally consistent with this is genuinely optional, with this is mandatory but was added later, and with nobody ever decided.

Object-Role Modeling is a fifty-year-old answer to a problem we have just started calling new.

It describes a domain as elementary facts — Person works for Company — that carry no attributes at all. That sounds like a restriction and is in fact the whole mechanism: because there is nowhere to hide a property, every decision has to be stated as an explicit constraint. And because every constraint is explicit, every one can be read back as a sentence a domain expert can confirm or reject, and that a language model can consume with almost no ambiguity.

What you will learn

The notation, completely

ORM 2 has about a dozen marks. Every one is drawn, beside the sentence it generates: uniqueness, mandatory, frequency, all ten ring types, subset, exclusion, equality, value, cardinality, subtyping and objectification.

FORML, and the end of the context wall

A chapter on the formal language that reads like English — its closed fifteen-form vocabulary, why the absence of a sentence is information rather than ambiguity, and why a domain that fills forty tables of DDL fits in a prompt as a few hundred sentences.

A procedure people actually confirm

Halpin's seven steps worked end to end, a chapter of strategies, six named anti-patterns, and the practice — sample populations — that lets a validator tell you your own data contradicts the constraint you just drew.

The Factum toolchain in depth

The editor, all eight CLI commands, drift detection against a pg_dump, model diffs rendered as sentences for review, and the MCP server that gives a coding agent eight tools over the model.

Three real schemas

A six-layer agentic memory architecture with an epistemology layer. A promise graph for multi-agent coordination built on Promise Theory, where rejections are first-class. An audit log whose hash chain is stated as constraints rather than assumed by the code.

Interoperability, honestly

NORMA, the FBM Exchange MetaModel, Apache Ossie and the Unified Modelling Schema: what each can and cannot hold, and why a conceptual format and a logical one are not interchangeable.

How the book is built

Every ORM diagram is rendered by Factum's own renderer, from a model file that ships with the manuscript — 38 of them, openable in the editor and taken apart. Every FORML sentence, every validator message and every line of generated SQL and Cypher quoted in the text is real tool output, not a paraphrase.

Four figures are deliberately wrong, because the text works through the error the validator reports. The build asserts that they still fail.

Contents

Eighteen chapters and three appendices.

  1. Preface
  2. 01The Fact Layer Your Agent Is Missing
  3. 02The Elementary Fact
  4. 03FORML, and the End of the Context Wall
  5. 04Reading the Diagram
  6. 05The Constraint Family
  7. 06Subtyping and Objectification
  8. 07The Design Procedure, Worked
  9. 08Strategies, Heuristics and Anti-patterns
  10. 09Populations: Grounding a Model in Examples
  11. 10The Editor
  12. 11The Command Line, in Depth
  13. 12Giving an Agent the Fact Layer
  14. 13Export to LadybugDB and Graph-Powered Memory
  15. 14Agentic Memory as a Conceptual Schema
  16. 15A Promise Graph for Multi-Agent Interaction
  17. 16The Audit Log as an ORM 2 Model
  18. 17Interoperability
  19. 18Metadata, Hints and Extension Points
  20. AFORML Quick Reference
  21. BCLI and MCP Reference
  22. CValidation Codes

Who it is for

You will get the most from it if

You are building with agents and tired of re-typing the domain into every prompt.

You have a database nobody documented and an agent confidently inventing its semantics.

You have read about knowledge graphs for agent memory and want a way to design one that is checkable rather than vibes.

No prior ORM is needed. You do need to have written a schema and regretted it.

What it is not

Factum is a VS Code extension; the book assumes you use it or read the JSON directly.

The property graph mapping targets LadybugDB's Cypher DDL, and other graph databases will need small syntax adjustments.

Derivation rules are stored and verbalized, but not evaluated.

And nothing in the book calls a language model. The verbalizer, the validator and the mappers are deterministic code that would have worked identically in 2005.

The companion volume

Metagraph for AI Agents asks how to represent agent knowledge — hypergraphs, reification, the bipartite form, six layers of memory. Fact-Based Agents asks how to specify and check it. Where the first shows you that an n-ary relationship has to become a node, this one draws the ternary fact type and lets the mapper produce the Levi form for you, with the acyclicity constraint carried into the generated script as a rule the application must uphold. The two are complementary; neither repeats the other.

Read the whole argument

Pay what you want, from a minimum of $27. PDF, EPUB and the Leanpub web app, with free updates as the book grows.