Mirrors: build a high-fidelity simulation of a production environment from traces (and optional LangGraph code) to run and test agents with no external dependencies.
Project description
Mirrors
Build a runnable simulation of a customer's production agent environment from their traces, then browse its assets, run evals, and play with it — all in a web app. This monorepo holds four independently-hostable parts:
┌─────────────┐ collect (Bearer key) ┌──────────────────────────┐
│ collector/ │ ───────────────────────► │ backend/ │
│ (customer's │ │ control-plane API │ ──► Postgres
│ machine) │ │ (routing, orchestration)│ ──► ECS Fargate envs
└─────────────┘ └───────────▲──────────────┘ (built on mirrorkit/)
│ REST (one origin)
┌───────────┴──────────────┐
│ frontend/ │ (Vercel)
└──────────────────────────┘
| Part | Dir | What it is | Hosted on |
|---|---|---|---|
| Frontend | frontend/ |
React + Vite app — Dashboard, Ingest, Simulation, Evals, Playground | Vercel |
| Backend | backend/ |
FastAPI control plane: routing, env registry, Fargate orchestration, evals/playground, setup assistant, collector ingest. Depends on core mirrorkit. |
EC2 + external Postgres |
| Core engine | mirrorkit/ |
The simulation engine the backend runs: traces → schema + seed + tool bindings → a runnable Environment; serve + package it. See mirrorkit/README.md. |
inside each env container |
| Collector | collector/ |
A 2-line, zero-dependency SDK that streams an agent's production traces to the backend. See collector/README.md. |
customer's machine |
The collector (2 lines)
import mirror
mirror.init(api_key="mk_live_...", project="my-agent")
Auto-instruments LangChain/LangGraph, Anthropic, and OpenAI if present; captures each run's messages + tool calls and ships them in the background (negligible overhead, never raises into your app).
Run it locally
# backend (SQLite for local; or point MIRROR_DATABASE_URL at any Postgres)
MIRROR_DATABASE_URL=sqlite:///data/mirror.db \
uvicorn backend.app:create_app --factory --port 8001
python examples/seed_demo.py # register the airline demo env
cd frontend && npm install && npm run dev # http://localhost:5173
The airline demo (agent + traces + seed) lives in examples/. For real
(non-mock) data, set ANTHROPIC_API_KEY + MIRROR_SIM_MODEL +
MIRROR_BUILD_MODEL (see backend/.env.example).
Deploy
DEPLOY.md — backend on EC2 + an external Postgres, ECS Fargate for
the per-customer env containers, Vercel for the frontend. SWITCH.md is the
architecture deep-dive.
Develop / test
pip install -e ".[backend,langgraph,serve,backends,dev]" # core + backend
pip install -e collector # the SDK
pytest -q # core + backend tests
pytest collector/tests -q # collector tests
Install profiles
- Core engine only:
pip install -e .(extras:serve,langgraph,backends). - Backend (adds the control plane):
pip install -e ".[backend,langgraph]". - Collector:
pip install -e collector(zero required deps).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mirrorkit-0.1.1.tar.gz.
File metadata
- Download URL: mirrorkit-0.1.1.tar.gz
- Upload date:
- Size: 189.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30bf33d2401d9b0a9b886f55f96f04d9764c530d9e65bf3dd6487ae4a0adb939
|
|
| MD5 |
f58b0c9294b4f3130c04580ae338577b
|
|
| BLAKE2b-256 |
73c8ea7dba7d55faa1a3b5f69f3f6eb8ca806bc8cf835c13c514c6e1e76f80d0
|
File details
Details for the file mirrorkit-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mirrorkit-0.1.1-py3-none-any.whl
- Upload date:
- Size: 193.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6941b185dde3708b74e3b0ab95a6f3cea6c2e23246a3c41b560c09385c58cf4a
|
|
| MD5 |
6f96d5b03bf59e1b65236b1fb561a017
|
|
| BLAKE2b-256 |
e88b59de894547ac65bbe4f95b1a6f29aef3f992269f32b27ae6baab39b49288
|