Skip to main content

Demos & Benchmarks

36 demo/benchmark pairs covering AI, agents, distributed systems, security, and more. Each feature has a -demo command (interactive demonstration) and a -bench command (performance benchmark).

Running Demos

tri <name>-demo                         # Run interactive demo
tri <name>-bench # Run benchmark

Needle Check (Koschei's Immortality Test)

Every benchmark uses the Needle Check — a quality gate based on the golden ratio:

threshold=ϕ1=0.6180339887...\text{threshold} = \phi^{-1} = 0.6180339887...

The benchmark computes an improvement rate and compares it to the threshold:

StatusConditionMessage
PASS (Immortal)rate >0.618> 0.618KOSCHEI BESSMERTEN! Igla ostra. (Koschei is immortal! Needle is sharp.)
WARN (Mortal)0<0 < rate <0.618< 0.618Uluchshenie est', no Igla tupitsya. (Improvement exists, but needle dulls.)
FAIL (Regression)rate 0\leq 0REGRESSIYA! Igla slomana. (Regression! Needle is broken.)

Improvement Rate Formula

Each benchmark calculates the improvement rate as a weighted composite of scenario metrics:

improvement_rate = (metric_1 + metric_2 + baseline_contribution) / 2.0

Where metrics are scenario-specific (hit rate, similarity score, agent count, throughput, etc.) and normalized to the [0,1][0, 1] range.

Example Benchmark Output

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Scenario 1: Basic query
Hit rate: 0.85
Similarity: 0.92
Improvement: 0.887

Scenario 2: Complex reasoning
Hit rate: 0.72
Similarity: 0.88
Improvement: 0.800

Needle Check (phi^-1 = 0.618):
Average rate: 0.843
Status: KOSCHEI IS IMMORTAL! Needle is sharp.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Pre-Cycle Demos

Early features implemented before the numbered cycle system.

CommandAliasesDescription
tri tvc-demotvcTVC Distributed Chat — 10,000-entry ternary vector corpus
tri tvc-statsTVC corpus configuration and status
tri agents-demoagentsMulti-Agent Coordination — Coordinator, Coder, Chat, Reasoner, Researcher
tri agents-benchMulti-Agent System Benchmark — 10 task scenarios
tri context-democontextLong Context Engine — sliding window (20 messages) + summarization
tri context-benchLong Context Benchmark — 24-turn conversation simulation
tri rag-demoragRAG — Query → Embed → Retrieve → Augment → Generate
tri rag-benchRAG Retrieval Benchmark — similarity scoring
tri voice-demovoice, micVoice I/O (TTS + STT) integration
tri voice-benchmic-benchVoice I/O performance benchmark
tri sandbox-demosandboxCode Execution Sandbox — safe execution with 5s timeout
tri sandbox-benchSandbox Benchmark — Zig, Python, JS, Shell execution
tri stream-demostream, pipelineStreaming Output — token-by-token with 256-token buffer
tri stream-benchpipeline-benchStreaming Benchmark — char/token/chunk/SSE modes
tri finetune-demofinetuneFine-Tuning Engine — local model adaptation
tri finetune-benchFine-Tuning Benchmark — learning rate convergence
tri batched-demobatchedBatched Work-Stealing — parallel batch scheduler
tri batched-benchBatched Stealing Benchmark — throughput/latency
tri priority-demopriorityPriority Queue — task scheduling
tri priority-benchPriority Queue Benchmark
tri deadline-demodeadlineDeadline Scheduling — SLA enforcement
tri deadline-benchDeadline Scheduling Benchmark

Cycle 20: Vision

CommandAliasesDescription
tri vision-demovision, eyeLocal Vision — image → ternary embedding → scene detection → caption
tri vision-bencheye-benchVision Benchmark — 80 COCO semantic categories

Cycle 26: Multi-Modal

CommandAliasesDescription
tri multimodal-demomultimodal, mmMulti-Modal Unified Engine — text + vision + voice + code → VSA
tri multimodal-benchmm-benchMulti-Modal Benchmark — cross-modal fusion

Cycle 27: Tool Use

CommandAliasesDescription
tri tooluse-demotooluse, toolsMulti-Modal Tool Use — function calling with multi-modal inputs
tri tooluse-benchtools-benchTool Use Benchmark — invocation and result handling

Cycle 30-33: Unified Agents

CommandAliasesCycleDescription
tri unified-demounified, agent30Unified Multi-Modal Agent — all modalities in single agent
tri unified-benchagent-bench30Unified Agent Benchmark
tri autonomous-demoauto, autonomous31Autonomous Agent — self-directed with goal planning
tri autonomous-benchautonomous-bench31Autonomous Agent Benchmark
tri orchestration-demoorch, orchestrate32Multi-Agent Orchestration — task distribution
tri orchestration-benchorchestrate-bench32Orchestration Benchmark
tri mm-orch-demommo, mm-orch33MM Multi-Agent Orchestration — multi-modal coordination
tri mm-orch-benchmm-orch-bench33MM Orchestration Benchmark

Cycle 34-37: Memory & Distribution

CommandAliasesCycleDescription
tri memory-demomemory, mem34Agent Memory & Cross-Modal Learning
tri memory-benchmem-bench34Memory Benchmark
tri persist-demopersist, save35Persistent Memory & Disk Serialization
tri persist-benchsave-bench35Persistence Benchmark — I/O performance
tri spawn-demospawn, pool36Dynamic Agent Spawning & Load Balancing
tri spawn-benchpool-bench36Spawn Benchmark — spawn latency
tri cluster-democluster, nodes37Distributed Multi-Node Agents
tri cluster-benchnodes-bench37Cluster Benchmark — network latency/throughput

Cycle 39-45: Scheduling & Plugins

CommandAliasesCycleDescription
tri worksteal-demoworksteal, steal39Adaptive Work-Stealing Scheduler
tri worksteal-benchsteal-bench39Work-Stealing Benchmark
tri plugin-demoplugin, ext40Plugin & Extension System
tri plugin-benchext-bench40Plugin Benchmark
tri comms-democomms, msg41Agent Communication Protocol
tri comms-benchmsg-bench41Communication Benchmark — message throughput
tri observe-demoobserve, otel42Observability & Tracing System
tri observe-benchotel-bench42Observability Benchmark — tracing overhead
tri consensus-democonsensus, raft43Consensus & Coordination Protocol (Byzantine-tolerant)
tri consensus-benchraft-bench43Consensus Benchmark
tri specexec-demospecexec, spec44Speculative Execution Engine
tri specexec-benchspec-bench44Speculative Execution Benchmark
tri governor-demogovernor, gov45Adaptive Resource Governor
tri governor-benchgov-bench45Resource Governor Benchmark

Cycle 46-52: Advanced Systems

CommandAliasesCycleDescription
tri fedlearn-demofedlearn, fl46Federated Learning Protocol
tri fedlearn-benchfl-bench46Federated Learning Benchmark — convergence
tri eventsrc-demoeventsrc, es47Event Sourcing & CQRS Engine
tri eventsrc-benches-bench47Event Sourcing Benchmark — event throughput
tri capsec-democapsec, sec48Capability-Based Security Model
tri capsec-benchsec-bench48Security Benchmark — authorization overhead
tri dtxn-demodtxn, txn49Distributed Transaction Coordinator (ACID)
tri dtxn-benchtxn-bench49Transaction Benchmark — throughput
tri cache-democache, memo50Adaptive Caching & Memoization
tri cache-benchmemo-bench50Cache Benchmark — hit rates
tri contract-democontract, sla51Contract-Based Agent Negotiation
tri contract-benchsla-bench51Contract Benchmark — negotiation speed
tri workflow-demoworkflow, wf52Temporal Workflow Engine
tri workflow-benchwf-bench52Workflow Benchmark — latency

Summary

CategoryPairsCycles
Pre-cycle (AI, scheduling)11
Vision120
Multi-Modal126
Tool Use127
Unified Agents430-33
Memory & Distribution434-37
Scheduling & Plugins739-45
Advanced Systems746-52
Total36 pairs72 commands

See Also

  • Pipeline — Golden Chain development cycle (where demos are verified)
  • TVC Learning — TVC corpus architecture (used in tvc-demo)
  • Sacred Constants — The ϕ1=0.618\phi^{-1} = 0.618 threshold explained