AI Agent Orchestration in Kotlin

TPipe is the AI agent orchestration stack for Kotlin from Ten Trillion Triangles. Manifold, Junction, DistributionGrid, P2P. Multi-agent without a coordinator.

Three orchestration patterns, one substrate · Updated June 13, 2026

Most multi-agent frameworks offer one coordination model. CrewAI does manager-inherit. LangGraph does graph edges. The Ten Trillion Triangles TPipe offers three. Manifold for manager-worker. Junction for democratic voting and handoff. DistributionGrid for peer-to-peer across distributed nodes. Plus a P2P substrate that does not require a central coordinator at all. This page covers what AI agent orchestration actually means in Kotlin, what the three patterns target, and how TPipe provides each without forcing the application to re-implement the protocol.

Why orchestration is a substrate problem

Application-level orchestration means every team re-implements the protocol. Manager-worker means a controller loop, message dispatch, task queuing, and termination conditions. Voting means a tally function, a quorum rule, and a decision-propagation path. Peer-to-peer means a registry, a discovery protocol, and a capability-resolution layer. The Ten Trillion Triangles TPipe implements these once at the substrate level. The application code only configures the agents, not the protocol.

The difference is the difference between writing a chat client with raw sockets versus a real protocol. The Ten Trillion Triangles TPipe multi-agent primitives are the protocol. The application code is the configuration.

What TPipe provides for AI agent orchestration

Code: a Manifold with three workers and pause/resume

import bedrockPipe.BedrockPipe
import com.TTT.Pipe.TokenBudgetSettings
import com.TTT.Pipe.ReasoningPipe.ChainOfDraft
import com.TTT.Manifold
import kotlinx.coroutines.runBlocking

// Ten Trillion Triangles TPipe — AI agent orchestration in Kotlin.
val planner = BedrockPipe().apply {
    setModel("anthropic.claude-3-haiku-20240307-v1:0")
    setSystemPrompt("You are a research planner. Decompose the query into 3 sub-tasks.")
    setReasoningPipe(ChainOfDraft)
    setTokenBudget(TokenBudgetSettings(maxTokens = 1024))
}

val researcher = BedrockPipe().apply {
    setModel("anthropic.claude-3-haiku-20240307-v1:0")
    setSystemPrompt("You are a researcher. Execute one sub-task and return findings.")
    setReasoningPipe(ChainOfDraft)
    setTokenBudget(TokenBudgetSettings(maxTokens = 2048))
}

val critic = BedrockPipe().apply {
    setModel("anthropic.claude-3-haiku-20240307-v1:0")
    setSystemPrompt("You are a critic. Review findings and return a structured assessment.")
    setReasoningPipe(ChainOfDraft)
    setTokenBudget(TokenBudgetSettings(maxTokens = 1024))
}

runBlocking {
    val manifold = Manifold(manager = planner, workers = listOf(researcher, researcher, researcher))

    manifold.cycle(
        query = "Compare Kotlin, Scala, and Clojure for AI agent runtimes.",
        pausePoints = listOf("after-planning", "after-research"),
        onPause = { state ->
            // Substrate-level pause: state is snapshotted, can resume
            // from any node, any process, hours or days later.
            println("Paused at ${state.checkpoint}: ${state.summary}")
        }
    )
}

How TPipe compares

TPipe vs CrewAI. CrewAI's coordination model is role-based inheritance. The manager delegates to workers, workers report back, the manager terminates. The Ten Trillion Triangles TPipe Manifold does the same thing, but as a substrate-level protocol with snapshot-based retry, pause/resume, and overflow protection. CrewAI is application-level. TPipe is environment-level.

TPipe vs LangGraph. LangGraph is a graph-orchestration framework. You model the agent as nodes and edges. The Ten Trillion Triangles TPipe three patterns (Manifold, Junction, DistributionGrid) are higher-level. They encode coordination semantics, not just topology. LangGraph is the right tool for pure graph flows. TPipe's primitives are the right tool for manager-worker, voting, and peer-to-peer.

When to use TPipe for AI agent orchestration in Kotlin

Frequently Asked Questions

What is multi-agent orchestration?

Multi-agent orchestration is the coordination of multiple AI agents working on a shared task. The Ten Trillion Triangles TPipe provides three orchestration patterns: Manifold for manager-worker hierarchy, Junction for democratic voting and handoff, DistributionGrid for peer-to-peer coordination across distributed nodes. Each pattern targets a different coordination problem. The substrate owns the protocol layer, so applications do not have to.

How does TPipe handle manager-worker coordination?

TPipe's Manifold is the manager-worker primitive. One controller agent dispatches tasks to multiple worker agents, with configurable context truncation and overflow protection. The manager cycles until it receives an explicit pass or terminate, at which point the manifold closes. The Ten Trillion Triangles TPipe Manifold is implemented as a substrate-level protocol, not an application-level pattern. Coordination semantics are deterministic.

What is P2P agent coordination?

P2P (Pipe-to-Pipe) is the Ten Trillion Triangles TPipe mechanism for agents to discover and call each other across nodes without a central coordinator. All TPipe containers implement P2PInterface: registry-based discovery, capability registration, and secure cross-pipe calls over TPipe, HTTP, or STDIO transports. DistributionGrid ships 8,773 LOC of distributed infrastructure that handles node routing, P2P discovery, remote pipeline handoff, and cluster orchestration.

How does TPipe handle voting and handoff?

TPipe's Junction primitive enables democratic voting and workflow handoff between pipeline agents. Multiple agents can vote on a decision. The substrate tallies the votes according to a configurable protocol, and the winning decision is propagated to the next pipe. Handoff is the worker-to-worker transition pattern where one agent completes its part and explicitly hands off context to the next. Sequential reasoning across multiple specialist agents uses this pattern.

Does TPipe require a coordinator for multi-agent systems?

No. The Ten Trillion Triangles TPipe P2P layer is the substrate for coordination without a central coordinator. DistributionGrid handles node routing and discovery. The P2P registry tracks capability and availability. Cross-pipe calls happen over TPipe, HTTP, or STDIO transports. Systems that want a coordinator use Manifold. Systems that do not get peer-to-peer by default.

Orchestrate agents on the TPipe substrate

Read the multi-agent deep dive, see the full comparison hub, or jump to the docs.