Portable AI-ready documents with built-in trust, evidence, governance, and auditability.
pip install gallodoc
gallodoc connector convert --connector generic_json --input my.json --out env.gdoc.json
gallodoc validate env.gdoc.json
gallodoc aibi plan "show invoices linked to John" --envelope env.gdoc.jsonIn minutes you can:
- convert raw data into governed envelopes
- validate AI-safe document structure
- attach evidence + trust metadata
- generate safe natural-language query plans
For details see the audience-targeted positioning docs:
| Doc | Audience |
|---|---|
docs/positioning/what-is-gallodoc.md |
New users β 90-second pitch |
docs/positioning/pdf-on-steroids.md |
Practitioners coming from PDF workflows |
docs/positioning/connector-guide.md |
Connector developers |
docs/positioning/semantic-encoder-guide.md |
Embedding-pipeline developers |
docs/positioning/linker-guide.md |
Ops engineers running the linker |
docs/positioning/training-guide.md |
ML engineers reproducing gallodoc-bge-m3-v1 |
docs/positioning/privacy-and-governance-guide.md |
Compliance / governance leads |
For the full spec: docs/specs/gallodoc-core-v3-master-spec.md.
For migration from v1: docs/migration/v1-to-v3.md.
GalloDoc is an open standard for portable operational intelligence documents.
A GalloDoc envelope is one JSON file that captures everything a downstream auditor, reviewer, or AI/BI query engine needs to verify, reproduce, or extend the operation that produced it. Inputs (by hash). Models (by version). Prompts (by hash β never the raw text). Outputs. Evidence. Reviewer decisions. Trust scores. Relationships to other envelopes.
GalloDoc is:
A simple JSON format that grows with you β from basic document storage β to full AI trust and governance.
You donβt need everything.
Each level works on its own.
{
"document": {
"doc_id": "123",
"type": "contract"
},
"content": {
"text": "This agreement is between..."
}
}β Validate documents β Store structured data β Build simple APIs
{
"artifacts": [
{
"family": "line_items",
"data": [
{ "item": "Service A", "price": 100 }
]
}
]
}β Extract fields β Normalize messy documents β Compare across systems
{
"ai_outputs": [{ "type": "classification", "result": "high_risk" }],
"evidence": [{ "type": "document", "reference": "clause_12" }]
}β AI results with proof β Explainable outputs β RAG-ready structure
{
"trust": { "score": 92 },
"decisions": [{ "action": "approve" }]
}β Trust scoring β Decision tracking β Audit-ready workflows
{
"agent_supply_chain_security": {
"risk_level": "high",
"decision": "block"
}
}β Scan AI tools / agents β Detect malicious behavior β Secure automation
GalloMarkdown (.gmd) is a human-readable layer for GalloDoc.
JSON GalloDoc remains canonical. GalloMarkdown is for authoring,
review, and audit packets.
# GalloDoc: Contract Review
::gallodoc
doc_id: doc-contract-001
document_type: contract
::
## Content
A 12-month managed-services agreement withβ¦
## Trust
::trust score=92 level=HIGH
grade: A
status: trusted
explanation: All evidence verified.
::
## Decisions
::decision action=approve confidence=0.91 id=gate-001
reason: evidence_validated
::gallodoc md compile examples/markdown/contract_review.gmdGalloMarkdown is bidirectional:
# Render an existing GalloDoc envelope as readable Markdown.
gallodoc md render examples/v1_6/gallodoc_agent_supply_chain_security.json --out review.gmd
# Edit it.
$EDITOR review.gmd
# Compile it back to canonical JSON.
gallodoc md compile review.gmd --out review.gallodoc.jsonRoundtrip safety: the renderer redacts unsafe content (raw prompts,
secrets, PHI patterns, private keys) and writes a
::warning type=safety_redaction block. The compiler rejects the same
patterns at parse time. JSON is the source of truth.
Spec: docs/specs/gallomarkdown-v1.md.
Start with documents, not JSON.
gallodoc convert contract.pdf
gallodoc convert report.docx
gallodoc convert notes.txt
gallodoc convert export.jsonGenerates:
contract.gmd # human-readable projection
contract.gallodoc.json # canonical envelope
Phase 1 formats (stdlib-only): .txt, .md, .gmd, .json,
.csv, .html, .xml, .eml.
Phase 2 formats (optional packages): .pdf (pip install gallodoc[pdf]),
.docx (pip install gallodoc[docx]), .xlsx (pip install openpyxl).
Useful flags:
gallodoc convert contract.pdf \
--to both \
--out-dir ./out \
--redaction-mode auto \
--extract-artifacts \
--validate \
--prettyINPUT PDF / API / Email / FHIR / JSON
β
GalloDoc
- structured data
- extracted evidence
- relationships
- lifecycle
β
OUTPUT
β Trust score β Audit packet β Policy validation β Export-ready data
Most systems:
- store data
- move data
- expose data
They do NOT prove it.
GalloDoc does.
- GalloUnits β stable semantic evidence layer
- AI usage ledger β full traceability (hashes only)
- Artifact extraction β structured signals
- GSTP β tamper-evident packaging
All:
- local
- offline
- zero required dependencies
- Document AI pipelines
- RAG systems with proof
- Audit/compliance systems
- AI decision engines
- Secure agent platforms
GalloDoc is designed to be safe by default:
- β No raw prompts/responses
- β No secrets
- β No PHI leakage
Only:
- hashes
- summaries
- structured data
examples/
basic.json
structured.json
ai.json
trust.json
security.jsonGalloDoc turns documents into:
Verifiable, trusted AI-ready data
GalloDoc Core 3.0.0 β Python package 3.0.0, Development Status :: 4 - Beta
Schema family: gallodoc-core/v3 (with parallel gallodoc-core/v1 validator for 6 months from 2026-05-17)
| Version | Focus |
|---|---|
| v1.0 | Document envelope |
| v1.1 | Governance |
| v1.2 | Consent + custody |
| v1.3 | Risk + residency |
| v1.4 | Observability |
| v1.5 | Trust + decisions |
| v1.6 | Agent supply chain |
| 2.0 | Query Β· Vector Β· Relationships Β· Versioning Β· Policy Β· Access Β· Human Review Β· Workflow Β· Connector Lineage Β· Compute Trace Β· Artifact BOM |
| 2.1 | GalloMarkdown (.gmd) authoring/review layer + document conversion |
| 3.0 | Envelope rev to gallodoc-core/v3 β consolidated trust + relationships + source + lifecycle; new federation block; open-source connector SDK, linker, embeddings adapter, training lab, trained-embedder recipe, NLβGQL planner |
- 3.0 master spec:
docs/specs/gallodoc-core-v3-master-spec.md - 3.0 release notes:
RELEASE_NOTES_3.0.0.md - v1 β v3 migration guide:
docs/migration/v1-to-v3.md - 2.1 release notes:
RELEASE_NOTES_2.1.0.md - 2.0 release notes:
RELEASE_NOTES_2.0.0.md
gallodoc validate examples/gallodoc_pdf_contract.json
gallodoc inspect examples/gallodoc_pdf_contract.json --json
gallodoc units sample.txt --json
gallodoc extract sample.txt --json
gallodoc gstp verify path/to/package.gstp/
# GalloMarkdown β bidirectional authoring/review layer (v2.1)
gallodoc md compile examples/markdown/contract_review.gmd
gallodoc md render examples/v1_6/gallodoc_agent_supply_chain_security.json
gallodoc md roundtrip examples/markdown/contract_review.gmd
# Document conversion (v2.1)
gallodoc convert examples/conversion/text_sample/sample.txt --validateGalloDoc also supports:
- full provenance tracking
- AI usage ledger (hash-based)
- GalloUnits (model-agnostic evidence units)
- GSTP verification
See:
(Your existing GIF + image block stays here)
Start simple. Add trust when you need it.
Apache 2.0
See SECURITY.md.
Never submit real PHI or secrets.
Simple to start. Powerful when you need it.