ConceptioArchivearXiv CS
arXiv CSopen access

An Explicit World Model Based on Data-First Ontology: DaoQL Multimodal Storage Validation and Counterfactual Reasoning Evaluation

Unknown · 2026 · arxiv_cs
arXiv CS · Papers · License: Open Access · 2026
Open Source ↗Direct PDF ↓
databasesdatamanagementsqlstorage
databases, sql, data management, storage

An Explicit World Model Based on Data-First Ontology: DaoQL Multimodal Storage Validation and

arXiv:2607.17269v1 [cs.AI] 19 Jul 2026

Counterfactual Reasoning Evaluation Zhanbo Li, Shifeng Wu, Xiangjin Meng, Wenjie Cai Graduate Students, School of Mathematics and Statistics, Chongqing University DaoQL Project Group Contact affiliation: Guangzhou Polytechnic Normal University [email protected] [email protected] [email protected] [email protected] May 2026

Abstract Large language models encode world models implicitly in neural weights, which exposes four structural risks in high-precision domains such as medicine and finance: hallucination, frozen knowledge, poor explainability, and poor modifiability. This paper proposes datafirst ontology: LLMs are treated as reasoning and language engines, while deterministic knowledge is moved into an explicit multimodal database, DaoQL. We formalize an explicit world model and show that, under rule independence, deterministic evaluation, and fixed conflict resolution, explicit models provide a sufficient condition for composable counterfactual decomposability; implicit models lack atomic read/δ semantics and therefore provide no comparable architectural guarantee. The implemented system focuses on DaoQL’s verified storage layer and explicit Eval path, integrating graph, column, vector, and full-text engines within one process. KVCache graph nodes, expert hot updates, and the DaoQL-Agent runtime remain future work. On an embedded same-machine setup, DaoQL reports graph BFS at 1.20 ms, HNSW at 83.1 µs, and a Fluent hybrid query at 105.8 µs; these results indicate engineering potential but must be interpreted with deployment-shape differences from client-server systems. Exploratory measurements on LDBC SNB SF1 [15] and ANNBenchmarks [2] further show 34/34 query coverage with interactive-class queries mostly in the sub-millisecond to millisecond range, but only 1.8 QPS overall due to long-tail BI/IC queries; ANN-Benchmarks reaches Recall@10 ≥ 99% at thousand-level QPS after a bridgeedge protection fix. In a five-domain counterfactual experiment (n = 1250), DaoQL+GPT-4o achieves 94% composable counterfactual decomposability, 49 percentage points above GPT4o alone. The paper explicitly separates provable structure, preliminary empirical evidence, and architectural roadmap claims.

Keywords: data-first ontology; multimodal database; neuro-symbolic AI; world model; coun1

terfactual reasoning; benchmark evaluation

1

Introduction

Large language models (LLMs) [12, 9] show strong generalization and natural-language reasoning, but their default paradigm encodes a “world model” implicitly in billions of neural parameters [8, 13]. This tight coupling of knowledge and computation creates four structural limitations in settings that require precision and auditability: factual conflicts caused by probabilistic sampling, frozen knowledge with high update cost, weak explainability of reasoning paths [3], and poor surgical modifiability due to catastrophic interference [17]. We argue at the operational-semantics level that these limitations share one gap: implicit models lack atomic read-by-ID and local update semantics. RAG and agent frameworks such as LangChain, Hermes, and OpenClaw mitigate memory and knowledge defects by attaching vector stores or graphs to LLMs. This establishes a separation between the logic layer and the storage layer, but it still has three bottlenecks. First, token windows force lossy context compression. Second, memory retrieval and agent execution often live in separate processes, introducing synchronization and serialization overhead. Third, reasoning logs and database writes are usually recorded separately, making financial-grade auditability difficult. Existing systems do not provide read, δ, Eval, and Trace as unified atomic semantics. We propose an explicit world-model architecture guided by data-first ontology [5, 25, 27, 1]: the LLM is a reasoning and natural-language engine, while deterministic knowledge is stored in DaoQL, a multimodal database. DaoQL uses six explicit primitives - Being, Def, Type, Relation, Contract, and Version - to construct an addressable and versioned world model W . Theoretically, we formalize the operational-semantics difference between explicit and implicit models, derive a sufficient condition for composable counterfactual decomposability (Theorem 1), and analyze why single-process multimodal execution can reduce latency. Empirically, the paper focuses on the verified storage layer, explicit Eval path, and counterfactual experiment; KVCache graph nodes and the full DaoQL-Agent runtime remain design-stage components. The contributions are: 1. Theory. We define an explicit world model, prove finite Def bootstrapping, strong Contract termination, and local update, and explain why implicit models lack an architectural guarantee for composable counterfactuals. 2. System. We implement and evaluate DaoQL’s multimodal storage layer, including mmap reads, relation-type CSR adjacency, WAL/MVCC, and cross-engine hybrid queries. 3. Evaluation. We combine three-tier microbenchmarks, same-machine competitor comparisons, LDBC/ANN exploratory standard-set measurements, and a 1,250-query counterfactual experiment.

2

Table 1: Scope of claims in this paper Layer / capability

Evidence in this paper

Status

Explicit world-model theory

Formal definitions, wellformedness, counterfactual sufficient conditions Graph, column, vector, fulltext, WAL/MVCC, mmap benchmarks SF1 34/34 query coverage; ANN Recall@10 curve 1,250-query counterfactual experiment HNSW + Tantivy + graph benchmarks as indirect support Design document and context mechanism Architecture roadmap

Established retically

theo-

Implemented measured

and

DaoQL storage layer

LDBC SNB / ANN sets Explicit Eval path Memory-layer recall DaoQL-Agent runtime KVCache graph nodes and expert hot updates

Exploratory measurement Preliminary validation Partially supported Design stage Future work

2

Related Work

2.1

Knowledge Representation and Graph Databases

Knowledge representation and reasoning (KRR) [16, 20, 14, 18, 24, 23, 6] aims to make entities and logic machine-operable. RDF [32] and OWL [30, 31] provide the logical foundation of the Semantic Web, but mainly describe static propositions and do not natively integrate version chains or executable behavioral semantics. Datomic [26] pioneered immutable append and “time as a first-class concern,” but its EAVT model remains a passive fact-recording model rather than an autonomous computational unit model. Property graphs such as Neo4j [19, 29] and strongly typed graph databases such as TypeDB [28] improve structured graph modeling. However, for next-generation AI world models they still face two limitations: inheritance and schema are largely static, and vector retrieval and column aggregation are not unified in the same process, causing network and serialization overhead. DaoQL addresses this design space by embedding typing, graph traversal, vector search, column aggregation, versioning, and contract checks into one storage kernel.

2.2

LLM-Augmentation and Agent Frameworks

RAG systems increasingly attach external knowledge bases to LLMs. GraphRAG [4] and LightRAG [7] extract entities and relations from text and use graph topology to improve context. Yet the graph remains an external, mostly read-only augmentation component. When injected facts conflict with parameterized knowledge, systems still lack deterministic, atomic conflict resolution and counterfactual evaluation. Long-context memory systems such as MemGPT [21] manage conversation history using a

3

virtual-memory analogy, but operate at the text-block granularity rather than as structured entities with version chains. Agent frameworks typically use LLMs as controllers and external databases such as SQLite, Chroma, or Pinecone as memory components. This is easy to engineer but fragments context, memory, and audit logs across systems. DaoQL-Agent proposes representing turns and messages as Being nodes and using graph traversal instead of lossy compaction; however, the full agent runtime is not measured in this paper.

2.3

Industrial Ontology Platforms and Standard Benchmarks

Industrial Ontology platforms, exemplified by Palantir Foundry [22], use Object/Link/Action semantics to model enterprise entities and operations. They share the paper’s motivation toward explicit semantics, but typically place Ontology as a semantic mapping layer above multiple stores such as Cassandra, Elasticsearch, and JanusGraph. Their advantage is federated access to existing data infrastructure. DaoQL instead sinks Being/Type/Relation into single-process storage primitives, trading migration cost for a tighter Eval/Trace path. LDBC SNB [15] and ANN-Benchmarks [2] provide common workloads for graph and approximate nearest-neighbor systems; we use them as exploratory standard-set measurements rather than official certification.

3

Materials and Methods

This section is organized as theory, implementation, and experimental design. Section 3.1 formalizes the explicit world model; Section 3.2 describes the system architecture; Section 3.3 specifies benchmarks and counterfactual evaluation.

3.1 3.1.1

Theory and Formal Model Overview of Data-First Ontology

Data-first ontology claims that a world model should consist of structured, inspectable, controllable explicit data rather than implicit weights. DaoQL realizes this through six primitives. Being is the basic entity unit and is identified by UUID. Def and Type define fields, constraints, relationships, and runtime dispatch. Relation connects Beings as directed edges. Contract is a fuel-limited Rhai script embedded in the write path. Version is a hash-linked history record that supports MVCC and audit replay. The following formal framework gives the precise definitions and proof obligations. To turn the Introduction’s “knowledge sinking” claim into testable scientific statements, this section formalizes the explicit world model and derives its structural properties; system implementation (§3.2) and experimental design (§3.3) build on this foundation. 3.1.2

Formal Definitions

An implicit world model encodes knowledge in a neural network fθ : X → Y [8, 13], with forward inference and global parameter updates θ 7→ θ′ as primary operations. An explicit world model, by contrast, carries deterministic knowledge in addressable, versioned data structures. Table 2 summarizes the main symbols.

4

Table 2: Main symbols in the theory framework Symbol ID, B, D, T , R, C, V W = (B, D, T , R, C, V) δ(W, p) Eval(ϕ, W ) Trace(q, W ) Fmax

Meaning Identifier and six primitive sets Explicit world-model state State after applying patch p to W Evaluation of query/rule ϕ on state W Execution trace of query q on W Contract fuel limit

Definition 1 (Six Primitives). The primitives are: • Being b = (id, core, ext, history): id ∈ ID, history = [v1 , . . . , vn ] is a version chain; • Def d = (name, f ields, constraints, contracts, f sm, rel decls); • Type t = (name, parent, contracts, constraints); • Relation r = (type, src, dst, direction, ext, window); • Contract c = (hook, source, ast); • Version v = (ts, hash, prev hash, payload). The explicit world model is W = (B, D, T , R, C, V). Definition 2 (State Equivalence). Given a fact domain F, if W1 and W2 agree on all observable facts in F, we write W1 ≡F W2 . This structure realizes four atomic semantics: read by ID, patch update (δ), deterministic rule evaluation (Eval), and execution tracing (Trace). DaoQL implements them via BeingId addressing, append-only WAL, and MVCC snapshots (§3.2.3). 3.1.3

Well-Formedness and Execution Safety

DaoQL adopts a “schema-as-data” design: Def is itself a Being, bootstrapped by the axiom Def DAO DEF. We must ensure that this mechanism does not yield infinite meta-definition chains and that Contracts embedded in the write path cannot violate system termination. Proposition 1 (Finite Def Bootstrap Chain). Let axiom Def d0 ∈ D satisfy d0 .core.def = d0 ; and ∀d ∈ D \ {d0 }, d.core.def = d0 , ∀b ∈ B, b.core.def ∈ D \ {d0 }. Then any ordinary Being has def-reference chain length at most 2, any ordinary Def has chain length 1, and DAO DEF is only a controlled self-reference. Proof. For any b ∈ B, b.core.def = d1 ∈ D \ {d0 } and d1 .core.def = d0 , hence b → d1 → d0 with chain length 2. For any d ∈ D \ {d0 }, d → d0 with chain length 1. Suppose an infinite chain d0 → d1 → d2 → · · · exists: if d1 ̸= d0 , then d1 is an ordinary Def and d1 .core.def = d0 forces termination at d0 , a contradiction.

5

Proposition 2 (Strong Contract Termination). Suppose Contract execution forbids new writes and external I/O, consumes one fuel unit per step, and is capped at Fmax . Then ∀c ∈ C, Exec(c) halts within Fmax steps. Proof. Use remaining fuel Φ(et ) = Fuel(et ) as a potential function, initialized to Fmax and strictly decreasing by one per step. Forbidding write recursion and external I/O excludes infinite-wait paths; by well-ordering of natural numbers, execution terminates and rolls back when fuel reaches zero, so at most Fmax steps occur. Propositions 1–2 bound the metadata layer and guarantee write-path termination, supporting the DAO DEF axiom layer and the default 10,000-step Contract fuel limit described in §3.1.1. 3.1.4

Operational Semantics: Implicit vs. Explicit Models

The four LLM crises named in the Introduction can be unified at the operational-semantics level: implicit model Oimp = {fθ , θ 7→ θ′ } lacks database-style atomic read and δ. Observation 1 (Implicit Models Lack Database-Style Atomic Operations). Operationally, LLM knowledge is encoded in distributed parameters θ, with usable operations mainly fθ (x) and θ 7→ θ′ ; therefore existing LLM architectures do not provide database-isomorphic readθ (id) and δθ (θ, patchid ), nor can precise read-by-ID and local update be system invariants. Proof. If a δθ existed that updated only the fact for id, parameters should decompose as F θ = id θ|id ; but LLM weights encode semantics in a distributed manner, with no provably independent θ|id . Fine-tuning θ′ = θ − η∇θ L is global and aligns with catastrophic interference [17]. Prompt intervention y = fθ (x′ ) changes input only, not persistent state. The assumption fails. Proposition 3 (Local Update in Explicit Models). Let W ′ = δ(W, p), where the scope of p is Dom(p) ⊆ {id0 } ∪ {r | r.src = id0 or r.dst = id0 }, and the system uses BeingId addressing, append-only WAL, and MVCC snapshot reads. Then ∀b ∈ B, b.id ̸= id0 : W ′ |b ≡ W |b . Proof. The patch does not touch other entity fields; WAL appends only version vn+1 for id0 , leaving history(b), core(b), and ext(b) unchanged for all other entities. By the definition of state equivalence, semantics on the untouched fact domain is unchanged. Observation 2 (Shared Operational Root of the Four LLM Crises). If a system has only Oimp without read, δ, Eval, and Trace, then hallucination resistance (needs deterministic Eval), live updates (needs δ), explainability (needs Trace), and surgical edits (needs local δ) cannot simultaneously hold as architectural invariants. Proof. By Observation 1, implicit models lack local δ and atomic read. fθ outputs token distributions rather than Eval(ϕ, S) ∈ {⊤, ⊥} [11]; θ 7→ θ′ is costly and global; internal activations cannot be reconstructed as symbolic reasoning chains. The operations required by all four properties are absent from Oimp , hence they share one operational root. Observation 2 does not claim that every LLM failure has a single explanation; rather, in settings requiring deterministic factual judgment, local update, and audit trails, the four crises 6

share one operational gap. Data-first ontology fills these atomic semantics through explicit structure W , forming the theoretical starting point of our architecture. 3.1.5

Counterfactual Reasoning

In Pearl’s causal hierarchy, the counterfactual layer asks how conclusions would change had facts differed [23]. We operationalize this as applying patch p to explicit state S = (W, K) and executing Eval(ϕ, δ(S, p)), which directly matches the counterfactual protocol in §3.3. Theorem 1 (Composable Counterfactual Decomposability). Let p1 , p2 be patches composed of finitely many atomic update/relate operations, and let ϕ depend on fact domain Fϕ . If δ(δ(S, p1 ), p2 ) ≡Fϕ δ(δ(S, p2 ), p1 ), Eval is deterministic, and rule conflicts have fixed priority, then Eval(ϕ, δ(δ(S, p1 ), p2 )) = Eval(ϕ, δ(S, p1 ⊕ p2 )). (1) Proof. Let S2 = δ(δ(S, p1 ), p2 ) and S12 = δ(S, p1 ⊕ p2 ). By patch commutativity and fixed conflict resolution, S2 ≡Fϕ S12 . Since ϕ depends only on Fϕ , evaluation is a deterministic function gϕ (S|Fϕ ), hence Eval(ϕ, S2 ) = Eval(ϕ, S12 ). Observation 3 (No Architectural Guarantee of Composable Counterfactuals for Implicit Models). LLM implicit evaluation ϕ̂(ℓ, S) = Sample(fθ (ℓ ⊕ encode(S))) cannot architecturally guarantee that semantically equivalent phrasings yield the same conclusion, that composed edits satisfy Theorem 1, or that edit order is immaterial. Proof. On the explicit path, semantically equivalent phrasings ℓ1 , ℓ2 map to the same patch p = π(ℓ1 ) = π(ℓ2 ); on the implicit path, ℓ1 ̸= ℓ2 may yield Pθ (y|ℓ1 , S) ̸= Pθ (y|ℓ2 , S). Implicit models lack δ, so comparable structured states S2 and S12 cannot be constructed; prompt order changes attention context, so commutativity has no architectural guarantee. Theorem 1 shows that under rule independence and deterministic Eval, composable counterfactual decomposability is a provable structural property; Observation 3 explains why the pure LLM path lacks an equivalent guarantee. Together they set the theoretical expectations for §4.1. 3.1.6

Neuro-Symbolic Division of Labor and Performance Mechanism

In a neuro-symbolic architecture, deterministic knowledge G ⊆ S lives on the symbolic side; queries are evaluated by Eval(ϕ, S) and the LLM only naturalizes y = πnl (r). The executor records Trace = ⟨op1 , . . . , opm ⟩ with Being/Relation IDs accessed at each step, so conclusions trace back to explicit reasoning paths—explaining 100% traceability in the counterfactual experiment. This property fails when the LLM bypasses Eval and generates directly. For performance, hybrid query q = qvec ◦ qgraph ◦ qcol in a multi-stack architecture requires k cross-process calls. With per-call network/IPC latency Tnet,i ≥ τnet > 0, Tmulti − Tmono ≥ kτnet − Tdispatch ,

(2)

P where Tmulti = i (Tnet,i +Tser,i +Tquery,i ) and Tmono = Tvec +Tgraph +Tcol +Tdispatch . In DaoQL’s single process Tnet = 0, eliminating cross-system overhead on the order of kτnet ; this inequality 7

explains low hybrid-query latency but does not imply DaoQL is asymptotically optimal on all algorithms. For graph traversal, DaoQL pointer-adjacency BFS on subgraph G′ = (V ′ , E ′ ) runs in O(|V ′ | + |E ′ |) because each vertex and edge is processed at most once. This shows the storage shape approximates the ideal BFS access model; measured 4.2–6.7× speedup over Neo4j (Table 8) is an engineering constant factor and must not be conflated with the complexity result. We distinguish two kinds of claims: Contract termination, local update, and Eq. (1) are provable under stated axioms; BFS 1.20 ms and 94% composable decomposability are empirical results on specific hardware and datasets, validating predictions rather than replacing theory.

3.2 3.2.1

System Architecture and Implementation Five-Layer Integrated Architecture

Figure 1 illustrates how an explicit world model could grow into a full neuro-symbolic system. The empirically verified core in this paper is the storage layer and the explicit Eval path; several memory, learning, inference, and application components remain roadmap items. • Storage layer. DaoQL integrates graph, column, vector, and full-text engines in one process with a unified BeingId. WAL and MVCC provide atomicity and crash consistency. • Memory layer. Session lifecycle and historical recall are intended to use HNSW, Tantivy, and graph traversal. These components are individually measured, but the full agent memory layer is not. • Learning layer. Expert and router hot updates are planned architecture goals. • Inference layer. A customized LLM can in principle navigate semantically related KVCache graph nodes, but this remains a planned direction. • Application layer. DaoQL-Agent exposes FSM-driven workflows and tool-safety Contracts, but the runtime is design-stage. In the complete design, a user query triggers hybrid recall, locates relevant Beings and KVCache offsets, loads them through mmap, invokes inference, and writes results atomically through the WAL. The verified part is concentrated in storage: the current configuration bypasses PageCache/ArcSwap on graph reads, and WAL recovery for 10K entries takes 219.6 µs. 3.2.2

Graph-Driven Agent Context and Direct mmap Reads

External agent frameworks usually compress old messages because of token-window limits. DaoQL-Agent instead models interaction history as graph nodes connected by relations such as HAS TURN and HAS MESSAGE. A ContextBuilder can traverse from a session node to assemble context. The measured graph traversal latency (BFS 1.20 ms and DSL Chain Depth30 79.3 µs) supports the feasibility of this design, but not a complete agent-system claim. For graph-heavy workloads, the current configuration changes NodeStore/EdgeStore reads from pagecache + ArcSwap to direct mmap pointer reads. It further maintains a per-RelationType

8

Application Layer Application DaoQL-Agent design stage

Inference Layer Inference V4 + Attention planned

Memory / Learning Learning Expert/Router planned

Memory hybrid recall partially verified

Storage Layer Storage DaoQL: Graph + Column + Vector + Fulltext + WAL/MVCC (unified BeingId) Data flow: user query → hybrid recall → mmap zero-copy load → inference → atomic WAL commit

Figure 1: Five-layer neuro-symbolic architecture and verification scope. The storage layer is measured in the current configuration; the memory layer is indirectly supported by component benchmarks; application, inference, and learning layers are future targets.

Query Layer (Tables 6–7) DSL Parser

Fluent API

Execution Layer Write Coordinator

Cross-Engine Executor

Storage Layer (Table 5) Graph Engine

Column Engine

Vector Engine

Index / Fulltext

Physical Layer Physical Layer: WAL + direct mmap read path + version chain

Figure 2: DaoQL’s internal four-layer engine architecture and its mapping to the three-tier benchmark suite. The current measurement introduces direct mmap reads in the physical layer and P0#1/#2/#5 write-path optimizations.

9

CSR adjacency file (csr {:04x}.bin) so type-filtered BFS and triangle-count queries can read neighbors without scanning edge chains. This reduces edge write-read latency from 397.6 ns to 304.4 ns and BFS fanout4 depth5 from 1.97 ms to 1.20 ms. In LDBC SNB, IC14 drops from the 30 s range to 0.64 ms.

3.3 3.3.1

Experimental Design Environment and Datasets

Microbenchmarks and same-machine competitor comparisons run on an Apple M-series machine with 64 GB LPDDR5 and NVMe SSD (∼3.5 GB/s), Rust 1.94.1, Criterion.rs release mode, and median reporting. LDBC SNB and ANN-Benchmarks exploratory runs use Apple M4 Max, 128 GB LPDDR5, and NVMe SSD (∼7 GB/s), DaoQL v1.1.0 release build. The two groups are reported separately and are not merged into a single ranking. • XY-ERP: synthetic ERP data, about 1.9M entities covering orders, BOM, and supplier links. • YAGO4: public knowledge graph, about 3.4M entities, used for reproducibility checks. • Synthetic microbenchmarks: 10K vectors (64D, Cosine, M = 16, ef=100) and 10K Chinese documents. • LDBC SNB SF1: about 1M Persons, 37M edges, and 34 IC/BI queries, using a custom driver rather than official submission. • ANN-Benchmarks: random-s-100-euclidean, 90K × 100 training vectors, 10K × 100 test vectors.

Table 3: Fairness boundaries of performance comparisons Dimension

Setting

Interpretation boundary

Deployment shape

DaoQL embedded; competitors often client-server 10K–100K microbenchmarks; 1.9M business entities Criterion release median; same-machine repeated runs 10K vectors, 64D, M = 16, ef=100 Single-process vector → graph → column M4 Max 128GB vs M-series 64GB 34/34 queries run

Ratios include process, protocol, and serialization costs Not evidence for billion-scale workloads

Data scale

Cache state HNSW parameters Hybrid query Standard sets LDBC status

10

Hot-cache and tail latency need separation Only this parameter range No full multi-stack RAG baseline Reported separately, not merged Not official LDBC certification

3.3.2

Benchmark and Counterfactual Protocols

We use three benchmark tiers: sub-crate engine microbenchmarks, Fluent API microbenchmarks, and DSL end-to-end microbenchmarks. Business stress tests include engine, Fluent, and DSL suites. Configuration ablation compares the previous pagecache/ArcSwap configuration with the current mmap + P0 write-path configuration. LDBC SNB uses SF1, 8 workers, 30 s warmup, 600 s measurement, and 1 GB page cache. ANN-Benchmarks reports QPS and Recall@10 for ef search ∈ {50, 100, 200, 400, 800, 1600}. The counterfactual experiment compares GPT-4o with DaoQL+GPT-4o. It covers five domains - medical decision, financial credit, supply-chain risk, regulatory compliance, and dynamic pricing - with 50 cases per domain and five natural-language paraphrases per case, for 1,250 queries. Metrics include answer consistency, safety, reasoning-chain traceability, update correctness after new information, counterfactual stability, and composable counterfactual decomposability. The materials describe domains, scale, metrics, and partial ground-truth rules, but not full prompts, temperature, scoring protocol, or per-case error logs; therefore we treat the result as preliminary evidence.

4

Results and Analysis

We evaluate four aspects: counterfactual robustness, storage performance, same-machine and standard-set benchmarks, and system-level primitive composition. Values in Sections 4.2–4.3 use the M-series 64 GB platform; Section 4.4 uses the M4 Max 128 GB platform. All DaoQL measurements use real engine calls and no mock or stub paths.

4.1

Counterfactual Consistency

This experiment tests the prediction of Section 3.1.5: if natural language maps to a patch and executes Eval(ϕ, δ(S, p)), composed changes should satisfy Eq. 1; GPT-4o alone lacks δ and structured state. Table 4: Counterfactual consistency experiment across five domains (n = 1250) Metric Answer consistency Safety Traceable reasoning chain Correct update after new information Counterfactual stability Composable counterfactual decomposability

GPT-4o

DaoQL+GPT-4o

Gain

71% 79% — 61% 58% 45%

97% 95% 100% 100% 96% 94%

+26% +16% — +39% +38% +49%

The gap between 94% and 45% on composable decomposability is consistent with Theorem 1 and Observation 3. The remaining 6% failures in the explicit path are attributed in the source materials to parsing errors, under-encoded rules, or DSL boundaries; without per-case error logs, we do not further decompose the failure modes quantitatively.

11

4.2

Three-Tier Microbenchmarks and Ablation

Tables 5–7 compare the previous configuration with the current mmap read path and P0 writepath optimizations. Table 5: Engine-level ablation: previous vs. current configuration Benchmark

Previous

Current

Change

10.81 µs 1.86 µs 397.6 ns 9.03 ms 377.2 µs 16.70 µs 50.0 ms 95.4 µs 11.13 ms 253.3 ns

7.17 µs 1.24 µs 304.4 ns 4.16 ms 221.7 µs 4.74 µs 14.91 ms 61.3 µs 1.66 ms 160.7 ns

+34% +33% +23% +54% +41% +72% +70% +36% +85% +37%

graph / node store alloc 1000 graph / node store write read graph / edge store write read column / raw append 1000 column / projected scan 10000 write / append single write / append batch 10000 vector / hnsw search k10 vector / persistence roundtrip lookup (B+Tree)

Table 6: Fluent API microbenchmark ablation Benchmark

Previous

Current

Change

18.26 µs 389.4 µs 110.6 µs 482.0 µs 178.1 ns

16.57 µs 374.4 µs 98.4 µs 415.6 µs 186.9 ns

+9% +4% +11% +14% −5%

graph write and traverse column write and scan vector search fulltext search index uuid lookup

Table 7: DSL microbenchmark ablation Benchmark

Previous

Current

Change

25.27 µs 46.16 µs 1.20 ms 3.52 µs

21.40 µs 36.54 µs 1.11 ms 3.17 µs

+15% +21% +8% +10%

graph traversal / 1k depth3 combined / material order column aggregate / 5k groupby graph node lookup / 1k full

The largest gains come from removing per-row flushes and bypassing pagecache/ArcSwap on graph reads. Improvements attenuate at the Fluent and DSL layers, indicating that wrapper overhead and Being assembly remain optimization targets.

4.3

Competitor Comparison and Fairness Boundaries

Table 8 summarizes same-machine results. Because DaoQL is embedded while most competitors are client-server systems, these are engineering end-to-end comparisons rather than pure kernel comparisons. The full-text result is an explicit weakness: Tantivy+jieba at 1.27 ms is much slower than PostgreSQL’s simple tsvector configuration at 32 µs, largely because jieba performs Chinese

12

Table 8: DaoQL current configuration vs. best observed competitor Capability Point lookup Full BFS traversal HNSW k=10 Column SUM 100K Batch write Chinese full text 10K Cross-engine hybrid query

DaoQL

Best comparator

0.38 µs 1.20 ms 83.1 µs 362.9 µs 1.75 µs/row 1.27 ms 105.8 µs

RocksDB ∼1 µs Neo4j 5–8 ms Qdrant 363.4 µs ClickHouse ∼1 ms PostgreSQL 9.0 µs/row PostgreSQL tsvector 32 µs No direct comparator

Observation Embedded low latency Lower end-to-end latency Leads under current parameters Leads at current scale Embedded low latency DaoQL is ∼40× slower Missing multi-stack baseline

Table 9: HNSW head-to-head: DaoQL vs. Qdrant 1.16, same machine and parameters System DaoQL current DaoQL previous Qdrant 1.16

HNSW k=10

Brute Force k=10

SIMD

83.1 µs 148.4 µs 363.4 µs

269.0 µs 388.3 µs 283.4 µs

8×f32 8×f32 16×f32

segmentation while the simple baseline does not. This should be treated as a limitation rather than hidden in aggregate performance claims.

4.4

Standard-Set Exploratory Measurements

LDBC SNB SF1. DaoQL runs all 34 IC/BI queries on SF1 with zero errors under an 8-worker, 600 s run. RelationType CSR adjacency improves type-filtered traversal and triangle-count workloads. Representative results appear in Table 10. IC-style entity lookup and bounded traversal are generally interactive, but IC6/IC10, BI4, and BI9 remain severe long-tail bottlenecks. Overall throughput is only 1.8 QPS, so SNB BI workloads are not an advantage claim. Table 10: Representative LDBC SNB SF1 latencies (DaoQL v1.1.0, M4 Max) Class

Query

P50 (ms)

P95 (ms)

Interpretation

IC IC IC IC IC BI BI BI BI

IC1 profile IC2/IC8 recent messages/comments IC13 shortest path IC3 recommendation IC6/IC10 thread/recommendation BI8 social circle BI12/BI17 triangles BI4 hot forums BI9 forum tags

0.26 0.16 0.05 1.74 ∼18,900 7.98 4,813/5,222 21,225 908,271

7.00 0.36 2.88 10.13 ∼26,000 59.28 8,288/8,708 31,483 969,790

Interactive lookup Interactive Multi-hop traversal Acceptable Long-tail bottleneck Moderate Improved but slow Long-tail bottleneck Extreme long tail

Overall

34/34 coverage, 0 errors

1.8 QPS

Dragged by slow queries

ANN-Benchmarks. On random-s-100-euclidean, DaoQL HNSW with M = 32, M0 = 64, and ef construction=200 reports the curve in Table 11. At ef search=200, Recall@10 is 99.3% at 5,724 QPS. The v1.1.0 bridge-edge protection fix raises Recall@200 from about 32% to above 99%, so correctness is the main result. Public hnswlib/FAISS numbers come from 13

different hardware and are not used as same-machine wins. Table 11: ANN-Benchmarks random-s-100-euclidean (DaoQL v1.1.0)

4.5

ef search

QPS

Recall@10

Zero-recall queries

50 100 200 400 800 1600

19,001 12,225 5,724 3,051 1,529 708

94.4% 97.4% 99.3% 99.9% 100.0% 100.0%

511/10000 218/10000 42/10000 2/10000 0/10000 0/10000

Business Stress Tests and Hybrid Queries Table 12: xy erp stress engine-level results Scenario

Scale

Current

Change

BFS Fanout4 Depth5 Order Status Chain Hybrid vector → graph → column Write Batch With-Vector WAL Recovery

1,365 nodes 30 hops 10K 16t×10K 10K

1.20 ms 2.03 ms 119.09 µs 1,009.2 ms 219.6 µs

+39% +27% +14% +14% +20%

Table 13: Fluent API stress tests: BOM traversal and batch write Scenario Chain Depth5 Skip Ext Chain Depth30 Tree Fanout4 Depth5 Raw Engine BFS Fanout4 Depth5 Write Batch 1K No Embed Hybrid Query

Previous

Current

Gain

19.0 µs 144.5 µs 6.45 ms 1.82 ms 46.9 ms 108.1 µs

14.1 µs 129.5 µs 5.45 ms 1.23 ms 23.7 ms 105.8 µs

+26% +10% +16% +32% +49% +2%

The hybrid query demonstrates the promise of a shared BeingId in one process, but because we do not provide a Neo4j+Qdrant+ClickHouse multi-stack RAG baseline, it is reported as an architectural potential rather than a completed cross-system victory.

4.6

Composite Business Scenarios

DaoQL-Edu integration tests validate Being, Def, Relation, and Version composition in five representative scenarios.

4.7

Optimization Stability

The pagecache/ArcSwap design improved some batch paths but introduced traversal and singlewrite regressions. The current mmap + P0 write configuration restores read, write, and vector paths simultaneously. 14

Table 14: DSL stress tests: BOM traversal and mutation Scenario Chain Depth30 Tree Fanout4 Depth5 Write Batch 1K No-Vec Mutation No-Vec 1K

Previous

Current

Gain

111.7 µs 3.59 ms 81.5 ms 22.16 ms

79.3 µs 2.99 ms 25.1 ms 8.58 ms

+29% +17% +69% +61%

Table 15: Unit-test-driven composite scenarios Scenario

Question

Engine path

Result

Sales report

Column fast path + SIMD

1M rows, 3.4 µs

Vector → graph → column

non-empty result priority=80.0

Version replay

Order total / filtered SUM Similar trade + linked account Similar user + influencer ranking Entity price history

Batch tency

100 Beings + chain relations

WAL + BFS + aggregate

Risk detection Recommendation

consis-

Vector + graph + column Version chain + MVCC

old version preserved node count matches

Table 16: Configuration-level ablation and stability Configuration

Baseline

Feature

Early unified read path warm cache / BQ

+O-1–O-4 +warm cache, BQ

pagecache + ArcSwap

+ArcSwap, pagecache batch

Establishes unified index and read baseline Point lookup improves but graph traversal regresses Batch improves but single write/HNSW/Fluent write regress Current configuration with positive metrics

mmap + P0 write optimization

+mmap, P0#1/#2/#5

15

5

Discussion

5.1

Theory-Design-Experiment Closure Table 17: Theory, design, and experiment closure Theory

DaoQL design

Prediction

Status

Prop. 1

DAO DEF axiom layer Fuel + sandbox

Schema cannot recurse forever Write path does not hang LLM has no local update guarantee Single update does not spread High composable consistency Prompt-only path is unstable Low hybrid latency

Theoretical closure Theoretical closure Counterfactual comparison Version-chain tests 94%

Constant-factor vantage

1.20 ms

Prop. 2 Obs. 1 Prop. 3 Thm. 1 Obs. 3 Eq. 2 BFS complexity

BeingId explicitness WAL + MVCC Deterministic DSL Eval GPT-4o baseline Single-process engines mmap pointer adjacency

ad-

45% 105.8 µs

This table separates proofs from measurements. For example, O(|V ′ | + |E ′ |) BFS complexity does not imply a 4.2× Neo4j speedup; the latter is an engineering constant-factor measurement on one setup.

5.2

Architectural Verification Status Table 18: Architectural decisions and current verification status Decision

Measurement evidence

Status

Join-free graph engine Direct mmap read path Relation-type CSR adjacency ProjectedLayer + SIMD column BeingId zero-copy across engines WAL crash consistency KVCache graph nodes Expert hot update DaoQL-Agent context traversal

BFS 1.20 ms, 4.2–6.7× Neo4j edge 304.4 ns, BFS +39%

Verified Verified

LDBC IC14 0.64 ms, BI12/17 improved SUM 362.9 µs, 2.8× ClickHouse Hybrid 105.8 µs

Verified

Recovery 10K 219.6 µs Architecture plan Architecture plan Design + BFS support

Verified Design stage Design stage Design stage

16

Verified Verified

5.3

Positioning Against Industrial Ontology Platforms

Industrial platforms such as Palantir Foundry demonstrate that explicit Ontology plus AI has commercial value in large enterprises and government settings. Their strengths are federated data integration, low-code Agent Studio, and a mature ecosystem. DaoQL should be positioned as complementary, not as a direct replacement: it targets lighter deployment, data-sovereign environments, and write-path contracts in medium-scale or edge settings. We do not compare customer counts, TCO, or production maturity. The architectural distinction is narrower: an overlay Ontology eases legacy integration, while embedded Being/Type/Relation makes Eval and WAL audit semantics easier to close in one transaction model.

5.4

Limitations

1. Embedded vs. client-server. DaoQL avoids network overhead that competitors often include. Ratios should not be read as kernel-only superiority. 2. Scale. Most microbenchmarks are 10K–100K; billion-scale graphs or vector indexes may change relative performance. 3. Chinese full text. Tantivy+jieba is a clear weakness compared with PostgreSQL simple tsvector, although the tokenization work is not equivalent. 4. Concurrent writes. 16-connection throughput drops about 40%; sharded locks are future work. 5. Counterfactual experiment. The protocol lacks full prompts, temperature, complete scoring rules, and per-case logs; results are preliminary. 6. LDBC SNB. This is a custom-driver coverage experiment, not official certification; 1.8 QPS and BI9/IC6 long tails show immaturity on global social-network aggregation workloads. 7. ANN-Benchmarks. Only one synthetic dataset is used, public competitor QPS is crosshardware, and pre-fix v1.0 vector numbers should not be reused. 8. Industrial-platform comparison. Palantir ecosystem maturity is not experimentally evaluated; discussion is architectural positioning only.

5.5

Future Work

Priorities include optimizing LDBC SNB long-tail BI/IC query plans and caches, migrating to wider SIMD paths for vectors, adding sharded locks and Contract caching for concurrent writes, improving block-level column vectorization, implementing Fluent Being assembly zerocopy, expanding counterfactual experiments to 2,500 cases with complete scoring protocols, and validating DaoQL’s deeper integration with V4 inference.

17

6

Conclusion

This paper addresses four structural crises caused by encoding world models implicitly in LLM weights. It proposes data-first ontology: deterministic knowledge is represented by explicit primitives in DaoQL, while the LLM serves as a language and reasoning auxiliary. The formal framework defines explicit world models, proves finite Def bootstrapping and strong Contract termination, and gives a sufficient condition for composable counterfactual decomposability. The system implementation validates the storage layer through graph, column, vector, full-text, WAL/MVCC, direct mmap reads, and cross-engine hybrid queries. On the engineering side, the current Apple M-series measurements show graph BFS at 1.20 ms, HNSW at 83.1 µs, and Fluent hybrid query at 105.8 µs. M4 Max exploratory standardset runs add LDBC SNB 34/34 query coverage and ANN-Benchmarks Recall@10 ≥ 99% at thousand-level QPS, while also exposing SNB BI long tails and cross-hardware limits. On reasoning robustness, the five-domain counterfactual experiment reports 94% composable counterfactual decomposability for DaoQL+GPT-4o, 49 percentage points above GPT-4o alone. The paper therefore presents a theory-experiment path toward auditable, modifiable, knowledgeaccumulating world models, while explicitly marking agent runtime, KVCache graph nodes, and expert hot updates as future work.

References [1] AlphaProof Team. AI achieves silver-medal standard solving international mathematical olympiad problems. Google DeepMind Blog, 2024. [2] Martin Aumüller, Erik Bernhardsson, and Alexander Faithfull. ANN-Benchmarks: A benchmarking tool for approximate nearest neighbor algorithms. Information Systems, 87:101374, 2020. [3] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations, 2015. [4] Darren Edge, Ha Trinh, Newman Cheng, Joshua Bradley, Alex Chao, Apurva Mody, Steven Truitt, Dasha Metropolitansky, Robert Osazuwa Ness, and Jonathan Larson. From local to global: A graph RAG approach to query-focused summarization. arXiv preprint arXiv:2404.16130, 2024. [5] Artur d’Avila Garcez and Luı́s C. Lamb. Neurosymbolic AI: The 3rd wave. Artificial Intelligence Review, 56:12387–12406, 2023. [6] Nicola Guarino. Formal ontology, conceptual analysis and knowledge representation. International Journal of Human-Computer Studies, 43(5-6):625–640, 1995. [7] Zirui Guo, Lianghao Xia, Yanhua Yu, Tu Ao, and Chao Huang. LightRAG: Simple and fast retrieval-augmented generation. arXiv preprint arXiv:2410.05779, 2024. [8] David Ha and Jürgen Schmidhuber. World models. arXiv preprint arXiv:1803.10122, 2018. 18

[9] Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, et al. Training compute-optimal large language models. arXiv preprint arXiv:2203.15556, 2022. [10] Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations, 2022. [11] Ziwei Ji, Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Yejin Bang, Andrea Madotto, and Pascale Fung. Survey of hallucination in natural language generation. ACM Computing Surveys, 55(12):1–38, 2023. [12] Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B. Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020. [13] Yann LeCun. A path towards autonomous machine intelligence. OpenReview position paper, 2022. [14] Hector J. Levesque and Ronald J. Brachman. A fundamental tradeoff in knowledge representation and reasoning. In Readings in Knowledge Representation, pages 41–70. Morgan Kaufmann, 1985. [15] Linked Data Benchmark Council. LDBC social network benchmark (SNB). Benchmark specification, 2015. [16] John McCarthy. Programs with common sense. In Proceedings of the Teddington Conference on the Mechanization of Thought Processes, pages 77–84. 1959. [17] Michael McCloskey and Neal J. Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of Learning and Motivation, volume 24, pages 109–165. Academic Press, 1989. [18] Marvin Minsky. A framework for representing knowledge. In The Psychology of Computer Vision, pages 211–277. McGraw-Hill, 1975. [19] Neo4j Inc. Neo4j graph database. Release 2025.04.0, 2025. Accessed 2026-05-31. [20] Allen Newell and Herbert A. Simon. GPS, a program that simulates human thought. In Computers and Thought, pages 279–293. McGraw-Hill, 1963. [21] Charles Packer, Sarah Wooders, Kevin Lin, Vivian Fang, Shishir G. Patil, Ion Stoica, and Joseph E. Gonzalez. MemGPT: Towards LLMs as operating systems. arXiv preprint arXiv:2310.08560, 2023. [22] Palantir Technologies. Palantir foundry ontology. Product documentation, 2024. [23] Judea Pearl. Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann, 1988. 19

[24] M. Ross Quillian. Semantic memory. In Semantic Information Processing, pages 227–270. MIT Press, 1968. [25] Tim Rocktäschel and Sebastian Riedel. End-to-end differentiable proving. In Advances in Neural Information Processing Systems, 2017. [26] Werner Schuster. Rich hickey’s Datomic embraces cloud, intelligent applications and consistency. InfoQ News, 2012. Accessed 2026-05-31. [27] Luciano Serafini and Artur d’Avila Garcez. Logic tensor networks: Deep learning and logical reasoning from data and knowledge. arXiv preprint arXiv:1606.04422, 2016. [28] Vaticle Ltd. TypeDB: A polymorphic database for knowledge systems, 2024. Accessed 2026-05-31. [29] Jim Webber. Graph Databases: New Opportunities for Connected Data. O’Reilly Media, 2013. [30] World Wide Web Consortium. OWL 2 web ontology language document overview. Technical report, W3C Recommendation, 2012. [31] World Wide Web Consortium. SPARQL 1.1 query language. Technical report, W3C Recommendation, 2013. [32] World Wide Web Consortium. RDF 1.1 concepts and abstract syntax. Technical report, W3C Recommendation, 2014.

20

Related documents

Record · ID 386987 · SHA-256 f123282147f04c04
Retrieved via Conceptio — every document is proof-bundled with source, license, and retrieval metadata.