> ## 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.

# Mortem: Post-trade debugging for Solana trading bots

> Mortem captures full agent traces, replays decision chronologies, and generates actionable autopsies so you can fix losing strategies before they repeat.

Mortem is a post-trade observability platform built for Solana trading bot teams. When a trade goes wrong, Mortem shows you exactly what your agent decided, in what order, and why — so you can diagnose the cause and prevent the same loss from happening again.

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Install the SDK and send your first trace in under five minutes.
  </Card>

  <Card title="Core Concepts" icon="book" href="/concepts">
    Understand agents, traces, events, and autopsies before you integrate.
  </Card>

  <Card title="SDK Reference" icon="code" href="/sdk/installation">
    Full reference for the `@mortemlabs/sdk` TypeScript package.
  </Card>

  <Card title="API Reference" icon="rectangle-terminal" href="/api/overview">
    Direct HTTP access to the Mortem ingest and trace APIs.
  </Card>
</CardGroup>

## How Mortem works

<Steps>
  <Step title="Create an agent">
    Sign in to the Mortem dashboard and create an agent. You'll receive an API key and a one-time verify token.
  </Step>

  <Step title="Install the SDK">
    Add `@mortemlabs/sdk` to your TypeScript trading bot and configure it with your API key and agent ID.
  </Step>

  <Step title="Instrument your runs">
    Wrap your LLM calls, tool calls, and Solana transactions using Mortem's instrumentation wrappers. Each run becomes a trace.
  </Step>

  <Step title="Inspect and fix">
    Open the dashboard to replay the decision chronology, read the AI-powered analysis, and apply the suggested fix before the next run.
  </Step>
</Steps>

## What Mortem captures

Every agent run produces a **trace** — a complete record of what happened. Mortem captures:

* **LLM calls** — prompts, completions, token counts, and cost estimates
* **Tool calls** — which tools fired and what they returned
* **Solana transactions** — signatures, lamport flows, and on-chain state
* **Market context** — Jupiter quotes and Pyth prices at decision time
* **Custom events** — any arbitrary step you instrument yourself

<CardGroup cols={2}>
  <Card title="Dashboard guide" icon="gauge" href="/dashboard/agents">
    Navigate agents, live streams, and trace history in the Mortem dashboard.
  </Card>

  <Card title="Integration guides" icon="puzzle-piece" href="/guides/vercel-ai-sdk">
    Step-by-step integration for Vercel AI SDK, OpenAI, Anthropic, LangChain, and Solana.
  </Card>

  <Card title="Sharing autopsies" icon="share-nodes" href="/dashboard/sharing">
    Share a public trace link so teammates can review a post-mortem without logging in.
  </Card>

  <Card title="Troubleshooting" icon="triangle-exclamation" href="/reference/troubleshooting">
    Fix common issues with trace ingestion, analysis, and API key setup.
  </Card>
</CardGroup>
