Skip to content

About

Awkward Array + MonetDB for HEP: nested events as SQL tables with an exact round trip, and an MCP server that lets AI agents analyse CMS Open Data

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

awkward-monetizer

Hybrid analysis of nested (ragged) HEP data: flatten ROOT events into MonetDB tables, push selections down to SQL, then rebuild the nesting in Awkward Array for the physics. An LLM agent can drive the same pipeline through MCP.

Pipeline: ROOT file → uproot → Awkward → flatten → MonetDB → SQL slice and unflatten → Awkward (NF2) → physics; an LLM agent over MCP drives the SQL and Awkward steps

Install

python -m pip install awkward-monetizer             # core
python -m pip install "awkward-monetizer[agent]"    # + LLM agent and MCP server

Python 3.10+. The MonetDB server is installed separately (brew install monetdb on macOS). For development (pip or pixi), see docs/usage.md.

Quickstart

awkward-monetizer make-nano          # synthetic NanoAOD file
awkward-monetizer adl                # IRIS-HEP ADL Q1–Q8 on it, no database needed

With a MonetDB server running, load real CMS Open Data:

monetdb create hep && monetdb release hep
awkward-monetizer ingest <NanoAOD file>.root --dataset nanoaod --database hep \
    --create-schema --step-size 50000 --entry-stop 100000

Agentic analysis

An LLM agent gets six tools: schema discovery, read-only SQL, Awkward code on events selected in SQL, submit, plot, and (over MCP) a check against the ADL reference. To use it from Claude Code:

claude mcp add -s user awkward-monetizer -- awkward-monetizer agent mcp --database hep

It speaks MCP over stdio (started by the client, as above) or HTTP (awkward-monetizer agent mcp --database hep --transport http, local-only by default).

On 100,000 CMS Open Data events (DoubleMuon Run2016H, record 30555), Claude answered all eight ADL questions correctly on the first attempt, doing cuts in SQL and combinatorics in Awkward. On the full record, 48.9 million events streamed from EOS in 22 minutes, all eight reproduce the reference exactly on a laptop, the SQL ones in under 3 s each. See docs/agent.md.

Documentation

  • docs/usage.md: development setup, datasets, ingestion, sharding, benchmarks, notebooks, tests
  • docs/agent.md: the agent, its tools, evaluation and demo
  • CONTRIBUTING.md: how to contribute and how releases are made

Status

A finished prototype in maintenance mode: bug fixes and releases continue, no new features are planned. Arrow transport, electrons and b-tag are open for anyone who wants to take them on.

About

Awkward Array + MonetDB for HEP: nested events as SQL tables with an exact round trip, and an MCP server that lets AI agents analyse CMS Open Data

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages