Omni Engine v2.0: Sovereign Autonomous Agent Runtime & Causal-DAG KV-Cache Pruning
1
3 commits
1 linked in READMEs
updated Sep 22, 2026
"Why should autonomous agency be the exclusive monopoly of multi-megawatt corporate data centers?"
Omni Engine v2.0.0 is an independent, single-binary, zero-dependency autonomous AI execution engine written in pure Rust. It transforms compact open-weights language models (1.5Bβ3B parameters) into self-healing, deterministic execution agents operating on ordinary consumer laptops without cloud dependencies, API subscriptions, or external environment setup.
Modern frontier AI labs address agentic execution failures through brute force: inflating parameter counts from 70B to 405B+, chaining thousands of API calls, and maintaining ever-growing, unbounded conversation context windows.
When a small model (1.5Bβ3B) attempts complex multi-step reasoning, standard inference runtimes (such as vLLM or standard llama-server) fail catastrophically:
Omni Engine re-engineers this foundation from first principles in pure Rust:
mlua 0.9 vendored) with zero pip/npm/go installations needed on the host.MemoryVfs): All file manipulations, spreadsheets, and intermediate documents are created strictly in volatile memory. A single byte never touches the host disk without an interactive user confirmation gate (y/N). ββββββββββββββββββββββββββββββββββββββββββββββββ
β OMNI AGENT CORE β
β (Grounded System Persona & CLI) β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
[Mode Triage Router]
β
βββββββββββββββββββββββββ΄ββββββββββββββββββββββββ
βΌ βΌ
[Fast Interactive Mode] [Deep Autonomous Mode]
(Sub-50ms Single-Pass) (Multi-Stage Reasoning)
β β
β [Internal Supervisor Probe]
β - Speculative Branching
β - Causal Rollback & Pruning
β - Distilled Causal Lessons
β β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β EXECUTIVE HANDS & VFS β
βββββββββββββββββββββββββββββββ€
β Embedded Lua 5.4 Sandbox β
β - Pure In-Memory VFS (RAM) β
β - Native Rust HTTP (Fetch) β
β - Browser Terminal Lens β
β - Interactive Commit Gate β
ββββββββββββββββ¬βββββββββββββββ
β User Confirmation (y/N)
βΌ
[Host File System]
Let context length $L = N + t - 1$. Under standard Grouped-Query Attention (GQA):
$$ \alpha_{t, i}^{(h)} = \frac{\exp\left(\frac{\mathbf{q}_t^{(h)} (\mathbf{k}i^{(h)})^T}{\sqrt{d_k}}\right)}{\sum{j=1}^L \exp\left(\frac{\mathbf{q}_t^{(h)} (\mathbf{k}_j^{(h)})^T}{\sqrt{d_k}}\right)} $$
In standard append-only caching:
$$ L_{\text{standard}}(m) = L_0 + \sum_{k=1}^m \left( |\mathbf{y}_k| + |\mathbf{o}_k| \right) $$
where $|\mathbf{y}_k|$ is the step output and $|\mathbf{o}_k|$ is error feedback.
Theorem 1 (Attention Dilution in Monotonic Caching):
Partition the cache indices into causally relevant root-cause tokens $\mathcal{R}$ and accumulated intermediate exploratory noise $\mathcal{N}$ ($L = |\mathcal{R}| + |\mathcal{N}|$, $\mathcal{R} \cap \mathcal{N} = \emptyset$, $|\mathcal{N}| \gg |\mathcal{R}|$):
$$ \lim_{|\mathcal{N}| \to \infty} \sum_{i \in \mathcal{R}} \alpha_{t, i} = \lim_{|\mathcal{N}| \to \infty} \frac{\sum_{i \in \mathcal{R}} \exp(u_i)}{\sum_{i \in \mathcal{R}} \exp(u_i) + \sum_{j \in \mathcal{N}} \exp(u_j)} = 0 $$
Proof: As intermediate exploration continues, the denominator diverges to $+\infty$, mathematically forcing attention on the original root-cause state to zero.
We define agent execution history as a dynamic graph $\mathcal{G} = (\mathcal{V}, \mathcal{E})$.
Each step $v_i \in \mathcal{V}$ corresponds to:
$$ v_i = \langle \text{id}_i, \mathcal{D}_i, I(v_i), O(v_i), \tau_i, \sigma_i \rangle $$
Where:
Dependency edges are computed via deterministic set intersection:
$$ e_{i \to j} \in \mathcal{E} \iff O(v_i) \cap I(v_j) \neq \emptyset $$
When an execution crash occurs at step $v_{\text{crash}}$ referencing error target entity $E_{\text{target}}$:
$$ \mathcal{C}(E_{\text{target}}) = {v_k \in \mathcal{V} \mid E_{\text{target}} \in O(v_k) \cup I(v_k)} $$
All intermediate operations $v_{\text{noise}} \notin \mathcal{C}(E_{\text{target}})$ are physically masked out:
$$ L_{\text{causal}} = \sum_{v_k \in \mathcal{C}(E_{\text{target}})} |\tau_k| \ll L_{\text{standard}} $$
When step $v_i$ fails, rather than appending failure tokens to the prompt, Omni Engine triggers an in-place KV sequence truncation:
$$ \text{PruneKV}(p_{\text{start}}^{(i)}, p_{\text{head}}) \implies p_{\text{head}} \leftarrow p_{\text{start}}^{(i)} $$
This operates in physical O(1) tensor complexity, removing the failure basin from the autoregressive probability density function.
Evaluated on compact edge hardware (4 Physical Cores, 16 GB RAM, Qwen 2.5 Coder 1.5B Instruct GGUF):
| Metric | Standard Stateful Caching (vLLM / llama-server) | Omni Engine Causal-DAG Pruning | Advantage |
|---|---|---|---|
| Turn 1 Output | "VQKRHT" (Wrong) | "VQKRHT" (Wrong) | Identical Baseline |
| Cache Handling | Appends error to active KV | In-place Rollback [72, end) | O(1) Truncation |
| Turn 2 Output | "VQKRHT" (Identical Repeat) | "QRKWBS" (100% Correct) | Escape Attractor |
| Turn 3 Output | Unmatched / Infinite Trap | N/A (Resolved on Turn 2) | Clean Termination |
| Success Rate | 0.0% (Infinite Lock-in) | 100.0% (Turn 2 Recovery) | Deterministic |
| Active Context | 383 tokens (Compounding) | 221 tokens (Strictly bounded) | -42.3% Context Bloat |
| Dimension | Standard Monotonic Stateful Caching | Omni Causal-DAG Architecture | Advantage |
|---|---|---|---|
| Active KV Context | 1,850 tokens | 294 tokens | -84.1% Active Tokens |
| Active RAM Footprint | 358.4 MB | 42.6 MB | -88.1% Memory Savings |
| Noise Contamination | 72.8% (Unrelated operations retained) | 0.0% (Ancestral cone isolated) | Zero Attention Dilution |
| Hydration Latency | N/A (Retains all bloat) | 0.00 ms (< 100 Β΅s) | Instantaneous Swapping |
| Time-To-First-Token | Monotonically decaying | Flat, constant latency | 16.3x Speedup |
mlua 0.9 / Lua 5.4)os.execute and raw file io.open are stripped from the environment.vfs.write(path, content)vfs.read(path)web.fetch(url): Bounded HTTP/HTTPS fetching with user-agent and timeouts.print(msg): Real-time telemetry streaming into the engine.MemoryVfs)Arc<RwLock<HashMap<PathBuf, Vec<u8>>>>.(y/N) before any file touches permanent storage.BrowserTerminalLens)[#1 Input], [#2 Link].ActiveEvaluating, TrappedAndPruned, ValidatedSuccess).DistilledCausalLesson) injected as strict negative constraints into subsequent branches without context bloat.# Clone the repository
git clone https://github.com/ielfeqi-rgb/omni_engine.git
cd omni_engine
# Compile standalone release binary
cargo build --release
# The zero-dependency binary is located at target/release/omni_engine
# Launch interactive agentic session
./target/release/omni_engine chat
# Execute one-shot autonomous task
./target/release/omni_engine ask "Generate a technology sales spreadsheet and save to sales_q3.csv"
# Inspect physical hardware specs and thread topology
./omni_engine status
# List available local GGUF models
./omni_engine models
# Start background local inference daemon
./omni_engine start qwen2.5-coder-1.5b-instruct-q4_k_m.gguf --port 8081 --ctx 2048
# Create secure Bearer API tokens
./omni_engine keys new "Production-Key"
# Start Web UI Dashboard and OpenAI-compatible REST server (/v1/chat/completions)
./omni_engine serve --port 8090
The complete academic paper with formal theorems, mathematical proofs, set-theoretic formulations, and benchmark tables is included in this repository:
ielfeqi@gmail.com)RESEARCH_PAPER.md and RESEARCH_PAPER.html@article{elfeqi2026causaldag,
title = {Causal-DAG KV-Cache Pruning and Reactive Hydration: Eliminating Attention Dilution and Memory Bloat in Autonomous LLM Reasoning Loops},
author = {Elfeqi, Ibrahim},
journal = {Omni Engine Open-Source Research Specifications},
year = {2026},
url = {https://github.com/ielfeqi-rgb/omni_engine},
contact = {ielfeqi@gmail.com}
}
This project is licensed under the Dual Open-Source License: Creative Commons Attribution 4.0 International (CC BY 4.0) & Apache License 2.0.
ielfeqi@gmail.com) and reference the upstream project repository at https://github.com/ielfeqi-rgb/omni_engine.3 commits
Omni Engine v2.0: Sovereign Autonomous Agent Runtime & Causal-DAG KV-Cache Pruning
1
3 commits
1 linked in READMEs
updated Sep 22, 2026
"Why should autonomous agency be the exclusive monopoly of multi-megawatt corporate data centers?"
Omni Engine v2.0.0 is an independent, single-binary, zero-dependency autonomous AI execution engine written in pure Rust. It transforms compact open-weights language models (1.5Bβ3B parameters) into self-healing, deterministic execution agents operating on ordinary consumer laptops without cloud dependencies, API subscriptions, or external environment setup.
Modern frontier AI labs address agentic execution failures through brute force: inflating parameter counts from 70B to 405B+, chaining thousands of API calls, and maintaining ever-growing, unbounded conversation context windows.
When a small model (1.5Bβ3B) attempts complex multi-step reasoning, standard inference runtimes (such as vLLM or standard llama-server) fail catastrophically:
Omni Engine re-engineers this foundation from first principles in pure Rust:
mlua 0.9 vendored) with zero pip/npm/go installations needed on the host.MemoryVfs): All file manipulations, spreadsheets, and intermediate documents are created strictly in volatile memory. A single byte never touches the host disk without an interactive user confirmation gate (y/N). ββββββββββββββββββββββββββββββββββββββββββββββββ
β OMNI AGENT CORE β
β (Grounded System Persona & CLI) β
ββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
[Mode Triage Router]
β
βββββββββββββββββββββββββ΄ββββββββββββββββββββββββ
βΌ βΌ
[Fast Interactive Mode] [Deep Autonomous Mode]
(Sub-50ms Single-Pass) (Multi-Stage Reasoning)
β β
β [Internal Supervisor Probe]
β - Speculative Branching
β - Causal Rollback & Pruning
β - Distilled Causal Lessons
β β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β EXECUTIVE HANDS & VFS β
βββββββββββββββββββββββββββββββ€
β Embedded Lua 5.4 Sandbox β
β - Pure In-Memory VFS (RAM) β
β - Native Rust HTTP (Fetch) β
β - Browser Terminal Lens β
β - Interactive Commit Gate β
ββββββββββββββββ¬βββββββββββββββ
β User Confirmation (y/N)
βΌ
[Host File System]
Let context length $L = N + t - 1$. Under standard Grouped-Query Attention (GQA):
$$ \alpha_{t, i}^{(h)} = \frac{\exp\left(\frac{\mathbf{q}_t^{(h)} (\mathbf{k}i^{(h)})^T}{\sqrt{d_k}}\right)}{\sum{j=1}^L \exp\left(\frac{\mathbf{q}_t^{(h)} (\mathbf{k}_j^{(h)})^T}{\sqrt{d_k}}\right)} $$
In standard append-only caching:
$$ L_{\text{standard}}(m) = L_0 + \sum_{k=1}^m \left( |\mathbf{y}_k| + |\mathbf{o}_k| \right) $$
where $|\mathbf{y}_k|$ is the step output and $|\mathbf{o}_k|$ is error feedback.
Theorem 1 (Attention Dilution in Monotonic Caching):
Partition the cache indices into causally relevant root-cause tokens $\mathcal{R}$ and accumulated intermediate exploratory noise $\mathcal{N}$ ($L = |\mathcal{R}| + |\mathcal{N}|$, $\mathcal{R} \cap \mathcal{N} = \emptyset$, $|\mathcal{N}| \gg |\mathcal{R}|$):
$$ \lim_{|\mathcal{N}| \to \infty} \sum_{i \in \mathcal{R}} \alpha_{t, i} = \lim_{|\mathcal{N}| \to \infty} \frac{\sum_{i \in \mathcal{R}} \exp(u_i)}{\sum_{i \in \mathcal{R}} \exp(u_i) + \sum_{j \in \mathcal{N}} \exp(u_j)} = 0 $$
Proof: As intermediate exploration continues, the denominator diverges to $+\infty$, mathematically forcing attention on the original root-cause state to zero.
We define agent execution history as a dynamic graph $\mathcal{G} = (\mathcal{V}, \mathcal{E})$.
Each step $v_i \in \mathcal{V}$ corresponds to:
$$ v_i = \langle \text{id}_i, \mathcal{D}_i, I(v_i), O(v_i), \tau_i, \sigma_i \rangle $$
Where:
Dependency edges are computed via deterministic set intersection:
$$ e_{i \to j} \in \mathcal{E} \iff O(v_i) \cap I(v_j) \neq \emptyset $$
When an execution crash occurs at step $v_{\text{crash}}$ referencing error target entity $E_{\text{target}}$:
$$ \mathcal{C}(E_{\text{target}}) = {v_k \in \mathcal{V} \mid E_{\text{target}} \in O(v_k) \cup I(v_k)} $$
All intermediate operations $v_{\text{noise}} \notin \mathcal{C}(E_{\text{target}})$ are physically masked out:
$$ L_{\text{causal}} = \sum_{v_k \in \mathcal{C}(E_{\text{target}})} |\tau_k| \ll L_{\text{standard}} $$
When step $v_i$ fails, rather than appending failure tokens to the prompt, Omni Engine triggers an in-place KV sequence truncation:
$$ \text{PruneKV}(p_{\text{start}}^{(i)}, p_{\text{head}}) \implies p_{\text{head}} \leftarrow p_{\text{start}}^{(i)} $$
This operates in physical O(1) tensor complexity, removing the failure basin from the autoregressive probability density function.
Evaluated on compact edge hardware (4 Physical Cores, 16 GB RAM, Qwen 2.5 Coder 1.5B Instruct GGUF):
| Metric | Standard Stateful Caching (vLLM / llama-server) | Omni Engine Causal-DAG Pruning | Advantage |
|---|---|---|---|
| Turn 1 Output | "VQKRHT" (Wrong) | "VQKRHT" (Wrong) | Identical Baseline |
| Cache Handling | Appends error to active KV | In-place Rollback [72, end) | O(1) Truncation |
| Turn 2 Output | "VQKRHT" (Identical Repeat) | "QRKWBS" (100% Correct) | Escape Attractor |
| Turn 3 Output | Unmatched / Infinite Trap | N/A (Resolved on Turn 2) | Clean Termination |
| Success Rate | 0.0% (Infinite Lock-in) | 100.0% (Turn 2 Recovery) | Deterministic |
| Active Context | 383 tokens (Compounding) | 221 tokens (Strictly bounded) | -42.3% Context Bloat |
| Dimension | Standard Monotonic Stateful Caching | Omni Causal-DAG Architecture | Advantage |
|---|---|---|---|
| Active KV Context | 1,850 tokens | 294 tokens | -84.1% Active Tokens |
| Active RAM Footprint | 358.4 MB | 42.6 MB | -88.1% Memory Savings |
| Noise Contamination | 72.8% (Unrelated operations retained) | 0.0% (Ancestral cone isolated) | Zero Attention Dilution |
| Hydration Latency | N/A (Retains all bloat) | 0.00 ms (< 100 Β΅s) | Instantaneous Swapping |
| Time-To-First-Token | Monotonically decaying | Flat, constant latency | 16.3x Speedup |
mlua 0.9 / Lua 5.4)os.execute and raw file io.open are stripped from the environment.vfs.write(path, content)vfs.read(path)web.fetch(url): Bounded HTTP/HTTPS fetching with user-agent and timeouts.print(msg): Real-time telemetry streaming into the engine.MemoryVfs)Arc<RwLock<HashMap<PathBuf, Vec<u8>>>>.(y/N) before any file touches permanent storage.BrowserTerminalLens)[#1 Input], [#2 Link].ActiveEvaluating, TrappedAndPruned, ValidatedSuccess).DistilledCausalLesson) injected as strict negative constraints into subsequent branches without context bloat.# Clone the repository
git clone https://github.com/ielfeqi-rgb/omni_engine.git
cd omni_engine
# Compile standalone release binary
cargo build --release
# The zero-dependency binary is located at target/release/omni_engine
# Launch interactive agentic session
./target/release/omni_engine chat
# Execute one-shot autonomous task
./target/release/omni_engine ask "Generate a technology sales spreadsheet and save to sales_q3.csv"
# Inspect physical hardware specs and thread topology
./omni_engine status
# List available local GGUF models
./omni_engine models
# Start background local inference daemon
./omni_engine start qwen2.5-coder-1.5b-instruct-q4_k_m.gguf --port 8081 --ctx 2048
# Create secure Bearer API tokens
./omni_engine keys new "Production-Key"
# Start Web UI Dashboard and OpenAI-compatible REST server (/v1/chat/completions)
./omni_engine serve --port 8090
The complete academic paper with formal theorems, mathematical proofs, set-theoretic formulations, and benchmark tables is included in this repository:
ielfeqi@gmail.com)RESEARCH_PAPER.md and RESEARCH_PAPER.html@article{elfeqi2026causaldag,
title = {Causal-DAG KV-Cache Pruning and Reactive Hydration: Eliminating Attention Dilution and Memory Bloat in Autonomous LLM Reasoning Loops},
author = {Elfeqi, Ibrahim},
journal = {Omni Engine Open-Source Research Specifications},
year = {2026},
url = {https://github.com/ielfeqi-rgb/omni_engine},
contact = {ielfeqi@gmail.com}
}
This project is licensed under the Dual Open-Source License: Creative Commons Attribution 4.0 International (CC BY 4.0) & Apache License 2.0.
ielfeqi@gmail.com) and reference the upstream project repository at https://github.com/ielfeqi-rgb/omni_engine.3 commits