An agent represents a single trading bot or strategy instance in Mortem. Every trace Mortem records belongs to an agent, and every SDK credential you give your bot is scoped to that agent. Creating an agent generates the API key your bot uses to send traces. Managing agents is where you rotate leaked keys, check connection status, and remove bots you no longer run.Documentation Index
Fetch the complete documentation index at: https://docs.mortemlabs.com/llms.txt
Use this file to discover all available pages before exploring further.
Agent list
Your agent list lives at/app. It shows every agent in your workspace — display name, environment (devnet or mainnet), verification status, and the date each agent was created. Click any row to open the agent detail page.
Creating an agent
The onboarding wizard at/app/agents/new walks you through four steps. Each step stays visible so you can refer back to earlier credentials while you work.
Name your agent
Enter a display name for the agent — for example
yield-hunter-v2. Names cannot contain spaces. Click Create agent.The wizard reveals two one-time credentials:MORTEM_API_KEY— your bot’s ingest credentialMORTEM_VERIFY_TOKEN— a one-time proof-of-control token
Install the SDK
Install The wizard pre-fills an Add these to your agent’s environment before running it.
@mortemlabs/sdk in your agent project:.env block with all four required variables:Wrap your agent
The wizard provides integration snippets for OpenAI, Anthropic, Vercel AI SDK, and LangChain. Select the tab that matches your agent’s LLM client and paste the snippet into your agent’s entry point.If you prefer, expand the Using an AI coding assistant? section to copy a ready-made prompt for Claude Code or Codex. Paste it into your assistant and it will add the wrappers for you without touching any other agent logic.
Verify the connection
Run your agent once. The wizard polls every four seconds and waits up to four minutes for two signals:
- Connected — Mortem received the first trace from your agent.
- Verified — the ingest service matched the
MORTEM_VERIFY_TOKENyou included.
MORTEM_VERIFY_TOKEN from your agent’s environment and code — it is no longer needed.If four minutes pass without a connection, the wizard shows a troubleshooting checklist. Confirm
MORTEM_API_KEY, MORTEM_VERIFY_TOKEN, and MORTEM_INGEST_URL are set correctly, then click Try again.Agent detail page
Open an agent at/app/agents/[id] to see two panels side by side:
- Agent dossier — display name, agent ID, network (devnet or mainnet), trace retention window, and quick links to the Traces list and Settings.
- Live stream — an SSE-backed feed of traces arriving from your bot in real time. Each row in the stream shows the trace status, ID, input summary, event count, token total, and receipt time. Click any row to open the full trace detail page.
/ to focus the filter, j and k to move between rows, and Space to toggle auto-scroll.
If your agent is unverified, a Complete setup link appears on the dossier. Click it to resume the onboarding wizard at the verification step.
Agent settings
Navigate to Settings from the agent detail page, or go directly to/app/agents/[id]/settings. The settings page has two functional sections and a danger zone.
API key
The settings page shows a truncated SHA-256 hash of your current API key — never the plaintext key. Use this hash to confirm which key your bot is using without exposing the value. To generate a new key, click Rotate key. The new plaintext key appears once in the settings panel. Copy it and update your bot’sMORTEM_API_KEY environment variable before the key is dismissed.
Retention
The retention panel shows how many days Mortem retains trace payloads for this agent before cleanup. This value is set at agent creation and is read-only from the settings page.Deleting an agent
The Delete agent button in the danger zone removes the agent record and all of its linked traces. The first click changes the button to Confirm delete — click it again to proceed. Deletion is permanent and cannot be undone.Related pages
Traces
Browse and inspect every run captured for an agent.
Analysis
Understand the LLM-powered autopsy that appears after each trace completes.