# PrimeAgent Dependencies: Complete Guide to Package.json Files and Installation

> Understand PrimeAgent dependencies with this guide. Explore package.json files and installation for AI providers, coding agents, orchestration, and UI in the PrimeIntellect-ai/prime-agent monorepo.

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

---

**PrimeAgent dependencies are organized across multiple package.json files in a monorepo structure, with separate dependency groups for AI providers, coding agents, core orchestration, and terminal UI components.**

PrimeAgent by PrimeIntellect-ai follows a **workspace-based monorepo architecture** where each functional module maintains its own dependency manifest. Understanding this structure is essential for contributing to the project, debugging installation issues, or extending agent capabilities. This guide breaks down every dependency group, its purpose, and how to manage them.

## How PrimeAgent Organizes Dependencies

Unlike single-package Node.js projects, PrimeAgent splits functionality across distinct packages. Each contains its own [`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json) declaring **runtime dependencies**, **devDependencies**, and **peer dependencies** specific to that module.

The repository root at [`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json) defines workspace configuration and shared tooling, while sub-packages in `/packages/*` isolate domain-specific requirements.

## Root Package.json: Workspace Configuration

The root [`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json) establishes npm workspace support and repository-wide development tools. Key responsibilities include:

- Declaring workspace globs (`workspaces: ["packages/*"]`)
- Providing shared scripts (build, test, lint)
- Pinning common dev tools: `typescript`, `ts-node`, `tsx`, `vitest`, `eslint`, `prettier`

```bash

# Install all workspace dependencies from root

npm install

```

This single command resolves and hoists compatible versions across all sub-packages.

## AI Package Dependencies (/packages/ai)

Located at [`packages/ai/package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/ai/package.json), this module contains **LLM provider integrations** and AI-specific utilities.

### Core Runtime Dependencies

- **`openai`** — Official OpenAI SDK for GPT model access
- **`anthropic`** — Anthropic Claude API client
- **`cohere`** — Cohere command model integration
- **`aws-sdk`** — Amazon Bedrock model access
- **`zod`** — Runtime schema validation for LLM outputs
- **`node-fetch`** — HTTP client for provider APIs
- **`dotenv`** — Environment variable management

```bash

# Run AI package tests in isolation

cd packages/ai
npx vitest run

```

## Coding-Agent Package Dependencies (/packages/coding-agent)

The [`packages/coding-agent/package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/package.json) powers **code generation, execution, and test harness capabilities**.

### Build and Transpilation Tools

- **`@babel/core`** — JavaScript transpilation engine
- **`@babel/preset-env`** — Modern JavaScript target compilation
- **`@babel/preset-typescript`** — TypeScript-to-JavaScript transformation

### Testing and Development

- **`vitest`** — Fast unit test runner (also used across workspace)
- **`vite`** — Build tool and dev server
- **`ts-node`** — TypeScript execution without precompilation
- **`tsx`** — Zero-config TypeScript runner

These dependencies enable dynamic code generation, safe execution in sandboxed environments, and rapid iteration on coding tasks.

## Core Agent Dependencies (/packages/agent)

The [`packages/agent/package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/agent/package.json) handles **orchestration logic, CLI interfaces, and workflow management**.

### Command-Line and UX

- **`commander`** — Declarative CLI argument parsing
- **`chalk`** — Terminal string styling
- **`ora`** — Loading spinners and progress indicators
- **`zod`** — Configuration and input validation
- **`node-fetch`** — External API communication
- **`dotenv`** — Runtime environment configuration

This package acts as the coordination layer, with minimal external surface area focused on robust CLI experience and reliable HTTP operations.

## TUI Package Dependencies (/packages/tui)

The [`packages/tui/package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/tui/package.json) implements **terminal user interfaces** for interactive agent sessions.

### UI Framework Stack

- **`blessed`** — Low-level terminal widget library
- **`blessed-contrib`** — Pre-built dashboard components (charts, grids, maps)
- **`ink`** — React-based CLI UI framework
- **`react`** & **`react-dom`** — Component model for terminal rendering
- **`chalk`** — Consistent styling across UI components
- **`lodash`** — Utility functions for state management

This dual-stack approach (blessed for complex layouts, Ink for React-based components) provides flexibility for different interface modes.

## Installing and Managing PrimeAgent Dependencies

### Full Workspace Installation

```bash
git clone https://github.com/PrimeIntellect-ai/prime-agent.git
cd prime-agent
npm install

```

### Adding Dependencies to Specific Packages

```bash

# Add production dependency to AI package

cd packages/ai
npm install @anthropic-ai/sdk --save

# Add dev dependency to coding-agent

cd packages/coding-agent
npm install @types/node --save-dev

```

### Verifying Dependency Trees

```bash

# Audit entire workspace for vulnerabilities

npm audit

# Check for outdated packages across all workspaces

npm outdated --workspaces

```

## Dependency Version Constraints and Lockfile

PrimeAgent uses [`package-lock.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package-lock.json) at the root to ensure **deterministic installations** across environments. The lockfile captures exact resolved versions of all transitive dependencies, critical for reproducible AI agent behavior.

When upgrading dependencies:

1. Modify the target [`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json) version constraint
2. Run `npm install` from root to regenerate lockfile
3. Test affected packages: `npm test --workspace=packages/ai`
4. Commit both [`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json) and [`package-lock.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package-lock.json) changes

## Summary

- **PrimeAgent dependencies** are distributed across five key [`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json) files: root workspace, `packages/ai`, `packages/coding-agent`, `packages/agent`, and `packages/tui`
- **AI package** concentrates LLM provider SDKs: OpenAI, Anthropic, Cohere, AWS Bedrock
- **Coding-agent package** bundles transpilation and testing tools: Babel, Vitest, Vite, tsx
- **Core agent package** prioritizes CLI robustness: Commander, Chalk, Ora, Zod
- **TUI package** combines Blessed widgets with React-based Ink components
- **Root workspace** enables unified installation and shared development tooling

## Frequently Asked Questions

### Where are PrimeAgent dependencies declared?

Dependencies exist in multiple [`package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/package.json) files across the monorepo. The root file defines workspaces and shared tools, while [`packages/ai/package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/ai/package.json), [`packages/coding-agent/package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/coding-agent/package.json), [`packages/agent/package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/agent/package.json), and [`packages/tui/package.json`](https://github.com/PrimeIntellect-ai/prime-agent/blob/main/packages/tui/package.json) each contain module-specific dependencies.

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

Run `npm install` from the repository root. npm workspaces automatically resolve and install dependencies declared in all sub-package manifests, hoisting shared versions to reduce disk usage.

### Can I run a single package without installing everything?

Yes. Navigate to the specific package directory (e.g., `cd packages/ai`) and run `npm install` there. However, this may fail if the package depends on unpublished internal workspace modules. The recommended approach is root-level installation with workspace filtering: `npm run test --workspace=packages/ai`.