Dependencies for PrimeIntellect-ai/prime-agent: Monorepo Package Guide

Prime Agent relies on an npm workspace architecture that distributes dependencies across four internal packages—@earendil-works/pi-ai, @earendil-works/pi-agent-core, @earendil-works/pi-coding-agent, and @earendil-works/pi-tui—integrating LLM provider SDKs from Anthropic, OpenAI, Google, Mistral, and AWS Bedrock alongside ZeroMQ, typebox, and development tools including TypeScript and Vitest.

The PrimeIntellect-ai/prime-agent repository is structured as a monorepo using npm workspaces to manage its modular architecture. Understanding the dependencies for PrimeIntellect-ai/prime-agent requires examining both the root-level workspace configuration and the individual package.json files located in packages/ai, packages/agent, packages/coding-agent, and packages/tui. This dependency graph enables the CLI-driven coding assistant to communicate with multiple LLM providers while maintaining clean separation between the AI layer, agent core, and terminal interface.

Workspace Architecture and Package Structure

The repository root defines the workspace in package.json with the configuration "workspaces": ["packages/*"], which automatically links internal packages during installation. This structure ensures that shared code in @earendil-works/pi-ai and @earendil-works/pi-agent-core remains available to consuming packages without publishing to npm.

Core Package Dependencies

@earendil-works/pi-ai (Unified LLM Layer)

Located in packages/ai/package.json, this package aggregates provider-specific SDKs to enable automatic model discovery. Its runtime dependencies include:

  • @anthropic-ai/sdk – Anthropic Claude API client
  • @aws-sdk/client-bedrock-runtime – Amazon Bedrock access
  • @google/genai – Google Gemini integration
  • @mistralai/mistralai – Mistral AI platform support
  • openai – OpenAI GPT models
  • undici – HTTP client for fetch operations
  • zod-to-json-schema and typebox – Schema validation utilities
  • chalk – Terminal styling
  • partial-json – Streaming JSON parsing
  • proxy-agent – Proxy support for corporate networks

@earendil-works/pi-agent-core (Agent Framework)

Defined in packages/agent/package.json, this core library handles transport, state management, and attachments. It depends on:

  • @earendil-works/pi-ai – Reuses the unified LLM interface
  • typebox – Runtime type validation

@earendil-works/pi-coding-agent (CLI and Tools)

The primary entry point in packages/coding-agent/package.json implements the coding assistant CLI with IPython integration and session handling. Key dependencies include:

  • @agentclientprotocol/sdk – Agent protocol compliance
  • @earendil-works/pi-agent-core and @earendil-works/pi-ai – Internal framework reuse
  • @earendil-works/pi-tui – Terminal UI components
  • @silvia-odwyer/photon-node – Image processing
  • zeromq – Messaging for tool execution
  • marked – Markdown parsing
  • yaml – Configuration file support
  • uuid – Session identification
  • diff – Code comparison utilities
  • extract-zip – Archive extraction
  • file-type – MIME type detection
  • glob and minimatch – File pattern matching
  • ignore – Gitignore-style pattern matching
  • hosted-git-info – Repository metadata parsing

@earendil-works/pi-tui (Terminal Interface)

Found in packages/tui/package.json, this package provides the text-based UI for interactive sessions, depending on shared libraries from the core and AI packages.

Root-Level and Shared Dependencies

The workspace root (package.json) maintains minimal runtime dependencies:

  • @earendil-works/pi-coding-agent – Entry point reference
  • get-east-asian-width – Unicode character width calculation for terminal rendering

Optional Dependencies

The coding agent declares @mariozechner/clipboard as an optionalDependency in packages/coding-agent/package.json. This allows the CLI to leverage system clipboard integration when available while ensuring the application functions normally if the native module fails to install on specific platforms.

Development Dependencies

Each package includes comprehensive devDependencies for building and testing:

  • @biomejs/biome – Linting and formatting
  • typescript – Type checking and compilation
  • tsx – TypeScript execution
  • vitest – Unit testing framework
  • @types/node – Node.js type definitions
  • concurrently – Parallel script execution
  • husky – Git hooks management
  • shx – Cross-platform shell commands

Installing and Running

To install all dependencies for PrimeIntellect-ai/prime-agent, execute:

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

This command installs root dependencies and triggers workspace resolution for all four packages. To run the coding agent CLI during development:

npm run dev --workspace=packages/coding-agent

To programmatically use the AI package:

import { piAi } from '@earendil-works/pi-ai';
console.log('PI-AI version:', piAi.version);

Summary

  • PrimeIntellect-ai/prime-agent uses npm workspaces to manage four interconnected packages: @earendil-works/pi-ai, @earendil-works/pi-agent-core, @earendil-works/pi-coding-agent, and @earendil-works/pi-tui.
  • Runtime dependencies include major LLM provider SDKs (Anthropic, OpenAI, Google, Mistral, AWS Bedrock) aggregated through the pi-ai package.
  • Specialized tooling in the coding agent requires ZeroMQ for messaging, photon-node for image processing, and various file utilities like glob, minimatch, and ignore.
  • Optional clipboard support is provided via @mariozechner/clipboard without breaking the installation if compilation fails.
  • Development workflow relies on Biome for linting, TypeScript for type safety, and Vitest for testing across all workspace packages.

Frequently Asked Questions

Does Prime Agent require all LLM provider SDKs to be installed?

No. While @earendil-works/pi-ai lists multiple provider SDKs as dependencies—including @anthropic-ai/sdk, @google/genai, and @aws-sdk/client-bedrock-runtime—the unified API automatically discovers available credentials. You only need API keys configured for the providers you intend to use; unused SDKs do not prevent the application from running.

What is the purpose of the typebox dependency across multiple packages?

typebox appears in @earendil-works/pi-ai, @earendil-works/pi-agent-core, and @earendil-works/pi-coding-agent because it provides runtime JSON schema validation and TypeScript type generation. This ensures type safety when validating LLM responses, agent state transitions, and configuration objects across the monorepo.

Why does the coding agent use ZeroMQ?

The zeromq dependency in packages/coding-agent/package.json enables asynchronous messaging between the CLI process and external tool executors, particularly for IPython-based code execution sessions. This messaging layer isolates tool execution from the main event loop while maintaining high-performance communication.

Can I run the coding agent without installing the TUI package?

No, because @earendil-works/pi-coding-agent explicitly depends on @earendil-works/pi-tui in its package.json. The terminal UI is tightly integrated into the interactive session flow, providing real-time streaming output and input handling required for the coding assistant interface.

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 →