DGML
Your AI shouldn’t have to guess what it’s reading.
The Problem
Every token you send to an LLM costs money and burns context. Markdown forces your model to re-discover structure on every call — layout noise, no typed values, no relationships.
Structural formats name the shape — <section>, <table> — but not the substance.
Raw documents burn the entire file into every call with no leverage. And none of them can prove a value hasn’t changed since it was signed.
Cross-document tag consistency is the headline feature. An agent that can query one contract's <liability-cap> can query the same element across a thousand contracts — identical logic, no per-document prompt engineering.
Each element carries dg:origin — pixel-precise coordinates back to the source page. An answer becomes a highlighted region on the real document. Not a floating assertion.
The XML hierarchy captures containment. Named links across documents capture relationships — an amendment points to what it modifies, a receipt points to the obligation it fulfills. The result is a JSON-LD-compatible graph, derived directly from the XML.
Traditional blockchain proofs cover a whole document. DGML lets you anchor individual data elements on an external chain — prove a specific data element is unchanged without producing the full document.
Traditional extraction makes an irreversible upfront decision: pick the fields, discard the rest. DGML preserves the full semantic structure. A document processed once remains fully queryable as new use cases emerge — without going back to the source.
Each organization defines its own vocabulary. Fragments from different organizations compose into a single document — no global registry, end-to-end provenance across the assembly.
Architecture
DGML is composed of complementary layers that work independently. Strip what you don’t need, keep what you do. One self-contained file serves an LLM call, a browser view, and a compliance audit trail. For situations where a hallucinated or unverifiable answer is not an acceptable outcome.
Each semantic tag collapses many surface tokens into a single named concept. Your model sees <LiabilityCap>$500,000</LiabilityCap> instead of three paragraphs of surrounding prose. Strip dg:origin before the API call for further compression. Or send a single subtree in isolation — precision targeting instead of burning the whole document.
Every element carries a dg:origin attribute encoding its pixel-precise bounding box in the source document. Highlight citations, verify extractions, build redaction tooling — all grounded to the real page.
Anchor individual data elements on any external blockchain — Proof of Origin at the data-element level, not just the file level. The DGMLX package also carries a cryptographic hash of the full document and page images, with packages chaining to their predecessors for tamper-evident provenance across document versions.
A DGML file is human-readable in any browser — no special viewer, no extra tooling. Elements can carry dg:structure to map to HTML tags and dg:style to express observed simple formatting as CSS. A few lines of transform is all it takes. The same file your AI reasons over is one a person can open, read, and understand.
The Format
Tags that say what things are. Not where they were.
A docset is a named collection of same-kind documents — all your invoices, all your contracts — governed by a shared domain vocabulary. LiabilityCap, TotalDue, PaymentTerm mean the same thing in every file in the docset. Query one, query all.
Amounts are decimals. Dates are dates. And every element knows exactly where it came from on the original page — down to the pixel.
Strip dg:origin before the API call to remove spatial coordinates. Send the whole document compactly, or a single subtree to focus attention precisely. Domain-specific XML your model reasons over — not re-parses, not guesses at.
Hash a single element and anchor it on any blockchain. A recipient can verify that specific data artifact without seeing the rest of the document.
<dg:chunk xmlns:dg="http://dgml.io/ns/dg#" xmlns:docset="http://www.dgml.io/acme/leases#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <docset:RentClause> The Lessee shall pay a monthly rent of <docset:MonthlyRent xsi:type="decimal" dg:value="8500.00" dg:origin="4 740 355 920 375">$8,500</docset:MonthlyRent> , commencing on <docset:CommencementDate xsi:type="date" dg:value="2025-02-01" dg:origin="4 1010 355 1310 375"> February 1, 2025 </docset:CommencementDate> , subject to review per <dg:chunk dg:itemprop="governedBy" dg:href="#rent-review-clause" dg:origin="4 1560 355 1740 375"> section 9 </dg:chunk>. </docset:RentClause> </dg:chunk>
A Different Philosophy
Every extraction pipeline makes an irreversible decision upfront: choose the fields, discard everything else. That works when the questions are known in advance. It fails the moment a new use case appears — a regulatory change, a derivative product, a counterparty due diligence request — that requires information no one thought to capture.
DGML preserves the complete semantic structure of the document. Every element, every relationship, every typed value — nothing discarded. A document processed once remains fully queryable as new use cases emerge — a regulatory change, a derivative product, a counterparty due diligence request — without going back to the source. This is not a feature of the tooling. It is a property of the format.
Decide upfront which fields matter. Pull them. Discard the rest. When a new question arrives — a new regulation, a new product, a new counterparty — go back to the source. If the source is gone, the answer is gone.
The entire document semantic is in the DGML file. Every element tagged, every relationship encoded, every value typed. Query it today for what you know. Query it tomorrow for what you don't yet.
Use Cases
Every scenario involves at least two parties: one who needs to assert a value, and one who needs to verify it independently. In every case, the value of DGML compounds over time — because the complete document semantic is preserved, new questions can be answered from the same file without returning to the source.
Marguerite Halloran, CFO of a non-traded real estate fund, must publish a monthly net asset value (NAV) — the per-share value of everything the fund owns — that investors rely on to subscribe or redeem. Her valuation advisor, Theo Ellison, won’t stand behind the number unless he can trace each property’s value back to the underlying signed leases — which today sit in scattered systems he cannot independently verify.
DGML encodes each lease as a structured document: base rent, escalation schedule, free-rent concessions, operating-expense recoveries, renewal options, co-tenancy clauses — every data element typed, traced to the source page, and anchorable on-chain. Theo follows the trail from NAV to clause without a phone call.
Russell Carrow, CFO of a publicly traded commercial mortgage lender, needs investors to believe the buildings backing his loans are still worth enough to cover them. Analyst Naomi Brandt has openly questioned whether the company is marking its troubled office loans honestly — and she wants independently verifiable evidence, not management assurances.
DGML encodes each loan as a structured document: principal, covenants, reported performance, tenant concentration, reserve balances, default triggers — every data element typed, traced to the source page, and anchorable on-chain. Russell produces a loan-by-loan trail Naomi can check herself.
Daniel Roth, Head of Private Wealth Solutions at a private credit manager, wants to make his fund’s net asset value (NAV) verifiable enough to offer a liquid, eventually tokenized interest. Evelyn Castellano, Chair of a public pension plan’s investment committee, will not commit capital to a fund whose NAV she cannot independently verify down to individual loans.
DGML encodes each loan as a structured document: principal, interest terms, maintenance covenants, fair-value assumptions, collateral — every data element typed, traced to the source page, and anchorable on-chain. Evelyn traces the fund’s NAV down to one borrower’s covenant breach or a single recovery assumption.
Margit Dahl, CFO of an infrastructure fund, wants to give institutional investors a way to value, transfer, or borrow against positions in toll roads, regulated utilities, and renewable-energy assets. Conrad Boyle, Head of Real Assets at a public pension plan, will not increase, transfer, or finance his stake without independently verified operating performance across decades-long horizons.
DGML encodes each concession agreement and operating report as a structured document: tariff mechanisms, performance obligations, debt-service covenants, capital expenditure commitments, ESG metrics — every data element typed, traced to the source page, and anchorable on-chain. Conrad traces a valuation down to a single toll road’s traffic figures.
Open Standard
DGML is an open initiative founded by Docugami and Inveniam, Apache 2.0 licensed, with a simple premise: the document format for the agentic era should be owned by no one and shaped by everyone who builds on it. The specification is live. The community is forming. A formal steering committee, open to all significant contributors and adopters, will be established to guide the evolution of the format. Organizations that participate now have real influence over what it becomes.
An early Python toolkit is on GitHub. Use it, break it, improve it. The implementations that emerge from real use cases are what harden a standard — and the people who build them are the ones who shape its direction.
The spec is versioned in the repo. Open an issue to propose a new subject, challenge a design decision, or bring a use case the founding organizations haven’t encountered. What gets raised now gets considered now.
DGML
Your AI shouldn’t have to guess what it’s reading.