Skip to main content
ClaudeWave

Drop-in production trace collector for LLM agents (Go). Streams traces to your Mirrors backend.

ToolsOfficial Registry0 stars0 forksGoMITUpdated 17d ago
Get started
Method: Clone
Terminal
git clone https://github.com/ai-singhal/mirrorkit-go
1. Clone the repository.
2. Follow the README for installation and usage instructions.
Use cases

Tools overview

# mirrorkit (Go)

A lightweight, **drop-in** production trace collector for LLM agents — the Go
sibling of the Python [`mirrorkit`](https://pypi.org/project/mirrorkit/) and
TypeScript `mirrorkit` (npm) packages.

It does exactly one thing: **take traces you hand it and send them to your
Mirrors backend** — batched in the background, non-blocking, and safe (it never
panics into your app after `Init`). It does **not** instrument SDKs and does
**not** run agents; you build the trace, it ships it.

## Install

```bash
go get github.com/ai-singhal/mirrorkit-go
```

Requires **Go ≥ 1.21**. Zero dependencies (standard library only).

## Usage

```go
package main

import (
	"time"

	mirrorkit "github.com/ai-singhal/mirrorkit-go"
)

func main() {
	mirrorkit.Init(mirrorkit.Options{APIKey: "mk_live_...", Project: "my-agent"})
	defer mirrorkit.Shutdown(5 * time.Second)

	mirrorkit.LogTrace([]mirrorkit.Message{
		mirrorkit.SystemMessage("You are a helpful assistant."),
		mirrorkit.UserMessage("What's the weather in Paris?"),
		mirrorkit.AssistantMessage("It's 18C and sunny."),
	}, mirrorkit.WithModel("claude-opus-4-8"))
}
```

Each trace is enqueued and flushed to `{endpoint}/api/collect` by a background
goroutine (`Authorization: Bearer <apiKey>`, body `{project, traces}`).

### Tool calls

Build tool-call and tool-result messages with the helpers:

```go
mirrorkit.LogTrace([]mirrorkit.Message{
	mirrorkit.UserMessage("Cancel booking BK-4471."),
	mirrorkit.AssistantToolCalls(
		mirrorkit.NewToolCall("call_1", "cancel_booking", map[string]any{"id": "BK-4471"}),
	),
	mirrorkit.ToolResult("call_1", `{"status":"cancelled"}`),
	mirrorkit.AssistantMessage("Done — BK-4471 is cancelled."),
})
```

## Options

```go
mirrorkit.Init(mirrorkit.Options{
	APIKey:        "mk_live_...",           // required
	Project:       "my-agent",              // default "default"
	Endpoint:      "https://api.mirror.dev", // else MIRRORKIT_ENDPOINT / MIRROR_ENDPOINT / prod
	FlushInterval: 2 * time.Second,         // ms between background flushes
	MaxBatch:      50,                      // max traces per POST
	MaxQueue:      10_000,                  // in-memory cap; oldest dropped past this
	Debug:         false,                   // internal debug logs (or MIRRORKIT_DEBUG=1)
})
```

Endpoint resolution: `Options.Endpoint` → `MIRRORKIT_ENDPOINT` → `MIRROR_ENDPOINT`
→ the production default.

## Lifecycle

```go
mirrorkit.Flush(5 * time.Second)     // block until the queue drains
mirrorkit.Shutdown(5 * time.Second)  // stop the background goroutine (flushes first)
```

Prefer one collector per process via the package-level `Init` / `LogTrace` /
`Flush` / `Shutdown`. For multiple independent collectors, use `NewClient` and
call `LogTrace` / `Flush` / `Shutdown` on the returned `*Client`.

## Testing

```bash
cd mirrorkit-go && go vet ./... && go test ./...
```

What people ask about mirrorkit-go

What is ai-singhal/mirrorkit-go?

+

ai-singhal/mirrorkit-go is tools for the Claude AI ecosystem. Drop-in production trace collector for LLM agents (Go). Streams traces to your Mirrors backend. It has 0 GitHub stars and was last updated 17d ago.

How do I install mirrorkit-go?

+

You can install mirrorkit-go by cloning the repository (https://github.com/ai-singhal/mirrorkit-go) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.

Is ai-singhal/mirrorkit-go safe to use?

+

ai-singhal/mirrorkit-go has not been audited yet by our security agent. Review the original repository on GitHub before using it in production.

Who maintains ai-singhal/mirrorkit-go?

+

ai-singhal/mirrorkit-go is maintained by ai-singhal. The last recorded GitHub activity is from 17d ago, with 0 open issues.

Are there alternatives to mirrorkit-go?

+

Yes. On ClaudeWave you can browse similar tools at /categories/tools, sorted by popularity or recent activity.

Deploy mirrorkit-go to your cloud

Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.

Maintain this repo? Add a badge to your README

Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.

Featured on ClaudeWave: ai-singhal/mirrorkit-go
[![Featured on ClaudeWave](https://claudewave.com/api/badge/ai-singhal-mirrorkit-go)](https://claudewave.com/repo/ai-singhal-mirrorkit-go)
<a href="https://claudewave.com/repo/ai-singhal-mirrorkit-go"><img src="https://claudewave.com/api/badge/ai-singhal-mirrorkit-go" alt="Featured on ClaudeWave: ai-singhal/mirrorkit-go" width="320" height="64" /></a>

More Tools

mirrorkit-go alternatives