mirrorkit is a lightweight, drop-in production trace collector for LLM agents. Add two lines to your existing LangChain / LangGraph / Anthropic / OpenAI script and your agent’s traces start streaming to Mirrors: non-blocking, background-batched, with negligible latency.
How do I install the Python collector?
Runpip install mirrorkit. There are no required runtime dependencies: the
sender uses only the Python stdlib, so it adds nothing to your dependency tree.
How do I start collecting traces from a Python agent?
Importmirrorkit and call init() with your workspace key and a project name
before your agent runs. That is the whole integration: two lines, no decorators,
no changes to how you call your model.
MIRROR_ENDPOINT environment variable, then to the production URL.
Options
How do I log a trace manually?
Callmirrorkit.log_trace() with a list of OpenAI-style chat dicts. This is the path for frameworks that aren’t auto-instrumented:
Do I need to pass LangChain callbacks myself?
Normally no.init() registers a global LangChain callback handler automatically, so you don’t need to pass callbacks. If your setup doesn’t honor the global hook, pass the handler explicitly:
API
Failures (non-2xx / network errors) are retried a couple of times, then dropped. The collector never raises into your program. The wire format is documented in the collect API reference.
mirrors CLI. Install it with pip install "mirrorkit[cli]".