What Are the Dependencies for Running PrimeAgent? A Complete Technical Guide
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-agentand@earendil-works/pi-tui): Provide the CLI and interactive text-based interface
Core Runtime Dependencies by Layer
Root Workspace Dependencies
The root 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 functionalityget-east-asian-width– Utility library for handling East Asian character width calculations in terminal outputs
AI Layer Dependencies
Located in 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 libraryopenai– OpenAI API clientchalk– Terminal color and styling utilitiespartial-json– Fault-tolerant JSON parser for streaming responsesproxy-agent– HTTP proxy support for corporate environmentsundici– High-performance HTTP clientzod-to-json-schema– Schema conversion utilities for structured outputs
Agent Core Dependencies
The packages/agent/package.json defines the core agent functionality with minimal but critical dependencies:
@earendil-works/pi-ai– The AI layer described abovetypebox– 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-agentdepends on both the AI and Agent core layers@earendil-works/pi-tuiconsumes 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 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.
# 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:
# Build all workspaces sequentially
npm run build
To launch the interactive TUI with hot-reloading during development:
# Launch ai, agent, coding-agent, and tui concurrently
npm run dev
For production execution after building, start the TUI directly:
node packages/tui/dist/cli.js
You can also interact with the AI layer directly via CLI:
npx pi-ai models list
Key Configuration Files
Several source files define and consume these dependencies:
package.json(root) – Declares workspace configuration and root-level dependencies including the coding-agent librarypackages/ai/package.json– Contains all LLM provider SDKs and HTTP utilities required for model interactionspackages/agent/package.json– Defines the core agent's dependency on the AI layer and schema validation librariespackages/coding-agent/src/cli/*.ts– Implements the command-line interface that integrates AI and Agent core functionalitypackages/tui/src/cli.ts– Entry point for the text-based UI that consumes the coding-agent workspacescripts/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
undiciandproxy-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-agentandget-east-asian-width - Installation requires only
npm installat the root to resolve all workspace dependencies - The TUI entry point is located at
packages/tui/dist/cli.jsafter 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 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 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. 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.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →