Documentation
Kairos Trace
Record and replay every autonomous action. Install the SDK, instrument your agent, and replay execution in the dashboard within minutes.
Install
TypeScript / JavaScript
npm install kairos-sdkPython
pip install kairos-traceQuick Start
Three steps: create an execution, record events, complete it. Every execution is immediately replayable in the dashboard.
TypeScript
import { createKairos } from 'kairos-sdk'
const kairos = createKairos()
// Optional: createKairos({ baseUrl: 'http://localhost:8000' })
const exec = kairos.execution({ workflowName: 'my-agent' })
// Record what your agent does
exec.setPrompt('Summarise the Q3 earnings report', 'gpt-4o')
exec.toolCall({ name: 'read_file', input: { path: 'q3.pdf' }, output: { text: '...' }, latencyMs: 240 })
exec.decision('Revenue increased 18% YoY', 0.97)
await exec.complete('Q3 summary: Revenue up 18%...')
// Open /app to replay this executionPython
from kairos import create_kairos
kairos = create_kairos()
exec = kairos.execution(workflow_name='my-agent')
exec.set_prompt('Summarise the Q3 earnings report', model='gpt-4o')
exec.tool_call('read_file', input={'path': 'q3.pdf'}, output={'text': '...'}, latency_ms=240)
exec.decision('Revenue increased 18% YoY', confidence=0.97)
exec.complete('Q3 summary: Revenue up 18%...')Open the dashboard to see the execution and replay it.
Event Types
Record any of these events during execution. Each appears as a step in the replay timeline.
setPrompt(prompt, model?)The prompt sent to the modelsetModel(model)The model used for this executiontoolCall({ name, input, output, latencyMs })Any tool or function called by the agentdecision(reasoning, confidence)A decision made by the agent (0–1 confidence)policyCheck(policy, result)A governance policy that was evaluatedmemoryWrite(key, value)Something written to agent memorymemoryRead(key)Something read from agent memorysetTokens(prompt, completion)Token usage for cost trackingsetCost(usd)Cost of this execution in USDretry(reason)A retry was triggeredevent(type, payload)Any custom eventcomplete(output)Execution completed successfullyfail(error)Execution failed with an errorReplay
Every execution is automatically replayable. No extra configuration needed.
Open the dashboard, select an execution, and use the replay controls to step through each event — forward, backward, or at any speed.
What replay shows you:
API Reference
The Kairos API is available at:
https://kairos-production-64c5.up.railway.appInteractive docs (Swagger UI):
https://kairos-production-64c5.up.railway.app/docsSelf-hosting
git clone https://github.com/withkairos/kairos
cd kairos/kairos-core
pip install -r requirements.txt
# Set DATABASE_URL env var
uvicorn main:app --reload --port 8000Then point your SDK at the local server:
const kairos = createKairos({ baseUrl: 'http://localhost:8000' })Python SDK
pip install kairos-traceThe Python SDK has zero required dependencies. It uses the standard library by default and switches to httpx automatically if installed.
from kairos import create_kairos
kairos = create_kairos(
base_url='https://kairos-production-64c5.up.railway.app', # default
debug=False,
)
exec = kairos.execution(workflow_name='my-agent', agent_id='agent-1')
exec.set_prompt('Research EU AI Act', model='claude-sonnet-4-6')
exec.tool_call('web_search', input={'query': 'EU AI Act 2025'}, output={'results': [...]}, latency_ms=1200)
exec.decision('EUR-Lex most authoritative', confidence=0.93)
exec.memory_write('eu_act_summary', 'High-risk AI systems require...')
exec.set_tokens(prompt_tokens=312, completion_tokens=840)
exec.set_cost(0.0118)
exec.complete('Summary: ...')