Skip to content

ProjectExtraction

A ProjectExtraction records a single attempt to pull one kind of structured data out of a project’s source document.

The intelligence report attached to a project is parsed by a set of agents, one per data kind (outcome, people, geography, governance and so on). Each run writes a row here capturing which kind was attempted, whether it succeeded, which model was used, how long it took and any error message. The rows form an audit trail behind the extraction status panel and its per-kind history.

Rows are written by the extraction job and read by the staff status panel.

  • app/Jobs/RunProjectExtractionJob.php — creates the row, runs the agent, and marks it succeeded or failed.
  • app/Filament/Resources/ProjectResource.php — renders the extraction status panel and history.
  • ProjectExtraction::latestPerKind() — returns the most recent row per ExtractionKind for a project, one card per kind.
  • scopeRecentHistory() — the last N rows for one project and kind, used by the history modal.
Relation Type Related model
project belongsTo Project
intelligenceReport belongsTo Attachment

The inverse is Project::extractions().

Table project_extractions. Primary key is a UUID (HasUuids).

Column Type Notes
id uuid Primary key
project_id uuid FK to projects
intelligence_report_id uuid Nullable, FK to attachments
kind ExtractionKind Enum cast, see values below
status ExtractionStatus pending, succeeded, failed
model_used string Nullable, AI model identifier
started_at datetime Nullable
finished_at datetime Nullable
duration_ms integer Nullable, run time in milliseconds
error_message text Nullable, set on failure
created_at, updated_at datetime Timestamps

ExtractionKind values: outcome, people, weighting_influences, career_mobility, groupings, taps_roadmap, governance, geography, industry_trends. Each case maps to an agent class and an importer service in app/Enums/ExtractionKind.php.