Skip to content
archived Visibility internal Owner erik@uvilo.com Approver _ Created 2026-06-13 Updated 2026-06-13

AgentJob Schema

AgentJob table and data sources for Agent Run Summary, extracted from Research Section 9.

Current AgentJob Columns

id, conversationId, agentId, taskPrompt, status, startedAt, completedAt, retryCount, parentJobId, metadata (JSONB)

New Columns

project TEXT — project name (e.g., “Project_Automation”) phase TEXT — phase name (e.g., “Implement_1_Started”)

Projects are first-class citizens — not metadata. These columns are standard SQL, queryable, indexable. The JSONB metadata column remains for unstructured data (mode, requiredTools, etc.).

forge-spawn Changes

  • spawn_agent tool accepts optional project and phase parameters
  • forge-spawn stores them in the new columns on job creation
  • Schema migration required

Agent Run Summary Data Sources

  1. AgentJob (Postgres) — project, phase, conversationId, agentId, taskPrompt, startedAt, completedAt
  2. MongoDB messages — sender, tokenCount, createdAt per message per conversation
  3. LangFuse Observations API — model, usageDetails, costDetails, latency per conversation

Agent Run Summary Output Schema

Per conversation:

  • Agent/model used
  • Task/message given
  • Duration
  • Token usage per turn and total
  • Cost

Plus: total cost across all conversations for the project.