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_agenttool accepts optionalprojectandphaseparameters- forge-spawn stores them in the new columns on job creation
- Schema migration required
Agent Run Summary Data Sources
- AgentJob (Postgres) — project, phase, conversationId, agentId, taskPrompt, startedAt, completedAt
- MongoDB messages — sender, tokenCount, createdAt per message per conversation
- 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.