ternary-state routing with trit_decide
Implements a three-state decision system (affirm/hold/reject) as a first-class routing primitive instead of binary yes/no forcing. The trit_decide function evaluates agent decisions against evidence sufficiency thresholds, returning a trit (ternary bit) that routes to proceed, wait-for-more-data, or block paths. This prevents false-positive commitments on ambiguous data by introducing a structural 'hold' state that triggers evidence-gathering loops before final decisions.
Unique: Introduces ternary logic as a native routing primitive instead of post-hoc confidence filtering; the 'hold' state is a first-class control flow instruction, not a side effect, enabling structural prevention of premature commitments on ambiguous data
vs alternatives: Binary decision systems (OpenAI function calling, standard ReAct agents) force yes/no on uncertain data; Ternlang's trit_decide explicitly routes to evidence-gathering loops, preventing structural errors in high-stakes decisions
consensus-based multi-agent trit_consensus
Aggregates ternary decisions from multiple agent instances or reasoning paths using a consensus mechanism that produces a single trit output. Rather than averaging confidence scores, trit_consensus evaluates agreement patterns across agents (all affirm, mixed affirm/hold, all reject, etc.) and applies voting rules to produce a robust collective decision. This enables distributed agent architectures where disagreement triggers hold states for human review or additional reasoning.
Unique: Applies ternary voting logic (not binary) across multiple agents, where disagreement patterns (e.g., 2 affirm + 1 hold) trigger hold states rather than forcing majority-rule binary outcomes; consensus is a first-class operation, not a post-hoc aggregation
vs alternatives: Standard ensemble methods average confidence scores or use majority voting on binary outcomes; trit_consensus preserves ternary semantics across agents, enabling disagreement to trigger evidence-gathering rather than forcing false consensus
ternary vector embeddings with trit_vector
Generates and operates on ternary vector representations where each dimension encodes a trit (affirm/hold/reject) instead of continuous float values. This enables semantic search and similarity operations that respect three-state logic: two vectors are similar if they agree on affirm/hold/reject across dimensions, with hold dimensions treated as 'don't care' wildcards. Useful for retrieving similar past decisions or evidence patterns from a ternary decision history.
Unique: Encodes decision logic directly into vector space using ternary dimensions instead of continuous embeddings; hold states act as wildcards in similarity matching, enabling 'find decisions where we were uncertain about X but certain about Y' queries
vs alternatives: Standard embeddings (OpenAI, Sentence Transformers) use float vectors optimized for semantic similarity; trit_vector preserves ternary decision semantics in vector space, enabling confidence-aware retrieval and clustering
mixture-of-experts orchestration with moe_orchestrate
Routes agent tasks to specialized expert sub-agents based on decision type and evidence patterns using a gating network that outputs ternary routing decisions. The MoE-13 deliberation engine maintains 13 expert agents (financial, medical, legal, technical, etc.) and uses trit outputs to route: affirm routes to execution, hold routes to multi-expert consensus, reject routes to escalation. Gating decisions are themselves ternary, enabling hold states when task classification is ambiguous.
Unique: Applies ternary routing at the gating level — task classification itself can return hold (ambiguous domain), triggering multi-expert consensus; MoE-13 is a fixed set of domain experts, not learned routing weights
vs alternatives: Standard MoE systems (Mixtral, Switch Transformers) use learned gating networks producing soft routing weights; Ternlang's moe_orchestrate uses explicit ternary routing with fixed domain experts, enabling deterministic escalation and audit trails
ternary-aware agent execution with ternlang_run
Executes agent loops with native support for ternary control flow: affirm proceeds to next step, hold triggers evidence-gathering sub-loops (additional tool calls, web searches, expert consultation), reject terminates and escalates. The runtime maintains a ternary state machine where transitions are guarded by trit outputs from decision points. Integrates with MCP servers for tool access and maintains execution traces for audit compliance.
Unique: Implements ternary state machine at the runtime level — hold states are first-class control flow that triggers sub-loops, not post-hoc retries; execution traces capture ternary semantics for compliance auditing
vs alternatives: Standard agent runtimes (LangChain, AutoGen) use binary success/failure with retry logic; ternlang_run treats hold as a native control flow state, enabling deterministic evidence-gathering loops and compliance-grade audit trails
eu ai act compliance auditing with trit_audit
Generates compliance reports for Articles 13, 14, and 15 of the EU AI Act by analyzing agent execution traces and ternary decision logs. Checks for: (13) transparency of high-risk AI system decisions, (14) human oversight mechanisms (hold states triggering escalation), (15) accuracy and robustness (consensus mechanisms, evidence thresholds). Produces structured audit reports mapping each agent decision to compliance requirements and evidence chains.
Unique: Maps ternary decision semantics directly to EU AI Act requirements: hold states demonstrate human oversight (Art. 14), trit_consensus shows robustness (Art. 15), execution traces provide transparency (Art. 13); compliance is baked into the runtime, not bolted on
vs alternatives: Generic audit tools require manual mapping of agent decisions to compliance requirements; trit_audit automates this by treating ternary semantics as compliance primitives, generating structured reports that directly reference regulatory articles
bet vm compilation and execution
Compiles Ternlang agent definitions to BET (Binary Execution Ternary) bytecode using a real compiler (not an interpreter or simulator), enabling deterministic execution and formal verification. The VM executes ternary state machines with guaranteed semantics: affirm/hold/reject transitions are atomic, no race conditions in multi-agent consensus, and execution traces are cryptographically hashable for audit immutability. Supports both local execution and distributed deployment across multiple nodes.
Unique: Uses a real compiler (not an interpreter) to produce BET bytecode with guaranteed ternary semantics; execution traces are deterministic and cryptographically hashable, enabling immutable audit trails and formal verification
vs alternatives: Standard agent frameworks (LangChain, AutoGen) are interpreted with non-deterministic LLM outputs; BET VM compiles to bytecode with formal guarantees on ternary control flow, enabling verification and cryptographic audit trails
30 free tools via mcp integration
Provides 30 pre-built tools (web search, database queries, API calls, document parsing, etc.) accessible via Model Context Protocol (MCP) servers without API keys or authentication. Tools are exposed as MCP resources that agents can discover and invoke dynamically. Each tool returns structured data compatible with ternary decision logic (confidence scores, evidence payloads). Tools are stateless and can be deployed locally or accessed via public MCP servers.
Unique: 30 tools are pre-built and free with no authentication, exposed via MCP protocol; tools return confidence scores and evidence payloads natively compatible with ternary decision logic
vs alternatives: Standard tool libraries (LangChain tools, OpenAI plugins) require API keys and authentication; Ternlang's 30 free tools are MCP-native and require no setup, with outputs designed for ternary reasoning