Andre KnuchelSummer 25 – Winter 26BDD 1 · Heritage foundation
Fictional figures

Every result number on this page is fake: the real values were scaled in proportion so the client’s data stays private. The conclusions are unchanged.

Cultural Project Intelligence

Heritage Impact Project 2026 · Albert School B2 · BDD group 1

Every figure keeps the sentence it came from.

The client, an international foundation, funds cultural heritage protection projects in conflict-affected regions, and each project leaves a trail of PDF and Word reports. Our engine reads all of them with the foundation's own AI model. It keeps every useful point together with the exact quote and page behind it, then builds the foundation's 126-column project table from that evidence. The result is ready for Power BI, and any value can be traced back to the report it came from.

101projects extracted (five conflict-affected countries)
10,043points of evidence, each with its verbatim quote
36themes ("buckets") a point can be filed under
126columns in the foundation's project table, filled from the evidence
93%of audited points say exactly what their quotes say

Fictional figures, scaled from the real results.

1In one minute

The idea behind the engine

An AI model reading reports can summarise well and still invent a figure. The engine is designed so that every claim it keeps is tied to text that code can find in the document.

Read everything

Every page, paragraph, table row and scanned image of every report is read, in seven languages, by the foundation's own model on Azure. No other AI ever sees the content.

Keep evidence, not answers

Each useful point becomes an item: a one-line English understanding, the verbatim quote or quotes behind it with file, page and character position, and the themes it belongs to.

Build the table from the evidence

A second engine reads only the stored items, never the documents again. The model states facts with their quotes. Code turns them into table cells, checks them, and sends doubtful cells to a review list.

Why it is built this way

Traceable

Every value links to a quote, a file and a page. A reader can always check the source.

Checked by code

Each quote must appear word for word in the document, or it is sent back for repair, then dropped. Figures must appear in a quote, and dates and amounts are validated.

Honest blanks

An empty cell means "not found", never zero. When documents disagree, every value is kept and flagged. The model never reconciles them.

Confidential by design

Every student signed an NDA. Documents and outputs stay on the local machine. The only output safe to share is a numbers-only summary of each run.

20XX-0001#0017one item, hashed
Understanding
sha256:758ffa2c1c27 one English sentence, written by the model
Quote 1
sha256:98fedbe4ddb3 final report (PDF) · p. 6 · chars 2311–2397
Quote 2
sha256:620cd5ed3cfb foundation analysis (Word) · ¶ 52 · chars 114–190
Buckets
interventionproject_results
Checks
✓ quotes found word for word · ✓ understanding check passed · merged from 2 documents · results vote 3 of 3
Anatomy of one item. Two documents say the same thing, so the engine keeps one item with both quotes. The page and item text are hashed here; in the real data they hold the report's words.

What the engine does not do: it does not score or judge projects. It recognises, extracts and files information, so that people can compare and evaluate projects with the sources in front of them.

2How it works

Method: two engines and one boundary

Engine 1 turns documents into items. Engine 2 turns items into the foundation's table. Everything runs on the local machine, and content only travels to the foundation's model and back.

The foundation's model on Azure the only model allowed to read the foundation's content LOCAL MACHINE · CLIENT_DATA_DIR · CONFIDENTIAL Reports PDF · Word · scans named by Grant ID Ingestion text + OCR, 7 lang. duplicates set aside Engine 1 extract · check merge · vote Evidence item = quote + page + buckets Engine 2 facts → cells code validates Outputs 126-column table Power BI, local files units items items CSV text chunks + prompts ↑ items as JSON ↓ items + column groups ↑ facts with quotes ↓ run_summaries/ numbers only · safe to share counts, IDs, statuses Other AI, cloud, git, web blocked by the NDA rules
Where the data goes. Content travels only between the local machine and the foundation's model. The only thing that leaves the dashed boundary is a numbers-only run summary. The AI coding assistant that built the code reads only those summaries, never the documents.

Engine 1, step by step

The real order of a run. Steps marked "loop" send their own output back for correction before anything is kept.

  1. Prepare
  2. Group files into projectsThe Grant ID at the start of the file name decides the project, not the folder.
  3. Read each documentPyMuPDF and pypdf for PDF, lxml for Word (text boxes, footnotes, table rows), LibreOffice for .doc/.rtf, Tesseract OCR on every image.
  4. Set duplicates asideIdentical files are skipped. Near-copies (85%+ shared) contribute only their new parts.
  5. Reuse stored extractionsAn unchanged document is never paid for twice.
  6. Extract
  7. Chunk and add contextChunks of 12,000 characters at most. An agent adds up to 4 helpful units (annexes, acronyms), marked "context only".
  8. Pass 1: extractionOne call per chunk returns items. A chunk refused by the content filter is split and retried.loop · split
  9. Quote validationEach quote must be found word for word in the text, or it goes back for repair.loop · 2 rounds
  10. Pass 2: missed pointsFixes buckets and adds missed points. Units with no item are re-read while coverage is under 80%.loop · 3 rounds
  11. Pass 3: understanding checkAn understanding may only say what its quotes say; otherwise it is rewritten or dropped.loop · 2 rounds
  12. Consolidate
  13. Merge across documentsThe same point in several documents becomes one item. Each pair is decided twice. Updates and contradictions are flagged.2 readings
  14. Decide bucketsA vote over 3 readings, a separate vote on results, then fixed rules applied by code (for example, location only for verified places).vote · 3
  15. Project profilePartners and their roles, regions, cultures and religions. Each value is marked documents, derived or general knowledge.
  16. Save and exportAn evidence file per project, CSV tables for Power BI, and the numbers-only run summary.

Engine 2: from evidence to the foundation's table

fill_contract.pyClient project table

126 columns, one row per project. 26 metadata columns come from the start of each document, then the file names, then the Intake List. 100 KPI columns cover SDGs, immovable and movable heritage, training, jobs, climate and dialogue. Every cell has its quote in client_evidence.csv.

build_sheets.py · discover_fields.pySheets and new fields

A summary per project and theme, with comparable figures (money in USD at the World Bank rate of its year). Discovery proposes facts that recur across projects as new fields, and the group approves them in a table.

build_field_tree.py · build_final_tables.pyThree levels of detail

Columns that mean similar things are joined with a minimum spanning tree and cut at three levels: same fact, general field, theme. A merged cell keeps every value; nothing is summed.

Where the model calls go

One batch of 10 projects, 21 Oct · 1,101 calls · 0 failed

Only 63 calls (6%) are the first extraction pass. The rest check, repair, merge and vote. That is the cost of accuracy: the agentic engine makes about three times the calls of the baseline.

2How it works

Data samples, hashed

What the tables look like. Each tab shows one of the engine's real output tables, with its real columns and value formats.

How these samples were made. Every text value is replaced by the first 12 characters of a SHA-256 hash of invented placeholder text. Grant IDs and country codes are pseudonyms (20XX-…, XA…) and numbers are invented at a realistic scale. No value from the foundation's data appears on this page; the real tables never leave the confidential data folder.

The fact table of engine 1. One row is one quote of one item in one bucket. Item #0017 from the figure above has 2 quotes and 2 buckets, so it fills 4 rows.

evidence_iditem_idbucketunderstandingquotesource_filepageparagraphchar_start–endextraction_passunderstanding_checkflag
ev-fb331e20XX-0001#0017intervention758ffa2c1c2798fedbe4ddb3doc-2c3e37bf.pdf6—2311–2397primarypassed—
ev-8cc59120XX-0001#0017project_results758ffa2c1c2798fedbe4ddb3doc-2c3e37bf.pdf6—2311–2397result_votepassed—
ev-b951c920XX-0001#0017intervention758ffa2c1c27620cd5ed3cfbdoc-14fe23f5.docx—52114–190primarypassed—
ev-cddb4320XX-0001#0017project_results758ffa2c1c27620cd5ed3cfbdoc-14fe23f5.docx—52114–190result_votepassed—
ev-76b5d520XX-0001#0046financial_information8ee89d00d02d9d377cc69a69doc-2c3e37bf.pdf3—455–538rulepassedpossible update

Counting rule: count points of information with DISTINCTCOUNT(item_id), never by counting rows. The five rows above hold two items.

2How it works

Results on the real reports

First full measurement, 20–21 October 2026. A quality agent re-read 337 items and 131 passages across 14 of the 87 projects extracted at the time. The judge is the same model as the extractor, so this is a second reading, not an independent referee.

UNCERTAIN93%of items are fully faithful to their quotes (target 90%)95% interval 89–97%
GOOD0%of items get their main point wrong95% interval 0–1.9%
FAIL70%of items have all their buckets right (target 85%)95% interval 64–75%
FAIL1.13missed points per passage checked (target under 0.20)95% interval 0.58–2.00

Estimates against targets

Dot = estimate · bar = 95% interval · dashed line = target

The third row is a tested variant: it changes the three code rules that add buckets after the model. It is stored as a separate data set until the group decides. The optimistic count is shown; the pessimistic count is 65%.

Client table: cells filled by column group

101 projects · 21 Oct

2,220 of 12,726 cells filled (17%), 164 flagged for review, 0 failed calls. The SDG group is almost complete. Most heritage, training and jobs KPIs are never stated in the reports.

Field tree: fewer columns, information kept

125 columns · 78 projects

LevelColumnsInformation kept

Columns are joined by meaning using two readings of the foundation's model, on names and definitions only. 47 columns have no value in any project yet.

What works

  • Reading: 150 documents read, none failed; only 10 needed OCR.
  • Faithfulness: understandings say what their quotes say; none gets the main point wrong.
  • First-pass filing: the quality agent would remove only 0.9% of the buckets the first extraction pass assigns.
  • Reliability: a batch of 10 projects ran 1,101 calls with 0 failures, despite 414 rate-limit answers from Azure.

What does not, yet

  • Recall: 1.20 missed points per 1,000 characters; 17% of items leave out a fact their own quote states.
  • Buckets: only 70% of items have every bucket right. Most wrong buckets come from code rules, not the model.
  • Lost quotes: in 2–3 PDFs, many quotes cannot be found word for word in the text layer as read, so their points are dropped.
  • Pace: about 12 minutes per project. Azure's rate limit sets the speed, not the code.

2How it works

The presentation

The final presentation is a four-minute animation in three chapters: the global network of projects, then reports turned into analytics and Power BI, then the network in reverse. It is not published here because it shows the client’s name; three stills from chapter 2 follow.

From the deckThree stills from chapter 2 of the presentation. The report it reads is a fictional example.
A one-page example report on the left with highlighted phrases; on the right the same report as six structured fields: where, what, when, who, how and why.
01 · IngestionOne report becomes structured evidence: where, what, when, who, how, why.
Star schema: a fact table with funding amount, project id, date id and source links, joined to six dimensions: project, time, location, intervention, donor and currency.
02 · ModellingThe evidence joins a fact table and six dimensions: a star schema.
A grid of fifteen project cards, each holding small trees for its aspects such as climate, jobs created, heritage and community. Marked as schematic data.
03 · KnowledgeEach project holds one star per aspect (schematic data in the deck).

3Inside the engine

The details that make it hold

For readers who want to check the reasoning: the themes, what went wrong in quality and why, the data protection, and the decisions the group took.

The 36 buckets (version 2, approved 19 October)

An item goes into every bucket that fits; buckets overlap by design. The grouping into themes below is for reading only, the engine treats all 36 equally. Outlined chips carry a rule applied by code. Hover a chip for its definition.

Why quality is lost, and the fix for each cause

ProblemMain cause foundEvidenceFix
Wrong bucketsCode rules that add buckets after the model (location, sdg_evidence), then the votesRules add 7% of buckets but cause 44% of the removals; the first pass alone, 0.9%Align the rules with the bucket definitions (group decision). The tested variant raises right buckets from 70% to 77%
Missing factsItems that pack several quotes or facts into one short summary12% miss a fact with 1 quote, 25–30% with 2 or more; 37% when the summary is under 0.6× the quote's length"One fact per item" in the prompts (quality plan Q2, not built yet)
Missed pointsOne item taken from a passage holding several facts; much worse on OCR'd text2.37 missed per 1,000 characters when one item quotes the passage, 0.73 with 4 or more; OCR'd pages 5.25 against 0.87Same as above, plus a check of OCR quality
Lost quotesThe PDF text layer of a few documents36–57 lost quotes per 100 PDF pages against 0.37 per 100 Word paragraphs; 68% of all lost quotes in 2 projectsA person inspects those PDFs; re-read and re-extract

Ruled out by the data: merging does not cause the missed points, the repair loops do not cause the missing facts (0 of 12 repaired items), and PDF as a format is not the cause (per character, text PDF pages and Word paragraphs miss about the same).

Client table: why cells stay empty

Run of 21 Oct · 78 projects · every empty cell counted once

Show as a table
Column groupCellsFilledNothing foundNot readLeft out

Nothing found: the evidence was read, but the model found no value. Not read: no item sat in the group's buckets. Left out: a value was found but a rule held it back (unclear or planned status, found only in one of the foundation's own analyses, conflicting values, an invalid date or figure).

Data protection, enforced

Only the foundation's modelThe engine refuses any endpoint that is not https://….azure.com; the Claude client was removed from the code.
Data outside the codeA data folder inside the repository is refused; all outputs go to CLIENT_DATA_DIR.
No content on screenScripts print file names, counts, statuses and error types only.
Assistant fenced inHooks and a sandbox stop the AI coding assistant from reading documents, data folders or .env, and from reaching public AI services.
Shareable outputRun summaries hold numbers and Grant IDs only; a test plants names and text and checks none appear.
Nothing publishedNo git, no cloud, Power BI Desktop only, the .pbix stays in the data folder.

Key decisions by the group

Project keyThe file name decides the project; a file naming several grants belongs to each.
MergingNo merge without the model confirming "same point"; the most complete understanding wins.
BucketsEvery bucket that fits. Version 2 added 5 buckets after stress tests found unstable boundaries (15 of 39 test sentences filed consistently).
ProfileGeneral knowledge is allowed when documents are silent, always labelled. No web search. "Secular" is never inferred from silence.
ConflictsDifferent values stay in the review table; the model never reconciles or sums them.
SDGsOne primary SDG per project: the one the reports make most prominent.
Accuracy vs costAccuracy first (the agentic engine), with stored extractions so nothing is paid for twice.

4Reference

Timeline, open items and where to look

Timeline (2026)

  1. Kickoff with the foundation and Albert School
  2. The foundation's agent kit installed; Earth / Action globe site built
  3. Independent audit of the first engine; 23 of 27 adversarial checks failed and drove the fixes
  4. Data rules enforced; the foundation's Azure model connected; profile, partners, logo agent
  5. Phase 1: cache, OCR of every image, legacy formats, statuses, parallel projects
  6. Umbrella and classification agents; dashboard and presentation briefs; globe prototype
  7. Agentic engine becomes the default; quality improvement plan
  8. Bucket stress tests, then bucket version 2 (36 buckets)
  9. Full extraction in batches of 10; engine 2 built
  10. Quality measured on real reports and diagnosed; field tree; final tables
  11. Complete animated presentation assembled

Open items

  1. Buckets: decide on the code-rules variant (location, sdg_evidence, project_results).
  2. Recall: build "one fact per item"; check OCR; inspect the PDFs that lose quotes.
  3. Independent check: run human_audit.py, the only measure not made by the model.
  4. Umbrellas: approve the recommended groups of related grants.
  5. Engine 2: full field discovery, approval, and wiring approved fields into the sheets.
  6. Power BI: build the dashboard locally on the final tables.
  7. Prototypes: connect a globe dashboard to the real CSVs (server-side); update briefs from 31 to 36 buckets.
  8. Cost: fill config/pricing.yaml so run summaries show costs.

Tech and size

LanguagePython 3.11+: pydantic, PyYAML, PyMuPDF, pypdf, lxml, numpy, openai SDK (pointed at Azure), openpyxl; Tesseract and LibreOffice
ModelThe foundation's own GPT deployment on Azure AI Foundry; no embedding deployment
Code25,300 lines in src/ (60 modules), 14,600 in scripts/ (37), 4,000 in the agents
Tests70 files, 521 passed and 2 skipped (21 Oct), offline on invented data only
DashboardsEarth / Action (React, Vite, d3-geo) and Field / Archive (Next.js 16, Tailwind), both with Power BI embed slots
HistoryNo git (group decision); notes/STATUS_AND_AUDIT_TRAIL.md records about 160 closed items, decisions and incidents

Where to read more

Running itcultural-project-intelligence/README.md, PIPELINE.md
Architectureextractor_explained.md, notes/ENGINE_AND_BUILD.md
Status and decisionsnotes/STATUS_AND_AUDIT_TRAIL.md
Qualitynotes/EXTRACTION_QUALITY_FINDINGS.md, quality.html
Client tablenotes/CONTRACT_PLAN.md, notes/STANDARDISATION_PLAN.md
Power BInotes/POWER_BI_QUICKSTART.md, notes/TABLE_COLUMNS_EXPLAINED.md
Run numbersrun_summaries/

Glossary

Grant ID<year>-<number>, the project key in every table
UnitThe smallest piece of read text: a PDF page, a Word paragraph, a table row, the OCR text of an image
ChunkConsecutive units, at most 12,000 characters; one model call each
ItemOne point of information: understanding + verbatim quote(s) + bucket(s)
BucketOne of 36 themes an item can be filed under
UmbrellaA group of related grants (joint report, phases), approved by the group; ID = U + earliest grant
Agentic engineThe default since 15 Oct: agents, feedback loops and votes on the foundation's model. The baseline is the engine before that date
PartialA project or document where something did not finish; re-run it, finished work comes from the cache
ContractThe foundation's 126-column project table (schema version 1.1.0)