PrimeAgent Dependencies: Complete Guide to Packages and Installation

PrimeAgent dependencies are organized across a monorepo structure with multiple packages including ai, coding-agent, agent, and tui, each declaring their own runtime and development dependencies in individual package.json files.

PrimeAgent is an open-source AI agent framework built by Prime Intellect. Understanding its dependency structure is essential for contributors, developers extending the platform, and teams evaluating the project for production use. The codebase uses npm workspaces to manage dependencies across multiple interconnected packages.

Monorepo Package Structure

PrimeAgent follows a workspace-based monorepo pattern. Rather than a single package.json at the root, the project distributes dependencies across specialized packages under packages/.

The repository structure includes:

  • Root package.json — Workspace configuration and shared development tooling
  • packages/ai/ — LLM provider integrations and AI utilities
  • packages/coding-agent/ — Code generation and test execution capabilities
  • packages/agent/ — Core agent orchestration and CLI
  • packages/tui/ — Terminal user interface components

Each package maintains independent versioning and dependency declarations, enabling targeted installs and selective upgrades.

Core Package Dependencies

AI Package (packages/ai/)

The AI package contains the largest set of external integrations, connecting to multiple LLM providers. Key PrimeAgent dependencies in this package include:

  • openai — OpenAI API client for GPT models
  • anthropic — Claude API integration
  • cohere — Cohere language model support
  • aws-sdk — AWS Bedrock and related services
  • zod — Runtime schema validation
  • node-fetch — HTTP client for API requests
  • dotenv — Environment variable management

This package serves as the abstraction layer for model providers, allowing the rest of the system to switch between backends without code changes.

Coding Agent Package (packages/coding-agent/)

The coding agent specializes in program synthesis and test execution. Its dependencies include:

  • @babel/core — JavaScript/TypeScript transpilation
  • @babel/preset-env — Modern JavaScript target compilation
  • @babel/preset-typescript — TypeScript support
  • typescript — TypeScript compiler and language services
  • vitest — Fast unit testing framework
  • vite — Build tooling and development server
  • tsx — TypeScript execution environment

These tools enable dynamic code generation, safe execution in isolated contexts, and comprehensive test coverage for generated programs.

Agent Core Package (packages/agent/)

The central orchestration package focuses on CLI interaction and workflow management:

  • commander — Command-line interface framework
  • chalk — Terminal string styling
  • ora — Loading spinners and progress indicators
  • zod — Configuration and input validation
  • dotenv — Environment configuration
  • node-fetch — HTTP utilities

This package coordinates between the AI backends and user-facing interfaces, handling session state and tool execution.

TUI Package (packages/tui/)

The terminal UI package provides rich interactive experiences:

  • blessed — Low-level terminal UI widgets
  • blessed-contrib — Higher-level dashboard components
  • ink — React-based terminal UI framework
  • react / react-dom — Component model for terminal rendering
  • chalk — Color and formatting utilities
  • lodash — General utility functions

This dual approach—both blessed for traditional TUIs and ink for React-based interfaces—provides flexibility in interface design.

Root Workspace Configuration

The root package.json defines workspace boundaries and shared development tools rather than runtime dependencies. Typical root-level PrimeAgent dependencies include:

  • typescript — Project-wide type checking
  • ts-node — TypeScript execution for scripts
  • tsx — Modern TypeScript runner
  • vitest — Test runner configuration
  • eslint — Code linting rules
  • prettier — Code formatting

Workspace configuration uses npm's native workspaces feature, declared via:

{
  "workspaces": [
    "packages/*"
  ]
}

Installing PrimeAgent Dependencies

Full Workspace Installation

To install all PrimeAgent dependencies across the entire monorepo:


# Clone the repository

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

# Install all workspace dependencies

npm install

This command resolves dependency trees for all packages, hoists shared dependencies to the root node_modules, and creates local symlinks between workspace packages.

Single Package Installation

For targeted development on a specific package:


# Navigate to specific package

cd packages/ai

# Install dependencies for this package only

npm install

Note that workspace-aware commands from the root will respect inter-package dependencies automatically.

Adding New Dependencies

To extend PrimeAgent dependencies in a specific package:


# Add runtime dependency to AI package

cd packages/ai
npm install @azure/openai --save

# Add development dependency to coding-agent

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

Running Tests and Development

Each package configures its own test scripts via vitest:


# Run all tests across workspace

npm run test --workspaces

# Run tests for specific package

cd packages/ai
npx vitest run

# Watch mode for development

npx vitest watch

Dependency Version Constraints

As implemented in PrimeIntellect-ai/prime-agent, version constraints follow semantic versioning with caret (^) and tilde (~) prefixes to allow compatible updates. Review individual package.json files for exact version specifications:

File Direct Link
Root configuration prime-agent/blob/main/package.json
AI package prime-agent/blob/main/packages/ai/package.json
Coding agent prime-agent/blob/main/packages/coding-agent/package.json
Agent core prime-agent/blob/main/packages/agent/package.json
TUI package prime-agent/blob/main/packages/tui/package.json

Summary

  • PrimeAgent dependencies are distributed across a monorepo workspace with five primary packages
  • The AI package integrates multiple LLM providers including OpenAI, Anthropic, and Cohere
  • The coding agent bundles Babel and TypeScript toolchain for code generation
  • Workspace installation via npm install at root resolves all package dependencies automatically
  • Each package.json is independently versioned and can be inspected for exact dependency versions

Frequently Asked Questions

Where are PrimeAgent dependencies declared?

PrimeAgent dependencies are declared in multiple package.json files across the repository. The root package.json configures the workspace structure, while individual packages under packages/ai/, packages/coding-agent/, packages/agent/, and packages/tui/ each contain their own dependency declarations for runtime and development requirements.

Does PrimeAgent use npm or yarn for dependency management?

PrimeAgent uses npm with native workspaces. The root package.json includes a workspaces array that defines the package locations, enabling npm to hoist shared dependencies and link local packages automatically. No additional tools like Lerna or Yarn are required for basic dependency operations.

How do I upgrade a dependency across all PrimeAgent packages?

To upgrade a dependency used in multiple packages, run npm update <package-name> from the repository root with the --workspaces flag, or modify version constraints in individual package.json files and run npm install. For major version upgrades, update each package's package.json manually to ensure compatibility, then reinstall.

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 →