# What Are the Dependencies for Running PrimeAgent? A Complete Technical Guide

> Discover the essential dependencies for running PrimeAgent. This guide details Node.js and npm workspace requirements for its multi-layered architecture.

- Repository: [Prime Intellect/prime-agent](https://github.com/PrimeIntellect-ai/prime-agent)
- Tags: how-to-guide
- Published: 2026-08-09

---

**PrimeAgent requires Node.js ≥20.0.0 (≥22.8.0 recommended) and uses npm workspaces to manage dependencies across four architectural layers: root orchestration, AI providers, agent core, and TUI interfaces.**

PrimeAgent is a monorepo developed by PrimeIntellect-ai that organizes its runtime into distinct workspaces. Understanding the dependencies for running PrimeAgent requires examining each layer's specific requirements, from LLM provider SDKs to core utility libraries.

## Monorepo Workspace Structure

The PrimeAgent codebase splits functionality across multiple npm workspaces. Each workspace operates as a distinct layer with specific responsibilities and dependency requirements.

The four primary layers include:

- **Root workspace**: Orchestrates the entire system and defines the global runtime environment
- **AI layer** (`@earendil-works/pi-ai`): Handles unified LLM API interactions and model discovery
- **Agent core** (`@earendil-works/pi-agent-core`): Manages transport abstraction and state handling
- **Coding-Agent and TUI** (`@earendil-works/pi-coding-agent` and `@earendil-works/pi-tui`): Provide the CLI and interactive text-based interface

## Core Runtime Dependencies by Layer

### Root Workspace Dependencies

The root [`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json) defines the top-level runtime environment and orchestration dependencies. According to the source code, the root requires:

- `@earendil-works/pi-coding-agent` – The core coding-agent library that aggregates lower-level functionality
- `get-east-asian-width` – Utility library for handling East Asian character width calculations in terminal outputs

### AI Layer Dependencies

Located in [`packages/ai/package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/ai/package.json), the AI workspace contains the most extensive dependency list to support multiple LLM providers:

- `@anthropic-ai/sdk` – Official Anthropic API client
- `@aws-sdk/client-bedrock-runtime` – AWS Bedrock runtime client
- `@google/genai` – Google Gemini API client
- `@mistralai/mistralai` – Mistral AI client library
- `openai` – OpenAI API client
- `chalk` – Terminal color and styling utilities
- `partial-json` – Fault-tolerant JSON parser for streaming responses
- `proxy-agent` – HTTP proxy support for corporate environments
- `undici` – High-performance HTTP client
- `zod-to-json-schema` – Schema conversion utilities for structured outputs

### Agent Core Dependencies

The [`packages/agent/package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/agent/package.json) defines the core agent functionality with minimal but critical dependencies:

- `@earendil-works/pi-ai` – The AI layer described above
- `typebox` – JSON Schema utilities for runtime type validation

### Coding-Agent and TUI Dependencies

The coding-agent workspace (`packages/coding-agent/`) and TUI workspace (`packages/tui/`) do not declare extensive external dependencies in their manifests. Instead, they consume the lower layers:

- `@earendil-works/pi-coding-agent` depends on both the AI and Agent core layers
- `@earendil-works/pi-tui` consumes the coding-agent and agent packages to provide the interactive interface

## Node.js Version Requirements

All packages in the PrimeAgent monorepo require **Node.js ≥20.0.0** as a baseline. However, the root [`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json) enforces stricter constraints in its `engines` field, requiring **Node.js ≥22.8.0** for the orchestration layer.

This version requirement ensures compatibility with modern JavaScript features and the specific npm workspace functionality used throughout the repository.

## Installation and Setup Workflow

Installing the dependencies for running PrimeAgent requires cloning the repository and utilizing npm's workspace functionality. A single install command resolves dependencies across all layers.

```bash

# Clone the repository

git clone https://github.com/PrimeIntellect-ai/prime-agent.git
cd prime-agent

# Install root and all workspace dependencies

npm install

```

After installation, build the TypeScript sources to generate the compiled `dist/` directories required for execution:

```bash

# Build all workspaces sequentially

npm run build

```

To launch the interactive TUI with hot-reloading during development:

```bash

# Launch ai, agent, coding-agent, and tui concurrently

npm run dev

```

For production execution after building, start the TUI directly:

```bash
node packages/tui/dist/cli.js

```

You can also interact with the AI layer directly via CLI:

```bash
npx pi-ai models list

```

## Key Configuration Files

Several source files define and consume these dependencies:

- **[`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json)** (root) – Declares workspace configuration and root-level dependencies including the coding-agent library
- **[`packages/ai/package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/ai/package.json)** – Contains all LLM provider SDKs and HTTP utilities required for model interactions
- **[`packages/agent/package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/agent/package.json)** – Defines the core agent's dependency on the AI layer and schema validation libraries
- **`packages/coding-agent/src/cli/*.ts`** – Implements the command-line interface that integrates AI and Agent core functionality
- **[`packages/tui/src/cli.ts`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/tui/src/cli.ts)** – Entry point for the text-based UI that consumes the coding-agent workspace
- **[`scripts/generate-models.ts`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/scripts/generate-models.ts)** – Generates model definitions for the AI package and requires the AI dependencies to execute

## Summary

- PrimeAgent uses **npm workspaces** to manage a monorepo split into four distinct architectural layers
- The **AI layer** requires SDKs for Anthropic, AWS Bedrock, Google Gemini, Mistral, and OpenAI, plus HTTP utilities like `undici` and `proxy-agent`
- **Node.js ≥22.8.0** is enforced at the root level, though the base requirement is ≥20.0.0
- Root dependencies include `@earendil-works/pi-coding-agent` and `get-east-asian-width`
- Installation requires only `npm install` at the root to resolve all workspace dependencies
- The TUI entry point is located at [`packages/tui/dist/cli.js`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/tui/dist/cli.js) after building

## Frequently Asked Questions

### What Node.js version is required to run PrimeAgent?

PrimeAgent requires Node.js ≥20.0.0 across all packages, but the root workspace enforces Node.js ≥22.8.0 in its `engines` field. You should use Node.js 22.8.0 or higher to ensure compatibility with the monorepo's orchestration layer and npm workspace features.

### Does PrimeAgent support all major LLM providers?

Yes, according to the [`packages/ai/package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/ai/package.json) source code, PrimeAgent includes official SDKs for Anthropic (`@anthropic-ai/sdk`), AWS Bedrock (`@aws-sdk/client-bedrock-runtime`), Google Gemini (`@google/genai`), Mistral (`@mistralai/mistralai`), and OpenAI (`openai`). This unified AI layer allows the agent to interact with multiple providers through a consistent interface.

### How do I install dependencies for all PrimeAgent workspaces at once?

Run `npm install` from the repository root. Because PrimeAgent uses npm workspaces, this single command automatically installs the root dependencies plus each workspace's individual dependencies defined in their respective [`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json) files. You do not need to run separate install commands for each package.

### Where is the TUI entry point located after building?

The text-based UI entry point is [`packages/tui/dist/cli.js`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/tui/dist/cli.js). After running `npm run build` to compile the TypeScript sources, you can launch the interface directly with `node packages/tui/dist/cli.js`. During development, use `npm run dev` to launch all workspaces concurrently with hot-reloading.