OODA Loop API

The OODA Loop (Observe-Orient-Decide-Act) API runs iterative reasoning cycles to analyze situations and make decisions. Each iteration observes the current state, orients through structured analysis, decides on an action, and acts — then checks if the goal has been met. All endpoints require JWT authentication and are rate-limited to 20 requests per minute.

Base path: /api/v2/ooda

Concepts

Four Phases

  • Observe — Gather current state and context
  • Orient — Analyze gaps, threats, and opportunities
  • Decide — Choose an action with confidence score
  • Act — Execute and re-observe

Termination

  • Goal met — checkGoal returns true after re-observe
  • Max iterations — Safety cap (1–20, default 5)
  • Kill signal — External stop via agent.kill()

Status

Check whether the OODA Loop capability is available.

GET/api/v2/ooda/statusAuthenticated

Returns OODA capability status and default configuration.

Request

cURL
400">curl https:400">class="text-zinc-500">//api.lvng.ai/api/v2/ooda/status \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_JWT_TOKEN"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"data": {
    400">class="text-emerald-400">"available": true,
    400">class="text-emerald-400">"defaultMaxIterations": 5,
    400">class="text-emerald-400">"phases": [400">class="text-emerald-400">"observe", 400">class="text-emerald-400">"orient", 400">class="text-emerald-400">"decide", 400">class="text-emerald-400">"act"]
  }
}

Execute

Run an OODA loop synchronously. Returns when the loop completes (goal met or max iterations reached).

POST/api/v2/ooda/executeAuthenticated

Execute an OODA reasoning loop. Returns the final result and full decision journal.

Body Parameters

taskstringrequired

The task or question to analyze.

goalstring

Goal condition to evaluate. Defaults to the task.

maxIterationsnumber

Maximum OODA cycles (1-20, default 5).

rollingWindowSizenumber

Iterations kept in working memory (default 5).

personalityHintstring

Mind Reasoner personality ID for Orient phase routing.

contextobject

Additional context passed to the Observe phase.

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/ooda/execute \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_JWT_TOKEN" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"task": 400">class="text-emerald-400">"Evaluate our API response times and identify bottlenecks",
    400">class="text-emerald-400">"goal": 400">class="text-emerald-400">"Produce actionable optimization recommendations",
    400">class="text-emerald-400">"maxIterations": 3,
    400">class="text-emerald-400">"context": {
      400">class="text-emerald-400">"service": 400">class="text-emerald-400">"voltron-api-server",
      400">class="text-emerald-400">"p95_latency_ms": 450
    }
  }'

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"data": {
    400">class="text-emerald-400">"finalResult": {
      400">class="text-emerald-400">"action": 400">class="text-emerald-400">"Profile the /api/v2/chat endpoint middleware chain",
      400">class="text-emerald-400">"status": 400">class="text-emerald-400">"executed",
      400">class="text-emerald-400">"timestamp": 400">class="text-emerald-400">"2026-03-31T16:15:34.573Z"
    },
    400">class="text-emerald-400">"decisionJournal": [
      {
        400">class="text-emerald-400">"index": 0,
        400">class="text-emerald-400">"decision": {
          400">class="text-emerald-400">"action": 400">class="text-emerald-400">"Profile the /api/v2/chat endpoint middleware chain",
          400">class="text-emerald-400">"confidence": 0.82,
          400">class="text-emerald-400">"reasoning": 400">class="text-emerald-400">"P95 latency of 450ms suggests middleware overhead. Chat endpoint is the most frequent call path."
        },
        400">class="text-emerald-400">"timestamp": 400">class="text-emerald-400">"2026-03-31T16:15:34.573Z"
      }
    ],
    400">class="text-emerald-400">"iterations": 1,
    400">class="text-emerald-400">"goalMet": false,
    400">class="text-emerald-400">"killed": false
  }
}

Execute (Streaming)

Same as execute, but emits real-time Socket.io events during each phase transition. Listen for ooda:phase events to track progress.

POST/api/v2/ooda/execute/streamAuthenticated

Execute an OODA loop with real-time phase events via Socket.io.

Body Parameters

taskstringrequired

The task or question to analyze.

goalstring

Goal condition to evaluate.

maxIterationsnumber

Maximum OODA cycles (1-20, default 5).

personalityHintstring

Mind Reasoner personality for Orient routing.

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/ooda/execute/stream \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_JWT_TOKEN" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"task": 400">class="text-emerald-400">"Analyze competitor pricing strategy",
    400">class="text-emerald-400">"goal": 400">class="text-emerald-400">"Produce actionable pricing recommendations",
    400">class="text-emerald-400">"maxIterations": 5
  }'

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"data": {
    400">class="text-emerald-400">"finalResult": { 400">class="text-emerald-400">"action": 400">class="text-emerald-400">"...", 400">class="text-emerald-400">"status": 400">class="text-emerald-400">"executed" },
    400">class="text-emerald-400">"decisionJournal": [ ... ],
    400">class="text-emerald-400">"iterations": 3,
    400">class="text-emerald-400">"goalMet": true,
    400">class="text-emerald-400">"killed": false
  }
}

Socket.io Events

When using the streaming endpoint or workflow node, the server emits phase transition events.

ooda:phase

Emitted when a phase starts or completes during an OODA execution.

{
  "executionId": "exec-abc123",
  "nodeId": "node-ooda-1",
  "iteration": 2,
  "phase": "orient",        // observe | orient | decide | act
  "status": "completed",    // started | completed
  "timestamp": "2026-03-31T16:15:30.000Z"
}

Errors

  • 400 — Missing task field, or maxIterations out of range (1-20)
  • 401 — Missing or invalid authentication
  • 429 — Rate limit exceeded (20 req/min)
  • 500 — Internal execution error (the decision journal may still contain partial results)