Skip to main content
magpiedb runs inside your app, like SQLite: there is no server. A store is one folder. Node.js, Python and Rust call the same engine and take the same JSON shapes as the server query API. The import name is magpiedb in every language (the name magpie is taken on PyPI by another project).
REPO is the folder of a clone of the repo. You need Rust (stable); for Node.js also Node 24, for Python also uv.
The first build compiles the engine (some minutes). Tests and wheels: Node.js, Python.

Open a store

Store.open opens the store in the folder, or makes a new one. close commits what is left, waits for merges and frees the folder for another writer. In Node.js and Python, a call after close fails; in Rust, close takes the store. The examples on the next pages use an open store.

Only one process writes

One process at a time may write to a store folder: a second writer is refused. Other processes can open the folder read-only. For many apps, send traces to one magpie-server.
A read-only store also picks up new commits on its own, within about 0.5 s.

Set options

Node.js takes an options object, Python takes keyword arguments, Rust takes the fields of Options. Times are milliseconds in Node.js and Python, and a Duration in Rust. In Rust, durability is Durability::None, Os or Disk, and compression is Compression::Lz4 or Compression::Zstd(level).

How calls run

What each language has

The task pages show every call in all three languages. These parts are not the same: Method lists: Node.js, Python, Rust.

Write spans

Write, replace and commit spans.

Query from your app

Search text, find traces, add up tokens and cost.

Errors and input rules

What each language raises, and why.