Your agents said it.Magpie finds it.
Every prompt, answer and tool call your agents make, stored once and searchable word for word. A library for Rust, Node and Python, or one server that speaks OpenTelemetry.
Speaks OpenTelemetry.Fits the agent stack you run.
- OpenTelemetry
- OpenAI Agents
- LangGraph
- Vercel AI SDK
- Pydantic AI
- LlamaIndex
- CrewAI
- Mastra
- Claude Agent SDK
- + any OTel span
Agents repeat themselves.Magpie doesn’t.
Storage
up to81%smaller
On a real agent-history data set, where 96% of the text repeats.
real-lmcache: 0.191 of the size with pieces off (F68). With few repeats: 0.65% to 1.55% (F71). Measured in Magpie, one machine.
- Pieces, not copies
- The system prompt is stored once. Each call keeps short pointers.
- Search still sees every word
- A hit inside a shared piece shows in every call that used it.
One agent run · 4 model calls
A usual store: each of the 4 calls keeps its own full copy of the system prompt, the tool list and every earlier turn. Size: 100%.
Every step on a timeline.Every word, marked.
The viewer comes with the server. Open a run, see each model call and tool call in order, and read the exact text that went in and came out.
the real viewer · demo data ·magpie-server --dir ./traces→ localhost:4318

A failed tool callshows in red, with its args.
error · lookup_order: timeout after 5000 ms
args {"order_id": "1042"}
Search inside one run.Each hit is marked, in order.
- user…twice for order 77. Please refund
- answer…qualifies for a refund under the 30-day…
- answerI started it: refund id R-2431.
Small and fast,against 13 engines.
Same data, same machine, each engine with its best settings. Every answer is checked: a wrong answer is a fail, not a time. The harness is in the repo, so you can run it yourself.
STORE SIZE ON DISK · HEAVY DATA SET · SMALLER IS BETTER
PHRASE SEARCH · MEDIAN OF 200 QUERIES · LOWER IS BETTER
ONE WHOLE TRACE BY ID · MEDIAN · LOWER IS BETTER
TOKENS AND COST BY MODEL, ONE DAY · LOWER IS BETTER
LOAD THE HEAVY DATA SET · LOWER IS BETTER
Ten lines to a search.In the language you write.
import { Store } from 'magpiedb'
const store = await Store.open('./traces')
await store.write([
{ traceId: 't1', spanId: 's1', kind: 'agent_run',
startedAt: Date.now(), input: 'please refund my order' },
])
await store.commit()
// every span that says "refund"
await store.search({ filter: { text: { words: 'refund' } } })t1/s1agent_runplease refund my order
use magpiedb::{Filter, Options, Span, Store, Text};
let store = Store::open("traces", Options::default())?;
let mut span = Span::new("trace-1", "span-1", "tool_call", 1_700_000_000_000);
span.input = "look up the refund policy".into();
store.upsert(vec![span])?;
store.commit()?; // or wait: the store commits on a timer
// how many spans hold the phrase "refund policy"
let hits = store.count(&Filter {
text: Some(Text::phrase("refund policy")), ..Default::default()
})?;trace-1/span-1tool_calllook up the refund policy
import time
from magpiedb import Store
now = int(time.time() * 1000) # times are Unix milliseconds
with Store.open("./traces") as store:
store.write([
{"traceId": "t1", "spanId": "s1", "kind": "agent_run",
"startedAt": now, "input": "please refund my order"},
])
store.commit()
# every span that says "refund"
store.search({"filter": {"text": {"words": "refund"}}})t1/s1agent_runplease refund my order
magpie-server --dir ./traces
# then, in your agent: any OpenTelemetry SDK, with the standard variables
OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
# every trace with an error and a span that says "refund"
curl -s localhost:4318/v1/traces/find -d '{
"filter": {"hasError": true},
"anySpan": [{"text": {"words": "refund"}}],
"limit": 10
}'7f3a…errorplease refund my order
Your disk. Your data.One folder, no cluster.
- Apache-2.0
- Open source. No account, no sign-up.
- Crash-safe writes
- Tested by killing the process in the middle of a write.
- Masked on write
- Set a mask policy, and private data is masked before it reaches the disk.
- Safe upgrades
- A store refuses a version it cannot read.
agent-traces/
- store.jsonthe version door
- wal/every accepted write lands here first
- meta.json, *.idxwords, positions, sums
- traces/one row per trace
Close the store and copy the folder: that is a full backup. Or let the server keep it in S3.
magpie-server --s3Embed the library
npm i magpiedbMagpie runs inside your app. No server, no network hop. Good for one service, a test suite or a laptop.
Run the server
magpie-server --dir ./tracesOne binary takes OpenTelemetry over HTTP and gRPC, and serves the query API and the viewer. Good for a team.
Give your agentsa memory you cansearch.
Free and open source. Install it in a minute, or start the server and point your OpenTelemetry at it.