# @agentforge/core

> Production-ready TypeScript agent framework built on LangGraph with orchestration, middleware, and typed abstractions.

Latest version **0.18.12** (published 2026-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @agentforge/core
pnpm add @agentforge/core
yarn add @agentforge/core
bun add @agentforge/core
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.18.12 |
| Published | 2026-10-08 |
| First published | 2026-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 592.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tom Van Schoor |
| Maintainers | tomvanschoor |
| Keywords | agent-framework, llm-framework, ai-framework, typescript, nodejs, langchain-typescript, langgraph-typescript, agent-orchestration, workflow-engine, ai-middleware, typed-agents, production-ai, agent-runtime |

## Links

- npm: https://www.npmjs.com/package/@agentforge/core
- Repository: https://github.com/TVScoundrel/agentforge
- Homepage: https://tvscoundrel.github.io/agentforge/
- Issues: https://github.com/TVScoundrel/agentforge/issues
- npm.io page: https://npm.io/package/@agentforge/core

## Dependencies (4)

- [zod](https://npm.io/package/zod.md) ^3.23.0
- [@langchain/core](https://npm.io/package/@langchain/core.md) ^1.1.17
- [zod-to-json-schema](https://npm.io/package/zod-to-json-schema.md) ^3.25.0
- [@langchain/langgraph](https://npm.io/package/@langchain/langgraph.md) ^1.1.2

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.18.12 (latest) — 2026-10-08
- 0.18.11 — 2026-10-07
- 0.18.10 — 2026-09-30
- 0.18.9 — 2026-09-29
- 0.18.8 — 2026-09-28
- 0.18.7 — 2026-09-24
- 0.18.6 — 2026-09-23
- 0.18.5 — 2026-09-20
- 0.18.4 — 2026-09-18
- 0.18.3 — 2026-09-16
- 0.18.2 — 2026-09-15
- 0.18.1 — 2026-09-14
- 0.18.0 — 2026-09-12
- 0.17.2 — 2026-09-08
- 0.17.1 — 2026-09-07
- … 170 more at https://npm.io/package/@agentforge/core/versions

## README

# @agentforge/core

> Core abstractions for AgentForge - production-ready framework for building deep agents with LangGraph

[![npm version](https://img.shields.io/npm/v/@agentforge/core)](https://www.npmjs.com/package/@agentforge/core)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue)](https://www.typescriptlang.org/)
[![License](https://img.shields.io/badge/license-MIT-green)](../../LICENSE)

## Status: Production Ready & Published

**All features complete** | **699 tests passing** | **Full TypeScript support** | **Comprehensive documentation**

## Features

### Tool System
- **Rich Metadata** - Categories, tags, examples, and detailed descriptions
- **Fluent Builder API** - Easy tool creation with `createTool()`
- **Tool Registry** - Centralized management with querying and events
- **LangChain Integration** - Seamless conversion to/from LangChain tools
- **Prompt Generation** - Automatic LLM-friendly prompt generation
- **113 tests** - Comprehensive test coverage

### LangGraph Utilities
- **State Management** - Type-safe state annotations with Zod validation
- **Workflow Builders** - Sequential, parallel, and conditional patterns
- **Error Handling** - Retry, error handling, and timeout utilities
- **Subgraph Composition** - Reusable subgraph utilities
- **Memory & Persistence** - Checkpointer and thread management
- **Observability** - LangSmith integration, metrics, logging, error reporting
- **158 tests** - Full coverage of all utilities

### � Middleware System
- **Composable Middleware** - Caching, rate limiting, validation, concurrency control
- **Production Presets** - Ready-to-use middleware stacks
- **Development Tools** - Logging, debugging, and testing middleware
- **94 tests** - Comprehensive middleware testing

### Streaming & Real-time
- **Stream Transformers** - Filter, map, batch, debounce, throttle
- **Stream Aggregators** - Collect, reduce, window operations
- **SSE Support** - Server-Sent Events for real-time updates
- **WebSocket Support** - Bidirectional streaming
- **Progress Tracking** - Monitor long-running operations
- **68 tests** - Full streaming coverage

### Advanced Tools
- **Async Execution** - Parallel and sequential tool execution
- **Lifecycle Management** - Setup, teardown, and cleanup hooks
- **Tool Composition** - Combine tools into pipelines
- **Testing Utilities** - Mock tools and test helpers

### Resource Management
- **Connection Pooling** - Efficient resource reuse
- **Memory Management** - Automatic cleanup and limits
- **Batch Processing** - Efficient bulk operations
- **Circuit Breaker** - Fault tolerance and resilience

### � Monitoring
- **Health Checks** - System and component health monitoring
- **Profiling** - Performance metrics and bottleneck detection
- **Alerts** - Configurable alerting system
- **Audit Logging** - Comprehensive activity tracking

### Deployment
- **Docker Support** - Production-ready containers
- **Kubernetes** - Deployment manifests and guides
- **CI/CD Templates** - GitHub Actions, GitLab CI
- **Configuration Management** - Environment-based config

## Installation

```bash
pnpm add @agentforge/core
```

## Quick Start

### Tool System

```typescript
import { createTool } from '@agentforge/core';
import { z } from 'zod';

const weatherTool = createTool({
  name: 'get_weather',
  description: 'Get current weather for a location',
  schema: z.object({
    location: z.string().describe('City name'),
    units: z.enum(['celsius', 'fahrenheit']).optional()
  }),
  execute: async ({ location, units = 'celsius' }) => {
    // Implementation
    return { temperature: 22, units, location };
  }
});
```

### LangGraph Workflow Builders

```typescript
import { createSequentialWorkflow, withRetry } from '@agentforge/core';
import { z } from 'zod';

// Create a sequential workflow
const workflow = createSequentialWorkflow(AgentState, [
  { name: 'fetch', node: fetchNode },
  { name: 'process', node: processNode },
  { name: 'save', node: saveNode },
]);

// Add error handling
const robustNode = withRetry(myNode, {
  maxAttempts: 3,
  backoff: 'exponential',
});

const app = workflow.compile();
```

## Documentation

- **[Full Documentation](https://tvscoundrel.github.io/agentforge/)**

### Core Guides
- [Getting Started](https://tvscoundrel.github.io/agentforge/guide/getting-started)
- [Core Concepts](https://tvscoundrel.github.io/agentforge/guide/concepts/tools)
- [API Reference](https://tvscoundrel.github.io/agentforge/api/core)

### Tutorials
- [Building Your First Agent](https://tvscoundrel.github.io/agentforge/tutorials/first-agent)
- [Creating Custom Tools](https://tvscoundrel.github.io/agentforge/tutorials/custom-tools)
- [Advanced Patterns](https://tvscoundrel.github.io/agentforge/tutorials/advanced-patterns)

## Examples

See the [examples documentation](https://tvscoundrel.github.io/agentforge/examples/react-agent) for complete working examples.

## Development

```bash
# Build
pnpm build

# Watch mode
pnpm dev

# Run tests
pnpm test

# Type check
pnpm typecheck
```

## Links

- [GitHub Repository](https://github.com/TVScoundrel/agentforge)
- [npm Package](https://www.npmjs.com/package/@agentforge/core)
- [Changelog](https://tvscoundrel.github.io/agentforge/changelog.html) - See what's new before upgrading
- [Report Issues](https://github.com/TVScoundrel/agentforge/issues)

## License

MIT © 2026 Tom Van Schoor

---
_Source: https://npm.io/package/@agentforge/core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
