> ## 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`.

# Benchmarks

> Magpie against 13 other engines on one AWS machine, every answer checked, losses next to wins; and one billion spans in one store.

Every published number has a source file and an answer checked against a known count; losses are published next to wins. The full record is in [the findings record](https://github.com/intojhanurag/magpie/blob/main/docs/FINDINGS.md).

## Against 13 other engines (one AWS machine, 2026-12-05)

The same data and the same 8 queries for Magpie and 13 other engines (SQLite, DuckDB, Tantivy, LanceDB, chDB, ClickHouse, Quickwit, GreptimeDB, Postgres, ParadeDB, Elasticsearch, OpenObserve, Doris), one engine at a time, every answer checked. Each engine ran the best settings its own docs give for its version, with result caches off. Machine: one AWS m7gd.4xlarge (16 vCPU Graviton3, 64 GiB, local NVMe, Linux), nothing else running. Server engines ran in a container with 6 GiB and 8 CPUs each; engines that run inside the app (Magpie, SQLite, DuckDB, Tantivy, LanceDB, chDB) had no cap. Magpie: the default store (pieces off). Data: `small` (809,982 spans, 1.13 GB of made-up text), `real-wildchat` (454,445 spans, 0.90 GB of real chats) and `heavy` (126,502 large spans, 4.76 GB of made-up text that repeats inside a trace).

All the tables, every engine and every limit: [the results tables](https://github.com/intojhanurag/magpie/blob/main/results/TABLES.md). The run: [the findings record](https://github.com/intojhanurag/magpie/blob/main/docs/FINDINGS.md), F105.

**Disk** (MB = 10^6 bytes, live files of the store at rest; lower is better). Only an exact size counts as a win.

| data set | Magpie | Magpie, pieces on (option, off by default) | smallest other engine (exact size) | Magpie |
| - | -: | -: | - | - |
| `small` | 451.7 | 463.7 | Quickwit 472.5 | **4% smaller** |
| `heavy` | 1,623.7 | 1,012.3 | Quickwit 1,958.2 | **17% smaller** (pieces on: 48% smaller) |
| `real-wildchat` | 523.5 | 525.2 | Quickwit 491.5 | **6.5% larger: a loss** |

* OpenObserve gives only an estimate of its live size: \~1,589.4 MB on `heavy` and \~398.8 MB on `real-wildchat`, under Magpie's. On `real-wildchat` the bytes its disk really allocated (470.3 MB) are also under Magpie's (523.8 MB): a loss.
* On `heavy`, ClickHouse has no result with its best settings (it ran out of memory); its older text index variant needs 1,841.1 MB there (Magpie 12% smaller).
* Stores with no text index can be smaller: DuckDB as a plain table (450.1 MB on `small`, 885.8 MB on `heavy`) and ClickHouse with Mastra's table (460.6 MB on `real-wildchat`). They take 0.57 to 89 seconds to find a word.

**Load** (seconds for the whole file; lower is better). This is Magpie's clear loss.

| data set | Magpie | Magpie, pieces on (option, off by default) | fastest | Magpie |
| - | -: | -: | - | - |
| `small` | 46.3 | 58.3 | DuckDB 12.9 | **3.6x slower** |
| `real-wildchat` | 40.1 | 41.4 | DuckDB 11.5 | **3.5x slower** |
| `heavy` | 158.7 | 166.8 | Tantivy 34.3 | **4.6x slower** |

Magpie loaded with 1 indexing thread (its default), Tantivy with 8, DuckDB with one per core; whether more threads close the gap is not measured. Stores with no text index load faster than Magpie too (DuckDB as a plain table: 6.4 s on `small`, 1.9 s on `real-wildchat`, 38.3 s on `heavy`).

**Queries** (ms, median of 7 warm runs, one query at a time; Magpie against the fastest other engine of that query).

| query | `small` | `real-wildchat` | `heavy` |
| - | - | - | - |
| Q1 count spans with a rare word | 0.012 vs 0.009 Tantivy: **loss** | 0.011 vs 0.007 Tantivy: **loss** | 0.016 vs 0.011 Tantivy: **loss** |
| Q2 the 50 newest spans with a common word | 1.3 vs 1.7 Tantivy: **win** | 0.83 vs 2.8 Tantivy: **win** | 0.88 vs 2.9 Postgres 19.0: **win** |
| Q3 count spans with an exact phrase | 0.10 vs 0.092 Tantivy: **loss** | 0.049 vs 0.033 SQLite: **loss** | 0.068 vs 0.045 SQLite: **loss** |
| Q4 read one whole trace | 0.64 vs 0.023 Tantivy: **loss** (28x) | 0.98 vs 0.013 Tantivy: **loss** (77x) | 0.71 vs 0.13 Tantivy: **loss** (5.4x) |
| Q5 the 50 newest traces of one user | 1.1 vs 0.23 SQLite: **loss** (4.8x) | 1.3 vs 0.13 SQLite: **loss** (9.7x) | 0.42 vs 0.10 SQLite: **loss** (4.1x) |
| Q6 token sums per model | 0.30 vs 4.0 DuckDB: **win** (13x) | 0.47 vs 2.4 Tantivy: **win** (5x) | 0.35 vs 1.2 Tantivy: **win** (3.3x) |
| Q7 traces where a tool failed and a given model ran | 1.2 vs 23.4 chDB: **win** (19x) | 0.10 vs 0.017 SQLite: **loss** (no trace matches) | 0.90 vs 7.8 Tantivy: **win** (8.7x) |
| Q8 count tool spans with a common word since a date | 0.97 vs 1.1 Tantivy: **win** | 0.008 vs 0.011 Tantivy: **win** | 0.28 vs 0.28 Tantivy: **win** by 2% |

* p99 (the slowest of the 7 runs) gives the same result in every cell but Q8 on `heavy`: a tie at 0.30 ms, counted as a loss.
* With pieces on (option, off by default), Q8 becomes a loss on `small` (1.3 ms) and on `heavy` (0.29 ms), and Q4 on `heavy` takes 1.4 ms; every other result stays.
* The Q1 and Q3 losses are 0.0025 to 0.023 ms. Tantivy merged to one segment after its load (not its default) is faster than Magpie on Q2 and on Q8 (`real-wildchat`, `heavy`).
* Limits: one machine and one session; the server engines' times include their network protocol; ClickHouse ran out of its 6 GiB on `heavy` (no result there); Doris did not stop cleanly, so it never counts; Postgres and ParadeDB cannot load `real-wildchat` (U+0000 in 4 spans); no query ran on S3; several queries at once were not tested.

## One billion spans in one store

1,000,000,000 spans of 1 KB (86.5 million traces) in one store, on one AWS c6gd.8xlarge (32 vCPU Graviton2, 64 GiB, local NVMe). All 17 checked queries were right in all 8 runs. The store took 786 bytes per span on disk (0.79 of the raw text). At 1 billion spans: one whole trace in 7.8 ms, the newest traces in 10.6 ms, and a reopen of the store in under 2 s.

> [!WARNING]
>
> Limits: made-up text, one run, one machine. Big sums are slow at this size: the top 10 users by cost take 19.4 s, and duration percentiles 2.5 s. The load took 14 hours and slowed from 41,000 to 11,000 spans per second as each commit took longer.

Source: [the findings record](https://github.com/intojhanurag/magpie/blob/main/docs/FINDINGS.md), F106, and the raw files in [results/scale-1b-2026-12-05/](https://github.com/intojhanurag/magpie/tree/main/results/scale-1b-2026-12-05).

## Run it yourself

The harness of the race is in the repo: [bench/run-fair.sh](https://github.com/intojhanurag/magpie/blob/main/bench/run-fair.sh). How it runs each engine, the settings of each one with a link to its docs, and how the disk is measured: [the fair-run description](https://github.com/intojhanurag/magpie/blob/main/bench/FAIR-RUN.md). The 8 queries: [the benchmark spec](https://github.com/intojhanurag/magpie/blob/main/bench/SPEC.md).


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