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

# Library or server?

> Magpie runs inside your app as a library (Rust, Node.js, Python) or as one server that takes OpenTelemetry. How to choose.

Magpie is one engine with two ways to use it. You pick one of them. They do not run together.

| | Library (`magpiedb`) | Server (`magpie-server`) |
| - | - | - |
| What it is | A part of your own program. Your program opens the store folder itself. | A separate program. Your apps send it traces and questions over the network. |
| Languages | Rust, Node.js, Python | Any app with an OpenTelemetry SDK, over HTTP or gRPC |
| Writers | One process writes to a store | Many apps send to one server; the server is the one writer |
| Extras | None: no process to start or watch | The web viewer, API keys, TLS, tenants, retention, S3 |

## Use the library when one program owns the data

For example: one agent app, a script, a test, a notebook. You add `magpiedb` to your code and there is nothing else to run.

> [!WARNING]
>
> **One writer per store.** Only one process may write to a store folder at a time. A second writer is refused; read-only opens are fine.

Start here: [Rust](https://docs.magpiedb.com/libraries/rust.md) · [Node.js](https://docs.magpiedb.com/libraries/node.md) · [Python](https://docs.magpiedb.com/libraries/python.md).

## Use the server when many programs share the data

For example: several agent services, in different languages or on different machines, that all send their traces to one place. They send them with OpenTelemetry, which most agent frameworks already speak. With many app instances, send to one `magpie-server`: it is the one writer.

Start here: [Quick start](https://docs.magpiedb.com/quickstart.md) · [Send traces with OpenTelemetry](https://docs.magpiedb.com/guides/opentelemetry.md) · [Run it in production](https://docs.magpiedb.com/operations/overview.md).

## A simple rule

If it runs only on your laptop or inside one app, use the library. If it runs for a team or a company, use the server.

The two ways write the same kind of store. More about the one-writer rule and what else Magpie does not do yet: [Limits](https://docs.magpiedb.com/limits.md).


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