agentiq.trace()
Called once per agent step. Passes:
session_id, user_input, agent_response, response_time_ms, workflow_stepEvery component, data path, table, and background loop. Do not share externally.
session_id, user_input, agent_response, response_time_ms, workflow_stepput_nowait() — drops silently if full. Backpressure never reaches your agent.agentiq_traces.log written on every event. Backup if DB and API are both unreachable.201 immediately. Auth: AGENTIQ_API_KEY header.agent_id — multi-tenant isolation.accuracy · goal_alignment · decision_quality · completenesseval_error=True.passed=False · eval_error=False for the last 7 days.| Rule | Where enforced | Why |
|---|---|---|
| trace() never raises | sdk/client.py — entire body in try/except | AgentIQ bugs must never take down the developer's agent |
| trace() returns in <1ms | put_nowait() into queue — no network wait | Same reason |
| Queue drops silently if full | Queue(maxsize=500) + put_nowait() | Backpressure must never reach the agent |
| Eval never runs in trace path | Background loop only — 30s after trace | LLM calls are 200–800ms — cannot be in the hot path |
| failure_reason = one English sentence | Judge prompt — explicitly required | Raw JSON must never reach dashboard or API clients |
| All SQL in db/queries.py | Convention + code review | Single place to audit, optimize, and test all queries |
| Every query scoped to agent_id | All routes + queries filter by agent_id | Multi-tenant — one customer cannot see another's data |