Skip to Content
Getting StartedQuickstart

Quickstart

The in-app onboarding flow is seven steps: pick a workspace, pick your runtime, generate an API key, install and instrument, verify a trace lands, map an outcome, and finish. This page walks the same steps and shows the exact commands for each supported runtime.

The seven steps

  1. Workspace — confirm the workspace you’re instrumenting into.
  2. Runtime — pick how your agent talks to an LLM (see Pick a runtime below).
  3. API key — generate an API key scoped to this workspace.
  4. Instrument — install the package and add the snippet for your runtime.
  5. Verify — run your agent once and confirm a trace lands.
  6. Map & outcome — map the run to an agent and record its outcome.
  7. Finish — onboarding is complete.

Pick a runtime

Six runtimes are supported: Python SDK (direct instrumentation via a context manager), LangChain, LangGraph, OpenAI Agents, Anthropic, and Claude Agent SDK.

⚠️

The morse-ai package publishes with MHQ-541 — the commands below are final but not yet installable from PyPI.

Python SDK (direct)

Direct instrumentation of any Python function via a context manager.

pip install morse-ai
import morse_ai morse_ai.init(api_key=MORSE_API_KEY) with morse_ai.run("my-agent") as r: # your agent logic here result = "Hello, world!" r.record(success=True, outcome="completed", cost=0.04)

LangChain

Automatic chain/agent tracing via a callback handler — no code inside the chain changes.

pip install morse-ai[langgraph] langchain
import morse_ai from morse_ai.adapters.langchain import MorseCallbackHandler morse_ai.init(api_key=MORSE_API_KEY) handler = MorseCallbackHandler(agent_name="my-agent") # Add the callback to any LangChain chain or agent chain = your_chain.with_config(callbacks=[handler]) chain.invoke({"input": "Hello, world!"})

LangGraph

Per-node span capture plus automatic sub-agent topology from graph structure.

pip install morse-ai[langgraph] langgraph
import morse_ai from morse_ai.adapters.langchain import MorseCallbackHandler morse_ai.init(api_key=MORSE_API_KEY) handler = MorseCallbackHandler(agent_name="my-graph") # Pass the callback when invoking your StateGraph config = {"callbacks": [handler]} result = your_graph.invoke({"messages": [...]}, config=config)

OpenAI Agents

Runner is patched automatically — every agent run and handoff is traced.

pip install morse-ai[openai_agents] openai-agents
import morse_ai from morse_ai.adapters.openai_agents import install from agents import Agent, Runner morse_ai.init(api_key=MORSE_API_KEY) install() # patches Runner automatically — no further changes needed agent = Agent(name="my-agent", instructions="You are a helpful assistant.") result = Runner.run_sync(agent, "Hello, world!")

Anthropic

Every messages.create call on the wrapped client is traced, including cache/token usage.

pip install morse-ai[anthropic] anthropic
import morse_ai from morse_ai.adapters.anthropic import wrap import anthropic morse_ai.init(api_key=MORSE_API_KEY) # Wrap your Anthropic client — every messages.create call is traced client = wrap(anthropic.Anthropic()) with morse_ai.run("my-agent"): response = client.messages.create( model="claude-opus-4-5", max_tokens=1024, messages=[{"role": "user", "content": "Hello, world!"}], )

Claude Agent SDK

claude_agent_sdk.query is patched automatically — existing code works unchanged.

pip install morse-ai claude-agent-sdk
import morse_ai from morse_ai.adapters.claude_agent_sdk import install import claude_agent_sdk morse_ai.init(api_key=MORSE_API_KEY) install() # patches claude_agent_sdk.query automatically # Your existing claude_agent_sdk code works unchanged result = claude_agent_sdk.query("Hello, world!")

Verify

Run your agent once — for example python my_agent.py for the direct Python SDK, or your framework’s equivalent entry script — then return to the onboarding flow’s Verify step to confirm a trace landed. From there, Map & outcome links the run to an agent and records its outcome, and Finish completes onboarding.

  • Introduction — what Morse AI correlates and why.
  • Traces — where your first trace shows up once it lands.
Last updated on