An open specification for turning documents into verified, cited records on the phone.
View the Project on GitHub open-mobile-document-agent/open-mobile-document-agent
Version: 0.1 (draft) · Date: 2026-11-26 · Editor: Mallikarjunayya Hiremath Sangamesh
OMDA is an open specification for turning paper and digital documents into verified, cited records on a phone, readable by any model and any agent.
The key words MUST, MUST NOT, SHOULD, SHOULD NOT and MAY are to be interpreted as described in RFC 2119 and RFC 8174. Machine-readable schemas live in /schemas; registries live in /registry.
Principle across the spec: disclose, don’t prohibit. Gaps are allowed when labelled; hidden gaps are non-conformance.
OMDA covers reading, verifying, storing, answering from and exchanging documents held on the owner’s phone.
In scope: capture from camera, share sheet, files, screenshots, email attachments and NFC chips; extraction into evidenced assertions; deterministic verification; lineage; on-device store; answers; selective-disclosure export.
Out of scope: actions taken on the owner’s behalf (forms, renewals, payments, messages); indexing and retrieval algorithms (only the interface is specified); connecting to institutions to fetch documents; medical, legal or financial judgement.
A runtime reports the lowest level it fully meets and lists every gap.
| Level | Name | Requires |
|---|---|---|
| L1 | Read | Capture, provenance, document identity (§3, §4) |
| L2 | Evidenced | Every assertion carries quote, region and page hash (§5) |
| L3 | Verified | Check registry and gate semantics (§6); generated answers cite (Answer model) |
| L4 | Exchange | Signed selective-disclosure packages (§11) |
nonconformance reason codes (no_citation, unverified_region, model_not_allowlisted, checksum_unavailable, off_device_processing, network_used, fuzzy_match, check_failed:<id>).A slot is a role with an input/output contract; any model meeting it may fill it — OS-provided, bundled or remote. Schema.
| Slot | Input → output |
|---|---|
ocr |
Page image → text lines with normalized boxes and confidence |
layout |
Page image + OCR → blocks (text, table, MRZ zone, photo, signature), reading order, proposed segments; DoclingDocument-compatible |
classifier |
Segment → doc_type + profile id (§7) |
extraction |
Segment + profile field list → assertions (value, quote, region); output SHOULD be JSON-Schema constrained |
embedding |
Text or assertion → vector; declares dimension and model |
interpreter |
Question → query plan (§9) |
answer_generator |
Question + retrieved items → answer with citations |
matcher |
Quote + region crop → fuzzy_match score (§6) |
answer_generator: ask returns only extracted and derived answers).registry/models.json with published slot-test metrics. Unlisted models are allowed, labelled model_not_allowlisted.T1 OCR + rules, no language model; T2 small quantized language model (~2B parameters or fewer); T3 OS foundation model or larger model on the NPU.Every super document records how it entered the runtime. Schema.
Channels: camera, scanner, share_sheet, file_import, screenshot, email_attachment, nfc_chip, consumer:<id>, note.
original_hash is taken before any transform; original bytes are kept by default and the owner MAY discard them.page_hash); transforms are recorded so the mapping to the original is reproducible.text_layer; a missing, thin or garbled layer triggers rasterization and OCR, with the reason recorded.method.kind = human.| Level | ID | Answers | Status values |
|---|---|---|---|
| Super document | sd_ |
What was captured together? | captured, processing, processed, failed |
| Segment | sg_ |
Which logical document sits in the capture? | proposed, confirmed, rejected |
| Document entity | de_ |
Which real-world document is this? | active, expired, superseded, archived |
expired is computed from validity dates; it flags, never hides.superseded applies only after the owner confirms a supersedes relationship.archived is an owner action, reversible; runtimes MUST NOT delete entities on their own.superseded and archived entities; explicit queries still reach them.Relationships: supersedes, amends, attached_to, related, duplicate_of. Status: proposed → verified (deterministic evidence) → confirmed |
rejected. |
confirmed.no_match with the candidates checked.subject label, derived from name assertions plus owner confirmation, never inferred silently, never linked across devices or owners.An assertion is one fact read from one document, carrying its own evidence. Schema · example.
Status ladder (strongest first; an answer inherits the weakest status it cites):
| Status | Meaning |
|---|---|
issuer_signed |
Valid issuer signature (ePassport chip via ICAO passive authentication; ISO 18013-5 mDL) |
confirmed |
Owner accepted the value |
verified |
Passed a deterministic check |
unverified |
Evidence present, no check applies |
candidate |
Weak evidence or region mismatch; shown, never hidden |
illegible |
The only valid reason to withhold a value |
rejected / suppressed |
Excluded from answers and exports |
page_hash are REQUIRED for method.kind model and check; derived assertions cite derived_from; human assertions need no evidence.candidate + unverified_region.supersedes.confirmed or rejected.confidence is optional and never replaces status.domain.object.attribute.group {id, kind, index}; groups carry no status.method.kind: model, check, derived, human. method.location: device (default) or remote.Checks are deterministic, offline and model-free; only they lift an assertion to verified. Models assist the gate only, capped at candidate. Registry: registry/checks.json; reference code: tools/omda_tools/checks.py.
| Kind | Tests | Lifts to verified |
|---|---|---|
checksum |
Check digit on one field (Verhoeff, Luhn, ISO 7064 mod 97) | yes |
structure |
Check digits across a structure (ICAO 9303 MRZ incl. composite) | yes |
cross_field |
Two sources agree (MRZ vs printed) | yes |
consistency |
Logical sense (issue before expiry) | no |
format |
Patterns and code lists (ISO 3166) | no |
fail → candidate + check_failed:<id>; still shown to the owner.candidate and the MRZ value is proposed with method.kind = check; the owner decides.matcher slot (OCR confusion pairs, visual re-read, learned similarity); recorded as fuzzy_match, capped at candidate. No match → candidate + unverified_region.candidate into an owner question; answers become human assertions honoured on every re-read.x-<vendor>.<name>; every check MUST publish its algorithm and test vectors.A profile is a versioned registry file. v0.1 ships identity complete plus a template; health (FHIR mapping), education, travel, finance, insurance and property follow in v0.2. Schema.
string, date, country (ISO 3166-1 alpha-3), sex (ICAO F/M/X), name, amount, code, image.basic → personal → identifier → special; they set default visibility (§8) and export warnings (§11).entity_key (for duplicate_of / supersedes) and validity (for expired).national_id type whose jurisdiction binds checks (in → Verhoeff, ae → Luhn).photo and signature are region-only image assertions, never exported by default.identifier SHOULD and special MUST require biometric or device credential.method.location = remote and off_device_processing.One operation set, defined as MCP tools and bound one-to-one to Android AppFunctions (the platform’s on-device MCP) and iOS App Intents. Query plan schema.
| Operation | Purpose |
|---|---|
omda.query |
Structured query plan → assertions or entities with citations |
omda.ask |
Natural-language question → answer (Answer model) |
omda.retrieve |
Chunks or assertions with scores and regions, for the consumer’s own RAG |
omda.list_entities / omda.get_entity |
Browse by doc type, entity status or subject |
omda.ingest |
Hand a document into the store (channel consumer:<id>) |
omda.request_grant |
Ask the owner for access (§8) |
omda.propose_disclosure |
Build an exchange package (§11) for owner approval |
nonconformance, the answer kind and the grant scope applied.withheld:no_grant.A skill runs inside the runtime and analyses the owner’s store. Skills read and report; actions belong to products. Schema.
reads (fields or tiers) generate a plain-sentence permission; triggers: on_ingest, on_query, on_entity_status, schedule:*; outputs: finding, reminder, answer, form_answers (never submitted), proposed_assertion.network_used.A package proves that a genuine conforming runtime read these values from a document the owner holds and that these checks passed. It does not prove the document is genuine unless a value is issuer_signed. Schema · example.
OMDAEvidenceCredential, secured with SD-JWT (VC JOSE-COSE).value, status, checks, method.kind, method.location; never quote, region or page hash.extracted and derived values from issuer_signed, confirmed or verified assertions. The owner MAY include unverified or candidate fields, status-labelled. Generated and ungrounded answers never enter a package.age_over_18, passport_valid_on:<date>) disclose only the result plus the status and checks of their basis.Conformance is proven by running a runtime against shared synthetic fixtures through the MCP binding.
registry/runtimes.json.report.signature is a detached compact JWS (RFC 7515 Appendix F), alg ES256, typ omda-conformance+jws, kid the RFC 7638 thumbprint (SHA-256, base64url) of the publisher’s P-256 key, over the manifest in RFC 8785 canonical form with report.signature set to "". A verifier uses the protected header segment as received. The listing names the manifest and the publisher’s public key (OD-044); reference verifier: tools/omda_tools/signing.py.| Kind | Produced by | Exportable |
|---|---|---|
extracted |
Value taken directly from an assertion | Yes (§11 rules) |
derived |
Deterministic computation | Yes (§11 rules) |
generated |
Model composition via RAG over the store | Never |
ungrounded with no_citation on every surface.See DECISIONS.md.