What Programming Languages Does PrimeAgent Support? (TypeScript + Python Architecture)

PrimeAgent supports two primary programming languages: TypeScript/JavaScript for its core engine and UI, and Python for skill execution and extensibility.

The PrimeAgent repository from PrimeIntellect-ai implements a dual-language architecture that separates platform infrastructure from user-extendable capabilities. Understanding this split helps developers contribute effectively to the codebase or build custom skills.


Core Language: TypeScript/JavaScript

The PrimeAgent platform itself is built entirely in TypeScript. This encompasses the AI orchestration layer, terminal user interface, and LLM provider integrations.

According to the PrimeAgent source code, the TypeScript codebase lives in two main package directories:

  • packages/ai — AI provider integrations and model resolution
  • packages/tui — Terminal user interface components

The entry point for the AI layer resides at packages/ai/src/index.ts, which registers available LLM providers and initializes the inference pipeline. The TUI core at packages/tui/src/index.ts handles interactive command execution and session management.

// Example: Invoking a Python skill from the TypeScript agent layer
import { rlm } from "prime-agent-runtime";

const result = await rlm('sub-task', {
  model: 'gpt-4',
  toolCalls: [{ name: 'web_search', arguments: { query: 'Prime Agent' } }],
});

console.log(result);

This pattern appears in packages/coding-agent/src/core/model-resolver.ts, where the TypeScript side delegates computational tasks to the runtime.


Skill Language: Python

User-extendable skills in PrimeAgent are implemented in Python. The platform launches an IPython kernel to execute these modules, creating a "long-lived notebook" environment that persists across agent interactions.

The Python runtime layer is defined in two critical files:

The harness.py module mediates all calls between TypeScript and Python, marshaling data across the language boundary.


# Example: A simple Python skill for web search

# File: skills/web_search.py

import httpx

async def web_search(query: str) -> str:
    """Return the first search result for `query`."""
    resp = await httpx.get(f"https://duckduckgo.com/html/?q={query}")
    return resp.text[:500]

PrimeAgent's skill system discovers Python modules dynamically, loading them into the IPython kernel where they remain available for repeated invocation.


Why This Dual-Language Design?

The PrimeAgent architecture leverages TypeScript for its robust ecosystem around LLM APIs, streaming responses, and terminal interfaces. Python was chosen for skills due to its dominance in data science, ML tooling, and rapid prototyping.

This separation provides several advantages:

  • TypeScript handles async I/O, UI rendering, and provider abstraction with type safety
  • Python enables data scientists to contribute skills without learning TypeScript
  • The IPython kernel preserves state across tool calls, supporting iterative workflows

While the underlying LLM can generate code in any language, only TypeScript and Python are natively executed by the PrimeAgent platform.


Key Files and Their Languages

File Path Language Purpose
packages/ai/src/index.ts TypeScript AI layer entry point; registers LLM providers
packages/tui/src/index.ts TypeScript Terminal UI core
packages/tui/src/kill-ring.ts TypeScript Command integration patterns
packages/coding-agent/src/core/model-resolver.ts TypeScript Model resolution and skill invocation
prime-agent-runtime/src/rlm/skill.py Python Skill module discovery and execution
prime-agent-runtime/src/rlm/harness.py Python IPython kernel management

Summary

  • TypeScript/JavaScript powers PrimeAgent's core engine, UI, and LLM integrations
  • Python drives the skill execution environment via IPython kernel
  • The rlm function in TypeScript delegates to Python skills through prime-agent-runtime
  • Skills persist state in the IPython kernel, enabling multi-turn interactions
  • No other programming languages are natively supported for platform extension

Frequently Asked Questions

Can I write PrimeAgent skills in languages other than Python?

No. While the underlying LLM may generate code in any language, PrimeAgent's runtime only supports Python for executable skills. The prime-agent-runtime/src/rlm/harness.py module specifically manages an IPython kernel, and no alternative language runtimes are implemented.

Is the PrimeAgent UI built with a TypeScript framework?

Yes. The terminal UI in packages/tui/src/index.ts is implemented in TypeScript. The codebase does not use a browser-based framework; instead, it renders directly to the terminal using TypeScript's async I/O capabilities.

Can I modify the PrimeAgent core without knowing TypeScript?

No. Core modifications—such as adding new LLM providers or changing the orchestration logic—require TypeScript knowledge. The packages/ai and packages/coding-agent directories contain the platform's foundation and are exclusively TypeScript.

Does PrimeAgent support running JavaScript skills?

No. Despite being built in TypeScript, PrimeAgent does not execute JavaScript/TypeScript skills. The skill runtime is Python-only. TypeScript remains the implementation language for the platform itself, not for user extensions.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →