Add runtime support for aggregate functions (count, sum, avg, min, max) with GROUP BY semantics, built on a single wide RecordBatch that eliminates correlation tracking by construction. Execution engine (exec/query.rs): - Replace HashMap<String, RecordBatch> with Option<RecordBatch> where columns are prefixed as <variable>.<property> - NodeScan prefixes columns and cross-joins with existing batch - Expand collects (src_row, dst_id) pairs, takes wide batch rows, appends prefixed destination columns via hconcat - Filter applies single mask to entire wide batch - AntiJoin: fast-path returns BooleanArray mask; slow-path slices one row for inner pipeline execution Projection engine (exec/projection.rs): - aggregate_return groups rows by non-aggregate key columns using length-prefixed string encoding, computes per-group aggregates - SUM accumulates into f64 to avoid integer overflow - MIN/MAX support both numeric and string types - Empty input returns count=0, others=null Compiler (typecheck.rs): - T8: split MIN/MAX from SUM/AVG — allow string arguments - T9: non-aggregate expressions in aggregate queries must be property accesses or variables - SUM type inference returns Float64 (matching runtime) Tests: 8 new integration tests covering grouped count, global count, sum/avg/min/max per company, aggregate+order+limit, string min/max, multi-hop aggregates, and edge cases. https://claude.ai/code/session_019o5NRyYomgETFyd7hpiLey |
||
|---|---|---|
| .github/workflows | ||
| crates | ||
| docker | ||
| docs | ||
| scripts | ||
| .dockerignore | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| Dockerfile | ||
| LICENSE | ||
| omnigraph.example.yaml | ||
| README.md | ||
| rust-toolchain.toml | ||
| SECURITY.md | ||
Omnigraph
Omnigraph is a typed property graph database built on Lance. It combines
schema-first graph modeling, typed queries and mutations, Git-style graph
workflows, and storage that runs equally well on a local directory or an
s3:// URI.
Quick Install
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/install.sh | bash
This installs omnigraph and omnigraph-server into ~/.local/bin from
published release binaries.
Or install with Homebrew:
brew tap ModernRelay/tap
brew install ModernRelay/tap/omnigraph
One-Command Local RustFS Bootstrap
curl -fsSL https://raw.githubusercontent.com/ModernRelay/omnigraph/main/scripts/local-rustfs-bootstrap.sh | bash
That bootstrap:
- starts RustFS on
127.0.0.1:9000 - creates a bucket and S3-backed repo
- loads the checked-in context fixture
- launches
omnigraph-serveron127.0.0.1:8080
Docker must be installed and running first.
The RustFS bootstrap prefers the rolling edge binaries and only falls back to
source builds when release assets are unavailable.
If a previous run left objects under the same repo prefix but did not finish
initializing the repo, rerun with RESET_REPO=1 or set PREFIX to a new
value.
Good Fit For
- Team knowledge graphs and internal context graphs
- Research, decisions, and evidence tracking
- Collaborative knowledge systems with reviewable changes
- Private self-hosted graph backends for local or on-prem AI tooling
Why Omnigraph
- Typed schema, typed queries, and typed mutations
- Git-style graph workflows: branches, commits, merges, and transactional runs
- Local-first and S3-native storage with snapshot-pinned reads
- Graph traversal plus text, fuzzy, BM25, vector, and RRF search in one runtime
- Policy as code for server-side access control
Quick Start
From a checkout of this repo:
cargo build --workspace
cargo run -p omnigraph-cli -- init \
--schema crates/omnigraph/tests/fixtures/test.pg \
./repo.omni
cargo run -p omnigraph-cli -- load \
--data crates/omnigraph/tests/fixtures/test.jsonl \
./repo.omni
cargo run -p omnigraph-cli -- read \
./repo.omni \
--query crates/omnigraph/tests/fixtures/test.gq \
--name friends_of \
--params '{"name":"Alice"}'
init also scaffolds an omnigraph.yaml next to the repo if one does not
already exist.
Run A Server
Serve the same repo over HTTP:
cargo run -p omnigraph-server -- ./repo.omni --bind 127.0.0.1:8080
Then query it remotely:
cargo run -p omnigraph-cli -- read \
--target http://127.0.0.1:8080 \
--query crates/omnigraph/tests/fixtures/test.gq \
--name get_person \
--params '{"name":"Alice"}'
Server routes include /healthz, /snapshot, /export, /read, /change,
/schema/apply, /ingest, /branches, /runs, and /commits.
To require auth, set OMNIGRAPH_SERVER_BEARER_TOKEN on the server and set the
matching bearer token env var in your CLI target config.
Common Commands
Core repo flow:
omnigraph init --schema ./schema.pg ./repo.omni
omnigraph load --data ./data.jsonl --mode overwrite ./repo.omni
omnigraph schema apply --schema ./next.pg ./repo.omni --json
omnigraph snapshot ./repo.omni --branch main --json
omnigraph read --uri ./repo.omni --query ./queries.gq --name get_person --params '{"name":"Alice"}'
omnigraph change --uri ./repo.omni --query ./queries.gq --name insert_person --params '{"name":"Mina","age":28}'
omnigraph branch create --uri ./repo.omni --from main feature-x
omnigraph branch merge --uri ./repo.omni feature-x --into main
More CLI examples, config patterns, and admin commands live in docs/cli.md.
Production Features
- Branches, commits, merge-base-aware graph merges, and transactional runs
- Snapshot-pinned reads across local and S3-backed repos
- Traversal plus text, fuzzy, BM25, vector, and RRF search
- Axum server for reads, changes, export, branches, commits, and runs
- Cedar-based server-side authorization
Docs
Build And Test
cargo build --workspace
cargo check --workspace
cargo test --workspace
Notes:
- Rust stable toolchain, edition 2024
- CI runs
cargo test --workspace --locked - Full CI and some local test flows require
protobuf-compiler - S3 integration tests expect an S3-compatible endpoint such as RustFS
Workspace Crates
crates/omnigraph-compiler: shared schema/query parser, typechecker, catalog, and IR loweringcrates/omnigraph: storage/runtime, branching, merge, change detection, and query executioncrates/omnigraph-cli: CLI for init/load/ingest/read/change/branch/snapshot/export/policy operationscrates/omnigraph-server: Axum HTTP server for remote reads, changes, ingest, export, branches, commits, and runs
Contributing
Please open an issue, spec, or design discussion before sending large code changes. Design feedback and concrete problem statements are the fastest way to collaborate on the roadmap.