Skip to main content

Invocation Logs

Every agent.run() call is recorded as an invocation. Use the Invocation Logs tab to debug agent behaviour, inspect tool calls, audit prompts, and track LLM costs per tenant.

Viewing Invocations

Go to App Panel → your app → AI → Invocation Logs.

Invocation logs list

The header bar shows a live summary — Total Runs, Today, Errors (24h), and Cost Today — updated on each refresh.

Use the filters to narrow down the list by agent, provider, status, trigger source, short-term memory, and date range.

Each row in the list shows:

ColumnDescription
IDUnique run identifier (e.g. run_0008)
TimestampWhen the run was initiated
AgentThe agent that was invoked
Provider / ModelThe provider configuration and model used
TokensInput / output token counts for the full run
CostTotal USD cost for this run
LatencyWall-clock time from start to final response
TriggerUser, System, or Task — set via triggered_by in agent.run()
StatusSuccess, Failed, or Timeout

Rounds

Click the arrow on any row to expand it. Each run can consist of multiple rounds — one LLM call per round. Multi-round runs occur when the agent calls a tool and then makes a second LLM call to process the tool result.

Expanded invocation showing rounds

Each round (e.g. r1, r2) is listed with its own token count, cost, latency, and status. Click a round to open its detail tabs.

Round Detail Tabs

Request / Response

Shows the full message sequence for that round in conversation order:

FieldDescription
System PromptThe rendered system instruction sent to the model
UserThe user message (with variables already substituted)
LLM ResponseThe model's reply; if it called a tool, this shows the tool name and the arguments passed

Request/Response tab — tool call round

For rounds where a tool call completed, the Tool Call block shows the tool name, its Input (arguments the LLM passed), and the Result returned by your code. The final LLM response below it shows how the model used that result.

Request/Response tab — tool result and final response

Prompt

Shows the prompt configuration used for this round.

Prompt tab

FieldDescription
System PromptName and version of the system prompt attached to the agent
User PromptName and version of the user prompt attached to the agent
Rendered System PromptThe final text sent to the model after variable substitution
Context SnapshotThe variables passed at runtime — variables (user prompt) and system_variables (system prompt)

Cost Breakdown

Per-round token and cost detail.

Cost Breakdown tab

FieldDescription
Stop ReasonWhy the model stopped generating (end_turn, tool_use, etc.)
Input TokensTokens in the prompt sent to the model
Output TokensTokens in the model's response
Cache Creation TokensTokens written to the provider's prompt cache
Cache Read TokensTokens read from the provider's prompt cache
Total CostUSD cost for this round
LatencyTime taken for this round in milliseconds

Metadata

Low-level invocation metadata and the raw request parameters sent to the LLM API.

Metadata tab

FieldDescription
Triggered BySource of the invocation (user, system, task)
User IDThe authenticated user who triggered the run, if applicable
Celery Task IDSet when the invocation was triggered from an async task
AgentAgent name
ProviderProvider configuration name
ModelModel identifier used
StatusFinal status of this round
Error TypeError class if the round failed
CreatedExact timestamp of the round
Time to First TokenLatency to the first token from the LLM
Request ParamsRaw parameters sent to the API (e.g. max_tokens, temperature)

File Attachments in Logs

When files are passed to agent.run() via files=, each file is automatically saved to the tenant's storage for audit purposes. The invocation detail view displays them in an Attached files section above the message sequence.

FieldDescription
FilenameOriginal filename — shown as a clickable download link when the file was mirrored to storage
Media typeMIME type (e.g. image/png, application/pdf)
SizeFile size in B / KB / MB
SourceMirrored — bytes were saved to tenant storage; URL (not mirrored) — only the original URL was recorded (files attached via LLMFile.from_url)
SHA-256Truncated content hash for deduplication and integrity checks

Files sourced from LLMFile.from_url() are recorded with the original URL but not mirrored — only the URL and identity metadata are stored. All other sources (Django file fields, raw bytes, local paths) are mirrored into the tenant's file storage and available for download from the log.

Audit storage is fail-open — if persisting a file fails, the error is logged but the agent run continues normally.

Invocation Files

Memory Sessions in Logs

When an agent has short-term memory enabled, the invocation log shows the full conversation context injected from prior turns — making it easy to audit exactly what history the model saw.

Invocation memory


Cost Tracking

The invocation list aggregates cost per run. Use it to:

  • Identify expensive agents and optimise prompts or token usage
  • Monitor cost trends by agent or time period
  • Estimate per-tenant LLM spend

The response.cost_usd value returned by agent.run() matches the cost recorded here.

Agent-Level Stats

The Agents tab shows aggregate stats per agent across all runs:

ColumnDescription
Total InvocationsTotal number of times this agent has been run
Total Cost (USD)Cumulative LLM cost across all invocations

These are scoped per tenant and not shared across apps.