[Announce] OxiRAG: A Logic-Verified, Speculative RAG Engine in Pure Rust (WASM-ready)
ā Rust š 2026-01-29 š¤ surdeus šļø 1Hi everyone,
I'm excited to share a new library I've been working on as part of the COOLJAPAN ecosystem: OxiRAG.
OxiRAG is a next-generation RAG (Retrieval-Augmented Generation) engine written in Pure Rust. Unlike traditional RAG approaches that simply retrieve and feed text to an LLM, OxiRAG introduces a "Speculative Verification" architecture to ensure both speed and logical consistency.
Repository: https://github.com/cool-japan/oxirag
CratesIO: https://crates.io/crates/oxirag
Key Features
- Logic Verification (The Judge): This is the core differentiator. It extracts claims from the generated drafts and verifies them mathematically using OxiZ (our custom SMT Solver). It catches logical inconsistencies (e.g., date conflicts, numerical mismatches) before they reach the user.
- Speculative Architecture: It treats cached answers as "Drafts" rather than absolute truths, injecting them into a lightweight SLM for context checking.
- 4-Layer Pipeline:
- Echo: Semantic Search (powered by
OxiBLAS&NumRS2) - Speculator: Draft Verification
- Judge: SMT-based Logic Verification
- Graph: Knowledge Graph traversal
- Echo: Semantic Search (powered by
- WASM-Native: Designed to run on the Edge (Cloudflare Workers) or directly in the browser.
- Patent-Safe Design: We deliberately avoid "Hidden States Caching" methods, focusing instead on text/vector-based speculative decoding.
Why Rust?
We needed something that could handle complex vector math (OxiBLAS) and formal logic verification (OxiZ) with zero overhead, while still being portable to WASM. Rust was the only choice.
Simple Usage
use oxirag::prelude::*;
#[tokio::main]
async fn main() -> Result<(), OxiRagError> {
// Build the pipeline with Semantic Search + SMT Verification
let pipeline = PipelineBuilder::new()
.with_echo(EchoLayer::default())
.with_judge(JudgeImpl::new(MockSmtVerifier::default()))
.build()?;
let result = pipeline.process(Query::new("What is the capital of France?")).await?;
println!("Verified Answer: {}", result.final_answer);
Ok(())
}
We are just getting started (v0.1.0). If you are interested in formal verification applied to GenAI, or building Edge-native RAG applications, Iād love to hear your feedback!
Thanks!
P.S. We also highly recommend checking out OxiFY, another newly released addition to our ecosystem.
1 post - 1 participant
š·ļø Rust_feed
