# Magpie > Magpie is 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. A library for Rust, Node.js and Python, or one server that takes OpenTelemetry. > ## 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](https://docs.magpiedb.com/index.md): 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. - [Quickstart](https://docs.magpiedb.com/quickstart.md): Build Magpie, start the server, send a trace and ask questions. Or use the library in Rust, Node or Python. - [Set up Magpie with a coding agent](https://docs.magpiedb.com/agent-setup.md): Steps that a coding agent follows in your project: build magpie-server, start it, add the OpenTelemetry setup for your app, send a test trace and check that it arrived. - [Library or server?](https://docs.magpiedb.com/library-or-server.md): Magpie runs inside your app as a library (Rust, Node.js, Python) or as one server that takes OpenTelemetry. How to choose. - [Use these docs with AI tools](https://docs.magpiedb.com/ai-tools.md): Give Claude, ChatGPT, Cursor or any coding agent the Magpie docs: an MCP server, llms.txt, a skill file and every page as Markdown. - [Send traces with OpenTelemetry](https://docs.magpiedb.com/guides/opentelemetry.md): Send traces to magpie-server from any app, SDK or Collector that speaks OTLP, and see how a span is stored. - [Rust library](https://docs.magpiedb.com/libraries/rust.md): The magpiedb crate: an embedded store for AI-agent traces that runs inside your process, like SQLite. - [Node.js library](https://docs.magpiedb.com/libraries/node.md): The magpiedb package for Node.js: install, example, every call, and the shapes of queries. - [Python library](https://docs.magpiedb.com/libraries/python.md): The magpiedb package for Python: install, example, every call, options, and the shapes of queries. - [Queries](https://docs.magpiedb.com/queries/overview.md): Every kind of question you can ask Magpie, with a real answer for each. - [Find text](https://docs.magpiedb.com/queries/text-search.md): Search the input and output of spans with words, phrase, contains and prefix, and search error messages. - [Filter spans](https://docs.magpiedb.com/queries/filters.md): Match spans by field, time, tag and attribute, and join filters with and, or and not. - [Questions about whole traces](https://docs.magpiedb.com/queries/traces.md): Find traces by their spans, root, scores and totals, and read long lists in pages with cursors. - [Add up numbers](https://docs.magpiedb.com/queries/sums.md): Exact sums per group, top N, time series and percentiles with POST /v1/aggregate. - [Sessions and scores](https://docs.magpiedb.com/queries/sessions-scores.md): Find sessions (conversations) and write, read and add up scores for evals and feedback. - [Read and export](https://docs.magpiedb.com/queries/read-export.md): Read one trace or one span, read a big trace in pages, and export spans as JSON Lines. - [The same queries in the library](https://docs.magpiedb.com/queries/library.md): The Node and Python calls that take the same JSON as the server routes. - [Run Magpie for a company](https://docs.magpiedb.com/operations/overview.md): How to turn on keys, TLS, tenants, retention, deletes, masking, backup, S3 and more in magpie-server. - [API keys and TLS](https://docs.magpiedb.com/operations/keys-tls.md): Turn on API keys and TLS for magpie-server, and run it behind a proxy. - [Tenants: one store per customer](https://docs.magpiedb.com/operations/tenants.md): Give each customer its own store with --tenants-dir and per-tenant API keys. - [Retention and deletes](https://docs.magpiedb.com/operations/data-lifecycle.md): Drop old spans with --retention. Delete a person's data and purge it from the disk. - [Masking private data](https://docs.magpiedb.com/operations/masking.md): Replace private data in every span and score before it is stored, with --mask. - [Import and backup](https://docs.magpiedb.com/operations/backup-import.md): Load traces from files with magpie-server import, and back up and restore a store. - [S3](https://docs.magpiedb.com/operations/s3.md): Keep a Magpie store in an S3 bucket, run read-only servers on it, and set up Amazon S3 the safe way. - [Durability and upgrades](https://docs.magpiedb.com/operations/durability-upgrades.md): What an accepted write survives with --durability, and how the store version works. - [Errors, memory and threads](https://docs.magpiedb.com/operations/errors-memory.md): What each HTTP and gRPC error means, and how much memory and how many threads the server uses. - [Security](https://docs.magpiedb.com/security.md): How to report a security problem, what counts, and what to know before you run Magpie. - [Limits](https://docs.magpiedb.com/limits.md): What Magpie does not do today, and where it is weak. Each line names its source. - [magpie-server](https://docs.magpiedb.com/reference/server.md): Install, run and configure magpie-server: every command-line flag, Docker, a full disk, retention, host names, slow clients and the limits of the server. - [HTTP API](https://docs.magpiedb.com/reference/http-api.md): Every HTTP route of magpie-server: OTLP ingest, the query API, export, scores, deletes, storage, mask counts and health, with request and answer shapes and errors. - [Tenants, API keys and TLS](https://docs.magpiedb.com/reference/tenants-and-keys.md): One store per tenant, API keys with read and write rights, and TLS on both ports of magpie-server. - [S3 with the server](https://docs.magpiedb.com/reference/server-s3.md): Keep one Magpie store in an S3 bucket with the --s3 flag: the writer, the read-only server, one-writer rules, cleanup, what can be lost and the limits. - [Viewer](https://docs.magpiedb.com/reference/viewer.md): The read-only web viewer that magpie-server serves at the HTTP port: its screens, its search syntax, how it is built and how it stays safe. - [Import old traces](https://docs.magpiedb.com/reference/import.md): Load old traces from files into a Magpie store with magpie-server import: flags, formats, memory, time order and limits. - [Mapping, cost and masking](https://docs.magpiedb.com/reference/mapping-cost-masking.md): How magpie-server maps OpenTelemetry GenAI spans to Magpie spans, how it computes cost from a price file, and how it masks private data before it is stored. - [Benchmarks](https://docs.magpiedb.com/benchmarks.md): Magpie against 13 other engines on one AWS machine, every answer checked, losses next to wins; and one billion spans in one store. This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.