How to Create an Extractor¶
Last verified: 2026-07-26 against dev at f0388abb.
Use this guide when SDP needs a new worker that can extract fields from a document type.
Inputs¶
- Extractor name. It must be a valid Python identifier.
- Supported document types and dependencies.
- Target schemas/processors.
- Local and deployed queue/function-app names.
- Infrastructure owner for Azure resources.
Procedure¶
- Create the extractor package.
Add extractor_apps/extractors/<extractor_name>/extractor.py with a class
implementing the DocumentExtractor protocol.
- Add extractor dependencies.
Update extractor_apps/pyproject.toml dependency groups and include the
group in local development if needed.
- Wire local container support.
Update extractor_apps/Dockerfile and compose.dev.yaml so the extractor
can run locally.
- Register the backend extractor.
Update backend/src/altaforge_sdp/extractors/extractor_registry.py.
- Add Service Bus and infrastructure wiring.
Add a queue named after the extractor and update the relevant Terraform in
altaforge-infrastructure.
- Run locally.
Use Run extractor workers locally and extractor_apps/README.md.
- Verify end-to-end.
Upload a representative document, process it through a batch run, and review extracted fields in the frontend or API.
Known Pitfalls¶
- Backend registry entries and deployed function apps are not automatically synchronized.
- Renaming/removing extractors can leave stale rows in the database.
- Some extractors have large memory requirements; deployed
code 137failures usually indicate container memory pressure.