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 utilitiespackages/coding-agent/— Code generation and test execution capabilitiespackages/agent/— Core agent orchestration and CLIpackages/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 modelsanthropic— Claude API integrationcohere— Cohere language model supportaws-sdk— AWS Bedrock and related serviceszod— Runtime schema validationnode-fetch— HTTP client for API requestsdotenv— 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 supporttypescript— TypeScript compiler and language servicesvitest— Fast unit testing frameworkvite— Build tooling and development servertsx— 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 frameworkchalk— Terminal string stylingora— Loading spinners and progress indicatorszod— Configuration and input validationdotenv— Environment configurationnode-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 widgetsblessed-contrib— Higher-level dashboard componentsink— React-based terminal UI frameworkreact/react-dom— Component model for terminal renderingchalk— Color and formatting utilitieslodash— 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 checkingts-node— TypeScript execution for scriptstsx— Modern TypeScript runnervitest— Test runner configurationeslint— Code linting rulesprettier— 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 installat root resolves all package dependencies automatically - Each
package.jsonis 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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →