Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mirrorkit-0.1.0.tar.gz (189.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mirrorkit-0.1.0-py3-none-any.whl (193.8 kB view details)

Uploaded Python 3

File details

Details for the file mirrorkit-0.1.0.tar.gz.

File metadata

  • Download URL: mirrorkit-0.1.0.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

Hashes for mirrorkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b49a073c1ab784580219906ff3efbcd51ea0c9a38c1c498ef1985e9213630139
MD5 615ff8673bf82297662b250600df485f
BLAKE2b-256 e276da3b2a634a5cca963dfc47bcf467ef5e9e0a7c5fcfdabaf08feee82bcbe9

See more details on using hashes here.

File details

Details for the file mirrorkit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mirrorkit-0.1.0-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

Hashes for mirrorkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f6990a491fc10acb8c0287dbc6f3fd06607931f5c54c8008309edac452f8a3c
MD5 06fc268406f7f3d5bc0144367b10ed43
BLAKE2b-256 96a19c5cc042358c32629aa90812f8cda075387719382723c11385946474dc74

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page