> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magpiedb.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Magpie is a trace store for AI agents, used as a library (crate `magpiedb`, npm `magpiedb`, PyPI `magpiedb`) or as `magpie-server`, which takes OpenTelemetry (OTLP over HTTP on 127.0.0.1:4318 and gRPC on 127.0.0.1:4317 by default).
> Use only the commands, flags, routes and JSON shapes that these pages show. Do not guess a flag or a query field: if a page does not show it, say that the docs do not show it.
> Packages and server binaries are not published yet: build from source, as the quick start shows. Check the status note on the introduction page before you suggest `cargo add`, `npm install` or `pip install`.
> Only one process may write to a store folder at a time. For many apps, send traces to one `magpie-server`.

# Magpie

> A trace store for AI agents: full-text search over prompts and replies, whole-trace queries and token and cost sums, in one Rust engine.

Magpie stores the traces of AI agents: every prompt, reply and tool call. It finds a word or a phrase in them, answers questions about whole runs, and adds up tokens and cost. It is one Rust engine, built on [Tantivy](https://github.com/quickwit-oss/tantivy). A store is one folder of files.

> [!NOTE]
>
> **Status:** in development. Packages and server binaries are not published yet: build from source. From release 0.1.0 on, `magpie-server` is also a download for macOS and Linux, and a Docker image. Release 0.1.0 is not out yet.

## What it does

* **Search** prompts and replies by word, phrase, prefix or part of a word.
* **Whole-trace queries**: conditions on different steps of the same run, for example "a tool failed and model X answered in a later step".
* **Sums** of tokens, cost and scores per model, user or time range.
* **OpenTelemetry in**: OTLP over HTTP (protobuf or JSON) and gRPC, with the GenAI semantic conventions mapped to spans.
* **Private data masked before it is stored**: no file of the store holds the original text (`--mask`, off by default).
* **Embedded or server**: use the `magpiedb` library in Rust, Node.js or Python, or run `magpie-server`.

## Start here

> [card] [Quick start](https://docs.magpiedb.com/quickstart.md)
>
> Start the server, send a trace, ask questions. Or use the library. 5 minutes.

> [card] [Library or server?](https://docs.magpiedb.com/library-or-server.md)
>
> Which of the two ways to use Magpie fits your app.

> [card] [Send traces with OpenTelemetry](https://docs.magpiedb.com/guides/opentelemetry.md)
>
> From any app or framework, over HTTP or gRPC.

> [card] [Queries](https://docs.magpiedb.com/queries/overview.md)
>
> Text, filters, whole traces, sums, sessions, scores, export.

> [card] [Run it in production](https://docs.magpiedb.com/operations/overview.md)
>
> API keys, TLS, tenants, retention, masking, backups, S3.

> [card] [Benchmarks](https://docs.magpiedb.com/benchmarks.md)
>
> Against 13 other engines, every answer checked. Losses too.

## Try it in one minute

Requires stable Rust.

```sh theme={null}
cargo build --release -p magpie-server
target/release/magpie-server --dir ./traces
```

In another terminal, send a sample agent run and open the viewer:

```sh theme={null}
scripts/send-trace.sh
open http://127.0.0.1:4318/
```

Point any OpenTelemetry SDK at the server:

```sh theme={null}
export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
```

## How these pages are checked

Every number on these pages has a source file and an answer checked against a known count. Losses are published next to wins. The full record of every measurement is [the findings record](https://github.com/intojhanurag/magpie/blob/main/docs/FINDINGS.md). What Magpie does not do yet: [Limits](https://docs.magpiedb.com/limits.md).

Magpie is open source under the [Apache-2.0 license](https://github.com/intojhanurag/magpie/blob/main/LICENSE).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.