Skip to content
nikcli
Docs
Documentation

Brain

Background learning status and the manual trigger that forces a pass.

Playground

Send these requests to your own running server. Values stay in this browser.

Not connected
How this works

Start a server with nikcli serve --hostname 127.0.0.1 --port 4096. Requests go straight from this page to that address — the browser allows it because loopback counts as a secure origin, and the server allows it because nikcli-ai.dev is in its CORS allowlist.

To try things without touching your real sessions or config, start the server with NIKCLI_TEST_HOME pointed at a throwaway directory — see the guided tour.

Operations

2 endpoints, generated from the server's own OpenAPI document. Every path also accepts the directory and workspace query parameters that select which instance handles the request.

get /brain brain.status
post /brain/trigger brain.trigger
get /brain # brain.status
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Responses
200 BrainStatus application/json
{
  enabled: boolean
  memoryEnabled: boolean
  minHours: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  minSessions: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  lastBrainAt: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  hoursSinceLastBrain: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  sessionsSinceLastBrain: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  shouldTrigger: boolean
  model?: 
    | {
    providerID: string
    modelID: string
  }
    | null
}
Example response from schema
{
  "enabled": false,
  "memoryEnabled": false,
  "minHours": 0,
  "minSessions": 0,
  "lastBrainAt": 0,
  "hoursSinceLastBrain": 0,
  "sessionsSinceLastBrain": 0,
  "shouldTrigger": false,
  "model": {
    "providerID": "",
    "modelID": ""
  }
}

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
brain.status
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.brain.status({
  ...
})
Try it
post /brain/trigger # brain.trigger
Parameters
Name In Type Required
directory query string optional
workspace query string optional
Request body · required · application/json
{
  force?: boolean | null
  sessionID?: string | null
}
Responses
200 BrainResult application/json
{
  success: boolean
  sessionsReviewed: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  hoursSinceLastBrain: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  error?: string | null
  sessionID?: string | null
}
Example response from schema
{
  "success": false,
  "sessionsReviewed": 0,
  "hoursSinceLastBrain": 0,
  "error": "",
  "sessionID": ""
}

Generated from the response schema — field values are placeholders, the shape is real.

SDK example
brain.trigger
ts
import { createNikcliClient } from "@nikcli-ai/sdk/httpapi"

const client = createNikcliClient()
await client.brain.trigger({
  ...
})
Try it

Schemas

The 3 schemas reachable from these endpoints. Each is shown one level deep; nested types link to their own entry below. Names ending in _2, _3 and so on are the OpenAPI emitter disambiguating same-named schemas declared by different HttpApi groups — they are distinct shapes, not duplicates.

BrainResult
{
  success: boolean
  sessionsReviewed: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  hoursSinceLastBrain: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  error?: string | null
  sessionID?: string | null
}
BrainStatus
{
  enabled: boolean
  memoryEnabled: boolean
  minHours: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  minSessions: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  lastBrainAt: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  hoursSinceLastBrain: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  sessionsSinceLastBrain: 
    | number
    | "Infinity" | "-Infinity" | "NaN"
  shouldTrigger: boolean
  model?: 
    | {
    providerID: string
    modelID: string
  }
    | null
}
BrainTriggerInput
{
  force?: boolean | null
  sessionID?: string | null
}