Skip to content
Dori Help Center
Esc
navigateopen⌘Jpreview
On this page

Graph Engineering in Dori

How Dori models AI agents, data transformations, and workflows as deterministic DAGs with edge contracts and verifier nodes.

Complex AI applications break when built as simple linear prompt chains. Dori uses Graph Engineering—treating execution steps as graph nodes connected by explicit data contracts and runtime verifiers.

Zero-TokenIngest NodeOCR WorkerPoolWhisper Pool(Speech)Sync Barrier(Aggregate)Edge Verifier(@guard)CQRS Snapshot& SSE Stream

Core Graph Engineering Principles

1. Edge Contracts & Zero-Token Transformations

Data passed between nodes is governed by strict Zod schema contracts.

  • Zero-Token Edge Transforms: Data normalization (deduplication, date parsing, structure cleaning) runs in pure TypeScript code on the edge before calling LLM models, eliminating wasted token spend.
  • Contract Enforcement: Every tool call and engine action validates input and output payloads against strict Zod definitions (guardrails.ts).

2. Parallel Fan-Out & Fan-In Barriers

To eliminate sequential latency bottlenecks:

  • Parallel Fan-Out: Document parsing, OCR, and audio transcription fan out concurrently across worker pools.
  • Fan-In Synchronization Barriers: Parent synthesis nodes wait at explicit barrier nodes to aggregate payloads before running state updates.

3. Edge Verifiers & Cyclic Convergence Loops

Outputs are never assumed to be valid without empirical verification:

  • Verifier Nodes: Structured outputs and code edits must pass mandatory review (@guard) and testing (@qa) verifiers before state transition commits.
  • Convergence Loops: If a verifier node rejects an output, the workflow cycles back to the execution node with specific error logs, repeating until criteria pass.

4. Content-Addressable Short-Circuiting

To minimize unnecessary re-indexing:

  • Files are fingerprinted using SHA-256 content hashes.
  • Unchanged files short-circuit downstream parsing and vector embedding nodes entirely.

5. CQRS & Reactive Event Streaming

  • Read/Write Decoupling: Vault file edits and database writes update raw state. The engine projects read-optimized query snapshots (domain-records.ts) for the UI.
  • Server-Sent Events (SSE): Workflow state updates stream directly to UI components (live-events.ts), updating indicators and attention badges reactively without polling.

Was this page helpful?