COOLJAPAN
← All posts

OxigenAI 0.1.0 Released — Japan's Government Legal AI, Rebuilt in Pure Rust with Formal Verification

OxigenAI is a Pure Rust GovTech reimplementation of the Digital Agency's government legal-AI system (源内 / GenAI). It keeps the familiar law-report API but adds OxiZ SMT contradiction detection and Legalis-RS LegalResult<T> outcome classification — turning a probabilistic LLM+RAG service into a verifiable computational-law platform.

release oxigenai govtech legal-tech computational-law smt legalis pure-rust

A government legal-AI service should be able to prove its own consistency. Now one can.

Today we released OxigenAI 0.1.0 — a Pure Rust reimplementation of the Japan Digital Agency’s government legal-AI system “源内 / GenAI”, rebuilt on the Legalis-RS computational-law framework and the OxiZ SMT solver.

No C. No C++. No Fortran. No opaque Python service you must trust on faith. OxigenAI keeps the original system’s law-report API surface but replaces “a probabilistic LLM that sounds confident” with a stack that can actually check what it says: it compiles to a single static oxigenai binary that serves both the HTTP API and a full set of CLI subcommands, and every legal-consistency claim it makes is backed by an SMT proof, not a vibe.

Why 0.1.0 matters

The Digital Agency’s GenAI is, at its core, a cloud-native LLM + RAG application: Vertex AI Gemini for generation, BigQuery vector search over the e-Gov statutory XML corpus, web grounding for law-name inference. It produces fluent legal reports — but a fluent report is not a verified one. When an LLM says “there is no contradiction between these provisions,” nothing in the pipeline has actually checked that claim. Discretionary judgment and deterministic rule-application blur together in the prose.

OxigenAI inherits the useful parts of that architecture and adds the missing layer — formal verification:

This is the debut — a 0.1.0 — and it’s deliberately a real, working MVP rather than a teaser: six report modes, four endpoints, and a policy simulator are all here on day one.

Technical Deep Dive: the pipeline

OxigenAI is an Axum + Tokio service whose request pipeline threads the LLM/RAG world through the Legalis-RS verification core:

  1. Law-name inference & retrieval. Gemini plus Google-Search grounding infers which statute the question is about; BigQuery vector search retrieves candidate articles from the e-Gov statutory XML corpus.
  2. Verification (legalis-verifier + OxiZ). The selected provisions are formalized and checked by the OxiZ SMT solver for logical contradictions. This is the step the original system simply does not have.
  3. Outcome classification (legalis-core). Results are wrapped in LegalResult<T>, separating deterministic application from discretionary judgment and grading the outcome.
  4. Report generation (Gemini 2.5 Flash). A final, sourced legal report is produced — now carrying the verification section and the deterministic/discretionary breakdown.

Around that core sit the rest of the Legalis-RS crates that make OxigenAI more than a chatbot:

The Legalis-RS framework (legalis-core, legalis-verifier, legalis-dsl, legalis-sim, legalis-jp, all at 0.1.5) and OxiZ are the foundation that turns the familiar GenAI API into genuine computational law.

Getting Started

cargo install oxigenai

The unified binary is both the server and the CLI. To run the HTTP API:

# query / compile / simulate / formalize need Google Cloud (Vertex AI + BigQuery)
gcloud auth application-default login

# launch the API (default port 8080)
PORT=8080 oxigenai serve
# health check
curl -s http://localhost:8080/health

# law report — same schema as the original GenAI system
curl -s -X POST http://localhost:8080/ \
  -H 'Content-Type: application/json' \
  -d '{"inputs":{"input_text":"What is the definition of personal information under the Act on the Protection of Personal Information?"}}'

Or use the CLI directly — the default subcommand is query:

oxigenai "Explain the overtime-hours cap under the Labor Standards Act"
oxigenai q "Subcontract Act payment-deadline rules?"        # short alias

# compile a statute to Legalis DSL
oxigenai compile --query "Labor Standards Act" --dsl-only

# run a policy simulation
oxigenai simulate "Labor Standards Act application" --population 500

# formalize a legal fact and test applicability
oxigenai formalize "Right to convert to indefinite term after 5+ years fixed-term" \
  --age 35 \
  --attr employment_type=fixed_term \
  --attr years_employed=6

What’s inside

This is the foundation

OxigenAI is what happens when a real piece of GovTech meets the COOLJAPAN computational-law stack. It builds directly on Legalis-RS — the statute parser/verifier/simulator framework — and on OxiZ, the Pure Rust SMT solver that does the contradiction detection. Where the original GenAI is a probabilistic LLM service, OxigenAI is a verifiable platform: same API, but every legal-consistency claim is backed by a proof.

Repository: https://github.com/cool-japan/oxigenai

Star the repo if you believe government legal AI should be able to prove what it claims.

Pure Rust computational law is here — fast, safe, and sovereign.

KitaSan at COOLJAPAN OÜ May 7, 2026

↑ Back to all posts