RUST CORE · DATAFUSION SQL · ARROW + PARQUET

The analytical database
for quantitative finance

h5i-db is a high-performance analytical database for quantitative finance and time-series workloads, designed for AI agents and written in Rust. Full SQL with native ASOF joins, OHLCV rollups, and VWAP, running directly on immutable Parquet segments.

Polars-class analytics, with a real database underneath.

cargo install h5i-db-cli
pip install h5i-db

Quant-grade analytics in an embedded engine.

A storage kernel and query engine tuned for the time axis: data is time-sorted on disk, pruned by manifest statistics before I/O, and queried through DataFusion SQL with native time-series operators. Version control, time travel, and previewable mutations come built in, so the speed never costs you safety.

Time-series SQL engine
Full SQL through DataFusion: joins, windows, CTEs, plus a native ASOF JOIN, time_bucket, vwap, wavg, and ewma. Storage is time-sorted, so bucketed aggregations stream instead of sorting.
Manifest pruning
Per-segment time ranges and column min/max live in the version manifest. Narrow time-range queries never open irrelevant files: 48 of 50 segments pruned before I/O in the benchmark, visible per query with --stats.
Fast, durable ingestion
3.2 million rows per second across 50 fsync-durable commits. Every write is an atomic compare-and-swap on a single HEAD: racing writers get an explicit version_conflict, never last-writer-wins.
Versioned storage
Immutable Parquet segments with per-version manifests, directly addressed by sequence. Version reads are O(1), as_of lookups are O(log V), and any past state is one manifest read away.
Time travel and snapshots
h5i('trades', 42) reads version 42; an RFC3339 timestamp reads as of a commit time; named snapshots pin exact versions across tables, keeping backtests reproducible forever.
Previewable mutations
--plan runs the full write path but stops before publish: exact affected rows, segments rewritten vs reused, before/after samples. plan apply is a metadata-only swap, and a mutation policy can force agents through review.
Crash-safe by construction
fsync-before-swap, checksums on every object, a manifest hash chain, and tests that kill the writer at every commit step. The old head survives, always. verify --deep re-checks the whole store.
Embedded, zero-ops
A single directory on disk, no server process to run. Drive it from the CLI, Rust, or Python; to_pandas() and Arrow interchange keep it inside your existing research stack.

Fast where quant workloads live.

20M trades and 5M quotes, disk-backed on all sides: h5i-db segments vs Polars, DuckDB, pandas, and PyArrow over the identical Parquet files, measured back-to-back in one session. Reproduce with cargo run -p h5i-db-bench.

faster selective scans
4.7×
faster OHLCV than any engine
3.7M
rows/s durable ingest
1.4ms
cold read, any version
workloadh5i-dbpolars 1.43duckdb 1.5pandas 3.0pyarrow 25
time-range scan 0.01% (48/50 segments pruned)7.3 ms15.0 ms17.0 ms13.5 ms10.1 ms
time-range scan 1%6.3 ms14.1 ms15.0 ms13.3 ms10.3 ms
1-minute OHLCV + VWAP rollup164 ms2 392 ms774 ms4 242 ms2 369 ms
ASOF join trades × quotes (by symbol)439 ms408 ms952 ms4 535 msn/a¹
full aggregation (group by symbol)47 ms90 ms47 ms653 ms113 ms
ingest (50 durable commits)3.7 M rows/sn/an/an/an/a
cold read of an old version1.4 msn/an/an/an/a

Narrow scans win on manifest pruning. The OHLCV rollup wins 4.7–26× because storage is already time-sorted and declared so — every baseline pays for a 20M-row sort. ASOF is a tie with Polars, full-scan decode a tie with DuckDB, both by design — and only one side has time travel, snapshots, previewable mutations, and crash-safe commits. ¹ PyArrow's experimental join_asof: 44.5 s at 2M rows, excluded. Full methodology in benchmarks/RESULTS.md.

A normal tool, with guardrails that hold.

No MCP server, no custom protocol: agents drive the same CLI and Python API as everyone else. The contract is what makes it agent-ready: machine-readable output, structured errors, hard resource limits, and a write path that policy can gate behind review.

agent shell · market.db
$ h5i-db query market.db "SELECT symbol, vwap(price,size) FROM trades GROUP BY symbol" \
    --format json --max-rows 1000 --timeout 30s        # machine formats + hard limits

$ h5i-db delete-range market.db trades --start 09:30 --end 09:31 --plan
{"plan_id": "5c41…", "summary": {"rows_affected": 12481, "segments_reused": 127}}
# errors are {code, message, retryable, hint} on stderr; exit codes are stable

$ h5i-db policy set market.db direct_delete=false    # agents must preview; humans can too
 deletes now require a reviewed plan
--format json | jsonl | csv | arrow
Machine-readable everything
Structured output in four formats, structured errors with a retryable flag and an actionable hint, and stable exit codes (0/2/3/4/5) an agent can branch on.
--max-rows · --timeout · --memory-limit-mb
Resource limits as flags
Row caps, query timeouts, memory ceilings with disk spilling, and --read-only. A supervisor can hard-cap any call without touching the database.
h5i-db policy set
Policy-enforceable review
Direct writes and reviewed plans share one write path; the policy chooses which operations may skip preview. Every manifest records execution_mode and the plan hash.

The approval surface for your data.

h5i-db ui market.db serves a loopback-only review surface: pending plans with exact previews, apply and reject, a version timeline with audit badges, version diffs, and an SQL scratchpad that shows pruning on every query. Read-only unless started with --allow-mutations.

Five commands to a working database.

CLI

$ cargo install h5i-db-cli $ h5i-db init market.db $ h5i-db create-table market.db trades --like ticks.parquet --time-column ts $ h5i-db ingest market.db trades ticks.parquet $ h5i-db query market.db "SELECT * FROM asof_join('trades','quotes','ts','ts','symbol')" $ h5i-db ui market.db # review surface on localhost

Python

$ pip install h5i-db >>> db = h5i_db.Database("market.db") >>> db.sql("SELECT * FROM h5i('trades', 42)").to_pandas() # time travel >>> plan = db.plan_delete_range("trades", start, end) >>> plan.apply() # preview first, commit second

Quant-grade speed. Agent-grade safety.

One embedded database for backtests, live research, and the agents that run them. Rust core, DataFusion SQL, versioned Parquet storage. Apache 2.0, no server, no lock-in.