SEE BAGEL WORK / 001
Keep the incident.
Drop the hours around it.
Two hours of telemetry. One simulated hard-deceleration event. Keep the minute around it, with the context intact.
Synthetic sample · Codex + Bagel · Recorded live in the terminal
THE RESULT
The incident stays. So does its context.
RECORDING SPAN
2 hours → 60 seconds
FILE SIZE
99.13% smaller
4,628,852 → 40,195 bytes in this sample.
IN THE KEPT WINDOW
1,262 messages
Every original message preserved.
Bagel kept 30 seconds before and after the detected onset, across both acceleration and status topics. All 40 acceleration samples below the threshold survived. The original file stayed unchanged.
“Drop” means omitting data from a new output file. These measurements describe this small telemetry sample; they are not a general savings or throughput benchmark.
THE WORKFLOW
A condition. A preview. A smaller recording.
Define what matters.
Inspect the source and schemas. Find onsets where acceleration falls below −10 m/s², with a two-second debounce. Retain 30 seconds on either side.
“Keep 30 seconds before and 30 seconds after each onset. Preserve all topics in one new reduced MCAP; leave the source file intact.”
See what will be kept.
The actual preview found one onset at 3,600 seconds. The selected window ran from 3,570 to 3,630 seconds, inclusive. The operator approved it before the reduction ran.
Write the output. Check the records.
Bagel wrote the new MCAP. An independent record comparison verified every retained payload, schema, topic metadata entry, sequence number, and timestamp against the original.
Read the full operator prompt
Use Bagel on sample/two_hours.mcap. This is synthetic telemetry; /accel.value is acceleration in m/s^2. Find hard-deceleration onsets below -10 m/s^2, debounce by 2 seconds, and keep 30 seconds before and after each onset across all topics in one new MCAP. Keep the source intact. Inspect and preview first, show me what will be kept, and wait for my approval.
This is the prompt submitted in the recording. Codex selected and called Bagel’s tools, then paused for approval. The operator approved the preview and asked it to run the configuration and verify the output. No terminal output was scripted or reconstructed.
TRY THIS YOURSELF
Start with the same two hours.
The reproduction bundle includes the synthetic MCAP, generator, pipeline, saved requests, and verification scripts from the original worked example. The live-run evidence bundle separately records the fresh agent-driven execution shown above. The public evidence export normalizes local paths and excludes internal client metadata. The synthetic sample telemetry is available under CC0-1.0.
Download the live-run evidence ↓
Setup and replay steps
Use a separate checkout to preserve the supplied evidence. This run used Bagel 2.2.3 at commit f00af3bc02b3b138b7dd6d7aab78666db29e2563, Python 3.10–3.12, and uv. Install dependencies with uv sync --frozen.
Unzip the bundle into the checkout’s artifacts/ directory. Follow REPRODUCE.md from the repository root: generate the sample, prepare portable requests, inspect the schemas, and preview the reduction. Review the window before running the saved run request, then verify the output.
The saved calls run through local MCP stdio. This reproduction path needs neither Docker nor an LLM API key. Replaying overwrites logs and sample data in the extracted demo folder. Library versions can affect exact serialized file sizes.
What this example establishes
A real local MCAP reduction around one simulated onset, preservation of all original in-window records, and an unchanged source file. The fixture contains 20 Hz acceleration and 1 Hz status telemetry; its units are a documented convention.
It does not demonstrate a field incident, camera footage, fleet deployment, cloud transfer, viewer compatibility, large-file performance, or behavior across multiple or overlapping incidents. This is one recorded agent interaction with operator approval, not a benchmark of natural-language reliability.
Video text description
- Request and inspection: The operator asks for 30 seconds around hard-deceleration onsets in synthetic telemetry. Codex loads Bagel’s pipeline instructions and inspects the source, topic schema, and available reduction module.
- Preview: Bagel finds one onset. Codex shows a 60-second window across both topics and the proposed configuration, then pauses for approval.
- Execution: The operator approves. Codex invokes Bagel’s real run_pipeline tool, which writes a new MCAP.
- Verification: Codex queries the output using Bagel and checks the source checksum. The result is 40,195 bytes, 60 seconds, 1,201 acceleration messages, and 61 status messages. The source is unchanged.
TASK GUIDE · REDUCE LOGS AROUND INCIDENTS
How to keep incident windows from an MCAP
Bagel detects onsets with a SQL predicate, previews the retained windows, then writes their union into a new MCAP after approval. Inspect the source and topic schema before adapting this example to another recording.
For this fixture, /accel is a protobuf DoubleValue; its value field means m/s² by the generator's documented convention. That unit is not encoded in the protobuf schema. The executed predicate is "/accel"['value'] < -10.
preview_pipeline accepts path, event_topic, predicate, pre_seconds, post_seconds, and debounce_seconds. It counts false-to-true transitions, applies debounce, and merges overlapping keep windows. run_pipeline takes a full pipeline config; the MCAP task is src.pipeline.tasks.reduce.mcap. Review the event count and intervals before running.
The following saved-call replay is separate from the live recording above. Download the reproduction bundle, clone the measured revision into a new directory, and extract the bundle into artifacts/. Use Python 3.10–3.12 and uv; dependency installation needs network access.
git clone https://github.com/Extelligence-ai/bagel.git bagel-incident-replay
cd bagel-incident-replay
git checkout f00af3bc02b3b138b7dd6d7aab78666db29e2563
mkdir -p artifacts
unzip /absolute/path/to/incident-demo-2026-09-07.zip -d artifacts
uv sync --frozenuv run python artifacts/incident-demo-2026-09-07/generate_sample.py
uv run python artifacts/incident-demo-2026-09-07/prepare_requests.py
uv run python artifacts/incident-demo-2026-09-07/mcp_call.py artifacts/incident-demo-2026-09-07/inspect-requests.json
uv run python artifacts/incident-demo-2026-09-07/mcp_call.py artifacts/incident-demo-2026-09-07/preview-requests.jsonRead the schemas, pipeline.yaml and evidence/07-preview.json in the extracted folder. Confirm the selected window with the operator. Only after approval:
uv run python artifacts/incident-demo-2026-09-07/mcp_call.py artifacts/incident-demo-2026-09-07/run-requests.json
uv run python artifacts/incident-demo-2026-09-07/verify_output.py
uv run python artifacts/incident-demo-2026-09-07/mcp_call.py artifacts/incident-demo-2026-09-07/verify-requests.jsonThe helper uses local MCP stdio without a model or Docker. It saves requests and responses; the verification script compares retained records. Replaying rewrites the extracted sample and evidence logs, so preserve the downloaded archive. Exact serialized sizes can vary with library versions.
For other recordings, confirm the acceleration axis and unit, choose a meaningful threshold, and inspect the output's topics and time ranges. A window is centered on the onset; a long incident may extend beyond it. Overlaps are merged, and the preview's kept fraction uses the event-topic span, which may differ from the full-source span. Original timestamps remain, so separated retained windows leave gaps in the output timeline.
Generic MCAP raw copying does not need ROS, but detecting the event requires a queryable topic schema. ROS 2 SQLite writers need a ROS runtime. See MCAP and ROS format requirements and the full reduction runbook.
What would you keep?
Try Bagel with your data, or follow along for the next workflow.
