APEX is the document-intelligence system behind the U.S. Strategy Corpus.
Its role is to convert public federal strategy documents into structured, provenance-backed data that downstream products can rely on. It is not primarily a chat or RAG system. Its primary outputs are durable records, review workflows, and APIs.
public federal strategy documents
|
v
registration + ingestion
|
v
structure extraction layer
|
v
provenance resolution layer
|
v
normalization + enrichment layers
|
v
review UI + corpus API surface
|
+--------------+--------------+
| |
v v
Performance.gov and public reporting internal analytics tools
+------------------+ +------------------+ +------------------+
| React Frontend | ----> | FastAPI Backend | ----> | USAI-compatible |
| Vite + TS | | SQLAlchemy | | LLM endpoint |
+------------------+ +--------+---------+ +------------------+
|
+---------------------+----------------------+
| |
v v
+----------+-----------+ +-----------+----------+
| SQLite / corpus DB | | PDF + object storage |
| documents, goals, | | local + S3 fallback |
| objectives, QA, etc. | +----------------------+
+----------------------+
In local development, APEX uses the repo-local corpus and PDFs. In cloud.gov, the current deployment uses the bundled SQLite corpus plus S3-backed PDF serving.
Every meaningful derived field should point back to source evidence.
Examples:
- extracted goal -> source page + source text
- extracted objective -> source page + source text
- future summary -> citations
- future relationship inference -> evidence text + confidence
APEX should behave like a document-state pipeline, not a one-shot prompt.
Core stages:
- registration
- structure extraction
- provenance resolution
- metadata normalization
- document context extraction
- summaries with citations
- relationship extraction
- review and publication
Each stage consumes persisted output from the previous stage.
This is now operational, not aspirational. The production extractor behaves as a multi-stage control loop:
- register the document
- extract candidate hierarchy
- resolve provenance deterministically
- run OCR fallback when native parsing appears structurally weak
- run AI QA over the extracted result
- retry a bounded number of times when the QA findings are repairable
- publish as review-ready or hold for human review
Interpretive layers such as summaries or relationship inference should not silently degrade into synthetic fallback text. If the model is unavailable or the result is not trustworthy, the stage should fail and remain incomplete.
The core asset is the dataset, not the interface. The UI exists to review, validate, and improve the data layer.
Benchmark comparison is not only an evaluation layer. It is how APEX learned which extraction problems mattered most.
Comparing AI-driven extraction against many historical benchmarked plans surfaced recurring defect classes:
- TOC contamination
- heading truncation
- local numbering resets
- page anchoring mistakes
- graphical layout misses
- post-processing regressions on previously good output
Those benchmark findings led directly to architectural behavior:
- provenance refresh is conservative and guarded against downgrades
- OCR fallback is selective
- QA can block publication
- reruns are snapshot-backed
- retries are bounded and stage-aware
Documents represent public strategy artifacts and carry operational metadata:
- agency
- document type
- title
- file path
- fiscal period start/end
- publication year
- administration
- ingestion status and source metadata
The extracted structural layer currently centers on:
- goals
- objectives
- measures for performance-report contexts
Goals and objectives now carry provenance-oriented fields such as:
source_pagesource_textsource_highlight_textsource_headingsource_match_methodsource_confidence
Document context also carries page-aware provenance where available:
mission_pagevision_pagevalues_pages
When benchmark data exists, APEX compares extracted structure against human-prepared data and reports:
- precision
- recall
- F1
- matched and unmatched items
- benchmark applicability/exclusion
APEX also now has a distinct AI-driven extraction QA layer for both benchmarked and unbenchmarked plans. That layer checks:
- structural consistency
- truncation
- numbering
- provenance/source grounding
- document context extraction quality
The next data layers are:
- document-level mission and vision
- values when analytically useful
- grounded summaries with citations
- agency, organization, and stakeholder mentions
- stakeholder roles and relationship types
- inter-goal and interagency relationships
- temporal continuity across administrations
The review surface is intentionally plan-centric.
Current design:
- explore page lists plans, not agencies
- plan review page shows extracted hierarchy on the left
- PDF remains fixed on the right for source verification
- mission, vision, and values appear as first-class extracted items when present
- benchmark data appears when available
- agency collaborator tags open evidence-backed detail dialogs
This aligns the product with the review task: check what was extracted against what the document actually says.
APEX should support a repeatable acquisition process for the public U.S. strategy corpus.
Recommended acquisition model:
- maintain a registry of known agency strategy pages and document families
- fetch or scrape those pages on a schedule
- detect new PDFs by URL, title, and file hash
- download into incoming folders
- register, extract, and review
Important constraints:
- prefer deterministic and auditable collection over broad crawling
- store source URL and retrieval metadata
- preserve exact source files
- support reprocessing when extraction logic improves
- formalize pipeline state beyond in-memory extraction status
- strengthen summary and citation layers, but fail closed when unavailable
- expand relationship extraction beyond agency mentions
- improve acquisition tooling for new public strategy documents
- harden cloud storage patterns beyond PDFs
- add extraction-run history as a first-class persistent model
The current local stack is appropriate for iteration, but the architecture should evolve toward:
- durable pipeline status tracking
- versioned extraction runs
- better migration tooling
- stronger acquisition registry and scheduler
- richer API surface for downstream analytics products
The architecture should continue to optimize for one outcome: a trustworthy system of record for federal strategy.