npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@codebolt/agent

v5.0.8

Published

CodeBolt Agent utilities for building and managing AI agents

Readme

CodeBolt Agent Package

A comprehensive TypeScript framework for building and managing AI agents with CodeBolt. This package provides multiple architectural patterns and utilities to meet different development needs, from simple composable agents to complex multi-step workflows.

🚀 Quick Start

import { ComposableAgent, createTool } from '@codebolt/agent/composable';
import { z } from 'zod';

// Create a simple weather tool
const weatherTool = createTool({
  id: 'get-weather',
  description: 'Get current weather for a location',
  inputSchema: z.object({ location: z.string() }),
  outputSchema: z.object({ temperature: z.number(), conditions: z.string() }),
  execute: async ({ context }) => {
    return await getWeatherAPI(context.location);
  },
});

// Create and run agent
const agent = new ComposableAgent({
  name: 'Weather Agent',
  instructions: 'You are a helpful weather assistant.',
  model: 'gpt-4o-mini',
  tools: { weatherTool },
  memory: createCodeBoltAgentMemory('weather_agent')
});

const result = await agent.execute('What is the weather in New York?');

✨ Key Features

  • Multiple Patterns: Choose between Composable, Builder, and Processor patterns
  • Type Safety: Full TypeScript support with Zod validation
  • Memory Management: Persistent conversation storage with CodeBolt integration
  • Tool System: Extensible tool framework with validation
  • Workflow Orchestration: Multi-step agent processes with conditional logic
  • Model Agnostic: Support for OpenAI, Anthropic, Ollama, and more
  • Stream Support: Real-time streaming responses

📦 Installation

npm install @codebolt/agent

📖 Documentation

📚 View Complete Documentation - Comprehensive guide with examples, API reference, and best practices

Quick Links

🎯 Architecture Patterns

Composable Pattern (Recommended)

Best for: Rapid prototyping, simple agents, beginners

import { ComposableAgent, createTool, createCodeBoltAgentMemory } from '@codebolt/agent/composable';

const agent = new ComposableAgent({
  name: 'My Agent',
  instructions: 'You are a helpful assistant.',
  model: 'gpt-4o-mini',
  tools: { myTool },
  memory: createCodeBoltAgentMemory('agent_id')
});

const result = await agent.execute('Help me with this task');

Builder Pattern

Best for: Complex workflows, fine-grained control

import { Agent, InitialPromptBuilder, LLMOutputHandler } from '@codebolt/agent/builder';

const promptBuilder = new InitialPromptBuilder(userMessage)
  .addSystemInstructions("You are a coding assistant")
  .addFile("./src/main.ts")
  .addTaskDetails("Fix compilation errors");

const prompt = await promptBuilder.build();
const agent = new Agent(tools, systemPrompt);
const result = await agent.runAgent(prompt);

Processor Pattern

Best for: Advanced customization, specialized requirements

import { BaseProcessor, AgentStep } from '@codebolt/agent/processor';

class CustomProcessor extends BaseProcessor {
  async process(messages: any[]): Promise<any> {
    return this.executeCustomFlow(messages);
  }
}

🛠️ Available Exports

Composable Pattern

import { 
  ComposableAgent, createTool, createWorkflow,
  Memory, createCodeBoltAgentMemory, MDocument 
} from '@codebolt/agent/composable';

Builder Pattern

import { 
  Agent, InitialPromptBuilder, LLMOutputHandler,
  SystemPrompt, TaskInstruction, UserMessage 
} from '@codebolt/agent/builder';

Processor Pattern

import { 
  BaseProcessor, AgentStep, BaseTool,
  ChatCompressionProcessor, LoopDetectionProcessor 
} from '@codebolt/agent/processor';

🏗️ Workflow System

Create complex multi-agent workflows:

const workflow = createWorkflow({
  name: 'Content Pipeline',
  steps: [
    createAgentStep({
      id: 'research', 
      agent: researchAgent,
      messageTemplate: 'Research: {{topic}}'
    }),
    createAgentStep({
      id: 'write',
      agent: writingAgent, 
      messageTemplate: 'Write article: {{researchData}}'
    })
  ]
});

const result = await workflow.execute({ topic: 'AI Ethics' });

🧠 Memory & Storage

Integrated with CodeBolt's storage system:

// Agent-scoped persistent storage
const agentMemory = createCodeBoltAgentMemory('my_agent');

// Project-scoped storage
const projectMemory = createCodeBoltProjectMemory('project_agent');

// Fast access memory database  
const dbMemory = createCodeBoltDbMemory('cache_agent');

🔧 Development

# Install dependencies
npm install

# Build the project
npm run build

# Development mode
npm run dev

# Run tests
npm run test

# Lint code
npm run lint

📋 Pattern Comparison

| Pattern | Complexity | Use Case | Learning Curve | |---------|------------|----------|----------------| | Composable | Low | Rapid prototyping, simple agents | Low | | Builder | Medium | Complex workflows, custom logic | Medium | | Processor | High | Advanced customization | High |

🤝 Contributing

See our Contributing Guide for development setup, coding standards, and submission guidelines.

📄 License

MIT - See the main CodeBolt repository for details.


📚 Complete Documentation | 🐛 Report Issues | 💬 Join Community