Orchestrator

Plans & dispatches

The top-level reasoner. Reads the user's question, decides which specialists own which steps, runs the doom-loop guard, and routes the critic-revision loop.

On every /q requeston-demand

What this agent actually does, step by step.

  1. 01

    Receives the plain-English question via POST /api/agent

  2. 02

    Calls Codex once for reasoning + once for the JSON-schema-validated plan

  3. 03

    Validates the plan with two post-validators (scope check + plan-shape check)

  4. 04

    Dispatches each step to the right tool or specialist via deterministic routing

  5. 05

    On step failure or doom-loop pattern, re-prompts the planner with the failure envelope

  6. 06

    Hands the final result set to the synthesizer + critic

Inputs & outputs.

Inputs

  • · query: string
  • · dataset?: string (scope-anchor)
  • · demo?: boolean
  • · fallback?: boolean

Outputs

  • · SSE event stream: reasoning → planning → executing → step_done → done
  • · Final ToolEnvelope with answer + citation + artifacts + token usage + duration

Where this agent lives in the codebase.

app/lib/agent.ts

reasonAndPlan / replan / synthesize / criticize

app/api/agent/route.ts

SSE endpoint + dispatch loop

app/lib/doomLoop.ts

loop detection guard

Last 12 runs that touched this agent.

auto-refresh 60s

  • 03:29 AM

    Which zip has the highest crime severity and lowest permit volume?

    18 events · 3syk-w9eu

    Replay →
  • 03:29 AM

    Which zip had the highest simultaneous spike in permits and violations?

    22 events · 6wtj-zbtb

    Replay →
  • 03:29 AM

    Which zip had the highest permit count in the last month?

    11 events · 3syk-w9eu

    Replay →
  • 03:28 AM

    Which zip had the highest number of traffic fatalities this year?

    26 events · y2wy-tgr5

    Replay →
  • 03:28 AM

    Which zip had the highest average Heat Index over the last 5 years?

    9 events · no citation

    Replay →
  • 03:28 AM

    Which specific neighborhoods in Austin have the most construction permits?

    16 events · 3syk-w9eu

    Replay →
  • 03:28 AM

    Which restaurants in 78704 have shown the most improvement over 2 years?

    19 events · ecmv-9xxi

    Replay →
  • 03:27 AM

    Which restaurant in 78704 has had the most failing inspections this year?

    13 events · ecmv-9xxi

    Replay →
  • 03:27 AM

    Which request type has seen the largest increase in Dallas this year?

    11 events · gc4d-8a49

    Replay →
  • 03:27 AM

    Which outlier has the highest permit valuation in 78701?

    18 events · 3syk-w9eu

    Replay →
  • 03:26 AM

    Which flood-prone zip had the highest 311 volume this year?

    18 events · xwdj-i9he

    Replay →
  • 03:26 AM

    Which contractor has the highest permit count in 78701 this year?

    13 events · 3syk-w9eu

    Replay →