ai-karman-manager/
ai-karman-manager/
scripts/
docs/
_extensions/
_quarto.yml
KARMAN_2026.md
KARMAN_2026.sync-conflict-20260802-120012-WRHFNHE.md
KARMAN_PDAI_STRUCTURE.md
KARMAN_PREVIEW_EXAMPLE.md
quickstart.qmd
SYNCTHING_KARMAN_ARCHIVE_SETUP.md
SYNCTHING_REFERENCE.md
USAGE.md
USAGE.sync-conflict-20260802-120012-WRHFNHE.md
scripts/
async_content_pilot.py
async_ocr_pilot.py
audit_attributions.py
audit_processed_xml.py
build_content_db.py
build_place_country.py
build_reocr_worklist.py
build_reprocess_queue.py
continuous_ocr.sh
enrich_stanza_letters.py
install-hub.sh
install-source.sh
kimi_ocr_pilot.py
prepare_collection.py
src/
karman_manager/
pdai_sync/
AGENTS.md
AGENTS.sync-conflict-20260802-120013-WRHFNHE.md
AGENTS.sync-conflict-20261012-173252-AVCNEIG.md
AGENTS.sync-conflict-20261012-173350-AVCNEIG.md
AGENTS.sync-conflict-20261012-200754-AVCNEIG.md
apply_syncthing_mac_air.sh
check_karman_archive_sync.sh
check_pdai_status.sh
clean_previews.sh
config.toml
HOWTO.md
PROJECT.yaml
pyproject.sync-conflict-20260802-120013-WRHFNHE.toml
pyproject.sync-conflict-20261012-173035-AVCNEIG.toml
pyproject.sync-conflict-20261012-173350-AVCNEIG.toml
pyproject.sync-conflict-20261012-200607-AVCNEIG.toml
pyproject.toml
QUICKSTART.md
README.md
README.sync-conflict-20260802-120012-WRHFNHE.md
reprocess_50.sh
reprocess_50.sync-conflict-20260802-120012-WRHFNHE.sh
restart_ocr_after_sync.sh
run_batch_folders.py
run_batch_folders.sync-conflict-20260802-120013-WRHFNHE.py
run_gemini_comparison.py
run_gemini_comparison.sync-conflict-20260802-120012-WRHFNHE.py
[DRAFT — edit this] AI Edition package for converting Theodor von Karman Nachlass scans to structured XML Inferred stage: development. Define the specific deliverable, success state, and timeline.
Success criteria:| Code | /Users/friedrichstr/ai-mac-studio/scholarly/projects/ai-karman-manager |
| Docs | /Users/friedrichstr/ai-mac-studio/scholarly/projects/ai-karman-manager/docs |
| Check | Path | Status | Detail |
|---|---|---|---|
| code | /Users/friedrichstr/ai-mac-studio/scholarly/projects/ai-karm | ✓ ok | 53 items, last_modified=2026-08-24 |
| docs | /Users/friedrichstr/ai-mac-studio/scholarly/projects/ai-karm | ✓ ok | 14 items, last_modified=2026-08-14 |
Comprehensive AI Edition package for converting the digitized Collection of Theodor von Karman Nachlass scans to structured XML format.
KarmanManager processes scanned images from the KarmanArchive and converts them into structured XML with automatic recognition of letter metadata (sender, recipient, date, place). The package uses google-genai for the optional Gemini backend and local Ollama / LM Studio clients for the primary 2026 OCR workflow.
img/ and xml/ folder structurecd /Users/friedrichstr/ai-mac-air/scholarly/projects/ai-karman-manager
uv sync
On Mac Air, KarmanConfig.from_env() auto-detects the Syncthing mirror (/Volumes/golden4T/karman-archive-studio) if the environment variables are not set. On other hosts, export them explicitly.
# Mac Air
export KARMAN_ARCHIVE_PATH="/Volumes/golden4T/karman-archive-studio"
export KARMAN_OUTPUT_PATH="/Volumes/golden4T/pdai-collections/karman-nachlass"
export KARMAN_OCR_TEMP="/Volumes/golden4T/tmp/ai-ocr-karman"
# Mac Studio
export KARMAN_ARCHIVE_PATH="/Volumes/pdai-1/KarmanArchive"
export KARMAN_OUTPUT_PATH="/Volumes/pdai-1/pdai-collections/karman-nachlass"
export KARMAN_OCR_TEMP="/Volumes/pdai-1/tmp/ai-ocr-karman"
The Dropbox copy of KarmanArchive on Mac Air is cloud-only and cannot be read locally. The real source (/Volumes/pdai-1/KarmanArchive on Mac Studio) is mirrored to /Volumes/golden4T/karman-archive-studio via Syncthing, managed by the pdai-sync CLI integrated in this workspace (src/pdai_sync/).
bash
cd /Users/friedrichstr/ai-mac-air/scholarly/projects/ai-karman-manager
uv run pdai-sync applybash
./check_karman_archive_sync.shbash
uv run karman-ingestSet the Gemini API key if you use the Gemini backend:
export GEMINI_API_KEY="your-api-key"
# or
export GOOGLE_API_KEY="your-api-key"
karman-manager process \
--archive-path "$KARMAN_ARCHIVE_PATH" \
--output-path "$KARMAN_OUTPUT_PATH" \
--backend ollama \
--ollama-model qwen3.5:cloud
karman-manager process \
--archive-path "$KARMAN_ARCHIVE_PATH" \
--output-path "$KARMAN_OUTPUT_PATH" \
--backend ollama \
--ollama-model qwen3.5:cloud \
--folder "1-20_ANGUS_ROBERT_W_1928-1942"
For the new simplified structure (img/ and xml/ folders) and the canonical PDAI layout, use the monitored script:
cd /Users/friedrichstr/ai-mac-air/scholarly/projects/ai-karman-manager
export KARMAN_ARCHIVE_PATH="/Volumes/golden4T/karman-archive-studio"
export KARMAN_OUTPUT_PATH="/Volumes/golden4T/pdai-collections/karman-nachlass"
export KARMAN_OCR_TEMP="/Volumes/golden4T/tmp/ai-ocr-karman"
uv run python run_sample_2026_monitored.py
If the Syncthing mirror is not yet complete, generate a structural preview first:
uv run karman-ingest-preview --folder 1-20_ANGUS_ROBERT_W_1928-1942
See docs/KARMAN_PREVIEW_EXAMPLE.md for the expected preview XML output.
See docs/KARMAN_2026.md for the Mac-Air-specific workflow, docs/KARMAN_PDAI_STRUCTURE.md for the full PDAI collection contract, docs/SYNCTHING_KARMAN_ARCHIVE_SETUP.md for the mirror setup, and docs/SYNCTHING_REFERENCE.md for the complete Syncthing architecture reference.
KarmanArchive_XML/
├── 1-1_ABRAHAM_MAX_1921-1922/
│ ├── 1-1_ABRAHAM_MAX_1921-1922_0001.xml
│ ├── 1-1_ABRAHAM_MAX_1921-1922_0002.xml
│ └── ...
├── 1-2_ACKERET_JACOB_1935-1958/
│ └── ...
└── collection_metadata.xml
karman2026/
├── 1-1_ABRAHAM_MAX_1921-1922/
│ ├── img/
│ │ ├── 1-1_ABRAHAM_MAX_1921-1922_0001.jpg
│ │ └── ...
│ └── xml/
│ ├── 1-1_ABRAHAM_MAX_1921-1922_0001.xml
│ └── ...
└── ...
The output XML follows the ai-ocr format:
<page pidx="N">
<meta model="qwen3.5:cloud" instruction_template="karman_letter_ocr" lang="orig" processed_date="..." />
<header>...</header>
<main>
<letter number="N">
<from>Sender Name</from>
<to>Recipient Name</to>
<place>Location</place>
<date>Date</date>
</letter>
<p>Letter content...</p>
</main>
<footnotes>...</footnotes>
</page>
setup_karman_archive_sync_mac_studio.py — Deprecated. Use uv run pdai-sync apply instead (drives Mac Studio remotely over Tailscale; no need to run anything on Mac Studio).pdai-sync (integrated CLI, src/pdai_sync/) — Syncthing control plane: uv run pdai-sync apply, probe, status --all, set-key, device-id. Config in config.toml.check_karman_archive_sync.sh — Checks the Syncthing mirror status on Mac Air.wait_for_sync.sh — Polls the Syncthing mirror until it is idle and complete.karman-ingest — Ingests the mirrored source archive into the PDAI collection layout.karman-ingest-preview — Generates PDAI-conform preview XMLs before the mirror/OCR data is available.run_karman_2026_pipeline.sh — End-to-end pipeline: sync-check → ingest → OCR sample.restart_ocr_after_sync.sh — Clean previews, wait for sync, ingest, and run OCR (useful after Mac Studio source updates).check_pdai_status.sh — Quick status overview of the karman-nachlass PDAI collection.clean_previews.sh — Removes preview XMLs and resets registry status before a real OCR run.run_pdai_ocr_batch.py — Batch Stage-A OCR over many PDAI documents with adaptive concurrency (--from-file <doc_ids.txt> or --doc-ids a,b,c; defaults to every doc in the collection).google-genai: For the optional Gemini backend (never google-generativeai)lxml: For XML buildingPillow: For image processingjinja2: For template renderingtqdm: For progress bars and monitoringrequests: For API communicationApache-2.0
| SHA | Date | Subject |
|---|---|---|
0d9883e | 2026-07-05 | feat(viewer): mature karman-nachlass viewer into archive browser |
0d12ee1 | 2026-03-14 | chore: initial commit (ai-platform v2 git infrastructure) |