Skip to main content
Mirrors helps you address recurring mistakes in an AI agent. It collects conversation traces, groups failures for investigation, and returns relevant context for your application to add to its existing system prompt. You or your coding agent write the correction and choose when to activate it. Your application continues to own model calls, tools, streaming, and cancellation. Once the SDK is integrated, eligible context updates can reach subsequent turns without redeploying your application.

How it fits together

  1. Capture original conversations. The SDK uploads snapshots in the background. A trace is the ordered record of messages, tool calls, and tool results from one execution or conversation.
  2. Investigate recurring failures. Use the captured evidence to understand what went wrong and write narrowly scoped guidance.
  3. Preview and activate a correction. Check where the saved version matches, review exclusions, then activate it when ready.
  4. Retrieve context at each user turn. In active mode, the SDK can return relevant text. Your application appends it before making its normal model call.
When optional context is unavailable, the SDK returns empty context so your application can use its original prompt. An empty result is also expected when no correction matches or the agent is in shadow or off mode.

Connect your agent

Install the Node.js SDK and add capture and context retrieval.

Review a correction

Understand preview, activation, and what the results establish.

What to measure

Track context delivery, added turn latency, and task outcomes separately. Receiving context does not prove your application applied it. Matching recorded traces does not prove the correction improves future answers. Compare behavior on representative conversations before expanding a rollout.