Docs · The doctrine · Section 03
Language choice, full TypeScript or polyglot
The question is not one language for everything, but the right language in the right place, behind contracts. Here is the recommended position, grounded in systems already built.
1 TypeScript for orchestration and the interface
For the agentic core (orchestrator, tool registry, use cases) and the cockpit, a single language across server and interface avoids doubling the stack and multiplying maintenance surfaces. Types are shared between the back end and the front end. The model abstraction stays light: a direct SDK, not a heavyweight chaining framework, to keep control of prompts, events, and token cost.
2 A specialized language as a sidecar when the library demands it
When a capability depends on a mature ecosystem in another language (browser automation, scientific computing, specialized models), it is isolated in a sidecar exposed through the tool protocol. This is the case, for example, of an execution engine driven from a dedicated sidecar. The core consumes it as a tool provider, without absorbing its stack.
3 Rust or Go for performance-sensitive components
For a component on the critical path (a high-throughput gateway, intensive parallel processing, a tight-latency service), a compiled language is justified. It is then exposed as an adapter or a service behind a contract, without contaminating the rest.
Language decision matrix
| Component | Recommendation | Why |
|---|---|---|
| Orchestrator, tool registry, use cases | TypeScript | Single stack with the interface, shared types, light model abstraction. |
| Cockpit and interface | TypeScript | Continuity with the back end, unified streaming and rendering. |
| Capability with a specialized ecosystem | Python as a sidecar | Mature libraries, isolated behind the tool protocol. |
| Component on the critical path | Rust or Go | Latency and throughput, exposed behind a contract. |
| Model gateway | Any language | Centralized governance and routing, behind the model port. |
Diagram, a TypeScript core and polyglot sidecars
Anti-pattern to avoid: doubling the stack by default (a back end in one language, an interface in another) without necessity. Going polyglot is justified by a library or a performance constraint, not by habit. When it is justified, it goes through a sidecar or a service, never through a mix inside the core.