Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

1,655 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgentForge

Production-ready framework for building deep agents with LangGraph

GitHub Documentation TypeScript Tests Coverage License

AgentForge is a TypeScript framework that provides production-grade abstractions for building autonomous agents with LangGraph. It focuses on developer experience, type safety, and real-world production needs.

View Full Documentation | Quick Start Guide | Examples


Features

Complete & Production-Ready

Phase 1-2: Core Foundation

  • Rich Tool Registry - Metadata-driven tools with automatic prompt generation
  • LangChain Integration - Seamless conversion between AgentForge and LangChain tools
  • LangGraph State Management - Type-safe state utilities with Zod validation
  • Workflow Builders - Sequential, parallel, and conditional workflow patterns
  • Error Handling Patterns - Retry, error handling, and timeout utilities
  • Subgraph Composition - Reusable subgraph utilities
  • Memory & Persistence - Checkpointer and thread management utilities
  • Observability - LangSmith integration, metrics, logging, and error handling

Phase 3: Agent Patterns

  • ReAct Pattern - Reasoning and Action loop for exploratory tasks
  • Plan-Execute Pattern - Structured planning with parallel execution
  • Reflection Pattern - Iterative self-improvement through critique
  • Multi-Agent Pattern - Coordinate specialized agents with supervisor routing

Phase 4-5: Advanced Features

  • Middleware System - Composable middleware for caching, rate limiting, validation
  • Streaming & Real-time - Stream transformers, aggregators, SSE, WebSocket, progress tracking
  • Advanced Tools - Async execution, lifecycle management, composition, testing utilities
  • Resource Management - Connection pooling, memory management, batch processing, circuit breaker
  • Monitoring - Health checks, profiling, alerts, audit logging
  • Deployment - Docker, Kubernetes, CI/CD templates, multi-cloud guides

Phase 6: Developer Experience

  • CLI Tool - Project scaffolding, development, testing, deployment (156 tests, 98.11% coverage)
  • Testing Utilities - Mocks, assertions, fixtures for agent testing
  • Standard Tools - 81 production-ready tools across 5 categories
  • Type Safety - Full TypeScript support with Zod schemas
  • Comprehensive Tests - 2721 tests passing across all packages

Phase 7: Documentation

  • Complete Documentation - 34 pages, 10,000+ lines of guides, tutorials, and API docs
  • Pattern Guides - Detailed guides for all 4 agent patterns
  • Tutorials - 5 step-by-step tutorials from basics to advanced
  • Examples - 6 complete working examples
  • API Reference - Full API documentation for all 5 packages

Packages

All packages are published on npm and ready for production use!

Package Version Description npm
@agentforge/core 0.18.3 Core abstractions (tools, registry, LangGraph utilities, middleware, streaming, resources, monitoring) npm
@agentforge/patterns 0.18.3 Agent patterns (ReAct, Plan-Execute, Reflection, Multi-Agent) npm
@agentforge/tools 0.18.3 Standard tool library (81 production-ready tools) npm
@agentforge/skills 0.18.3 Agent Skills system (SKILL.md discovery, activation, trust policies) npm
@agentforge/testing 0.18.3 Testing utilities (mocks, assertions, fixtures) npm
@agentforge/cli 0.18.3 CLI tool (156 tests, 98.11% coverage) npm

Relational Tool Sets

@agentforge/tools exposes createRelationalToolSet() for PostgreSQL, MySQL, and SQLite. Configure credentials once in application code, pass its iterable credential-free Tool collection to an Agent or Tool Registry, use managed transactions and owned schema caching, and call dispose() at shutdown.

Existing credential-bearing Relational Tools remain deprecated compatibility exports throughout the current major release; removal is eligible only in the next major release. See the migration guide for prefixes, transaction timeouts, cache controls, and before/after examples.

Installation

# Install core package
npm install @agentforge/core

# Install agent patterns
npm install @agentforge/patterns

# Install standard tools
npm install @agentforge/tools

# Install testing utilities (dev dependency)
npm install -D @agentforge/testing

# Install CLI globally
npm install -g @agentforge/cli

Agent Patterns

AgentForge provides 4 production-ready agent patterns:

1. ReAct (Reasoning and Action)

Think → Act → Observe loop for exploratory tasks

import { createReActAgent } from '@agentforge/patterns';
import { ChatOpenAI } from '@langchain/openai';

const agent = createReActAgent({
  model: new ChatOpenAI({ model: 'gpt-4' }),
  tools: [searchTool, calculatorTool],
  maxIterations: 5
});

2. Plan-Execute

Structured planning with parallel execution

import { createPlanExecuteAgent } from '@agentforge/patterns';

const agent = createPlanExecuteAgent({
  planner: { llm, maxSteps: 5 },
  executor: { tools, parallel: true },
});

3. Reflection

Iterative self-improvement through critique

import { createReflectionAgent } from '@agentforge/patterns';

const agent = createReflectionAgent({
  generator: { llm },
  reflector: { llm },
  maxIterations: 3,
});

4. Multi-Agent

Coordinate specialized agents

import { createMultiAgentSystem } from '@agentforge/patterns';

const system = createMultiAgentSystem({
  supervisor: { model: llm, strategy: 'skill-based' },
  workers: [
    {
      id: 'tech_support',
      model: llm,
      capabilities: {
        skills: ['technical'],
        tools: [],
        available: true,
        currentWorkload: 0,
      },
    },
    {
      id: 'billing_support',
      model: llm,
      capabilities: {
        skills: ['billing'],
        tools: [],
        available: true,
        currentWorkload: 0,
      },
    },
  ],
  aggregator: { model: llm },
});

See the Pattern Comparison Guide to choose the right pattern.


Middleware System

AgentForge provides a powerful middleware system for adding cross-cutting concerns to your LangGraph nodes:

Built-in Middleware

  • Caching - TTL-based caching with LRU eviction
  • Rate Limiting - Token bucket, sliding window, and fixed window strategies
  • Validation - Zod schema validation for inputs and outputs
  • Concurrency Control - Semaphore-based concurrency limiting
  • Logging - Structured logging with customizable levels
  • Retry - Exponential backoff retry logic
  • Error Handling - Graceful error handling with fallbacks
  • Timeout - Execution timeouts for long-running operations
  • Metrics - Performance metrics collection
  • Tracing - Distributed tracing support

Quick Example

import { compose, withCache, withValidation, withRateLimit } from '@agentforge/core';
import { z } from 'zod';

const schema = z.object({ query: z.string() }).strict();

const enhancedNode = compose(
  withValidation({ inputSchema: schema }),
  withCache({ ttl: 3600000 }),
  withRateLimit({ maxRequests: 100, windowMs: 60000 }),
  myNode
);

Production Presets

import { production } from '@agentforge/core';

const productionNode = productionPreset(myNode, {
  cache: { ttl: 3600000 },
  rateLimit: { maxRequests: 100, windowMs: 60000 },
  retry: { maxAttempts: 3 },
});

See the Middleware Guide for comprehensive documentation.


Quick Start

# Install dependencies
pnpm install

# Build all packages
pnpm build

# Run tests
pnpm test

# Run tests with coverage
pnpm test:coverage

Documentation

User Documentation (GitHub Pages)

Developer Documentation (Repository)

For contributors and advanced users:

Examples & Templates

Production-ready templates for deploying your agents:

Real-world applications and integrations:

Pattern Examples

Feature Examples


Development

Prerequisites

  • Node.js >= 18.0.0
  • pnpm >= 8.0.0

Setup

# Clone the repository
git clone https://github.com/TVScoundrel/agentforge.git
cd agentforge

# Install dependencies
pnpm install

# Build packages
pnpm build

Available Scripts

pnpm build          # Build all packages
pnpm dev            # Watch mode for all packages
pnpm test           # Run tests
pnpm test:coverage  # Run tests with coverage
pnpm test:ui        # Run tests with UI
pnpm lint           # Lint all packages
pnpm lint:fix       # Lint and fix all packages
pnpm format         # Format all packages
pnpm typecheck      # Type check all packages
pnpm clean          # Clean all build artifacts

Current Status

AgentForge v0.18.3 - Published on npm and Production-Ready!

All 7 Phases Complete:

Phase 1: Tool Registry (113 tests)

  • Rich tool metadata, builder API, registry with events
  • LangChain integration, prompt generation
  • Status: Complete & Published

Phase 2: LangGraph Utilities (158 tests)

  • State management, workflow builders, error handling
  • Memory & persistence, observability & logging
  • Status: Complete & Published

Phase 3: Agent Patterns (129 tests)

  • ReAct, Plan-Execute, Reflection, Multi-Agent patterns
  • 16 working examples with comprehensive documentation
  • Status: Complete & Published

Phase 4: Middleware System (94 tests)

  • Composable middleware (caching, rate limiting, validation, concurrency)
  • Production, development, and testing presets
  • Status: Complete & Published

Phase 5: Production Features (163 tests)

  • 5.1: Streaming & Real-time (68 tests) - Stream transformers, SSE, WebSocket, progress tracking
  • 5.2: Advanced Tools - Async execution, lifecycle, composition, testing utilities
  • 5.3: Resource Management - Connection pooling, memory management, batch processing, circuit breaker
  • 5.4: Monitoring - Health checks, profiling, alerts, audit logging
  • 5.5: Deployment - Docker, Kubernetes, CI/CD, configuration management
  • 20 working examples demonstrating all features
  • Status: Complete & Published

Phase 6: Developer Experience

  • 6.1: CLI Tool - 156 tests (98.11% coverage), 13 commands, 4 templates
  • 6.2: Testing Utilities - Mocks, assertions, fixtures, test helpers
  • 6.3: Standard Tools - 74 production-ready tools (web, file, data, utility, agent)
  • 6.4: Documentation Site - 17 pages, comprehensive guides, API docs, tutorials
  • Status: Complete & Published

Phase 7: Documentation Completion (34 pages, 10,000+ lines)

  • 7.1: Core Concepts - 5 foundational guides
  • 7.2: Pattern Guides - 4 comprehensive pattern guides (2,011 lines)
  • 7.3: Advanced Topics - 4 advanced guides (3,474 lines)
  • 7.4: Additional Tutorials - 3 step-by-step tutorials
  • 7.5: Missing Examples - 2 complete working examples
  • 7.6: Documentation Review & Polish - Quality assurance, link validation, cross-references
  • Status: Complete & Published

Project Metrics

  • Total Tests: 2721 passing across all packages
  • Test Coverage: 98.11% (CLI package)
  • Documentation: 34 pages, 10,000+ lines
  • Examples: 30+ files, 2,500+ lines of real-world code
  • Tools: 74 production-ready tools
  • Patterns: 4 complete agent patterns
  • Packages: 5 published on npm

What You Can Build

  • Autonomous Agents - ReAct, Plan-Execute, Reflection, Multi-Agent patterns
  • Real-time Applications - Streaming with SSE/WebSocket
  • Production APIs - Express.js or Next.js integrations
  • Data Analysis Tools - Research and analytics agents
  • Customer Support - Multi-agent support systems
  • Code Review Tools - Reflection-based quality tools
  • Enterprise Deployments - Docker/Kubernetes ready

See ROADMAP.md for complete development history.


Security

Read the security policy before exposing AgentForge tools, skills, examples, or multi-agent workflows to model-controlled input.

The policy distinguishes privileged-by-design surfaces from framework guardrails that AgentForge is expected to enforce by default, and it explains how to classify example-only issues versus framework trust-boundary bugs.


Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Write tests
  5. Submit a pull request

Release Process

For maintainers releasing new versions:

  1. Automated Version Bump:

    ./scripts/release.sh 0.4.2

    This updates all package.json files, CLI templates, and documentation.

  2. Manual Steps (see the release skill):

    • Update docs-site/changelog.md with release notes
    • Run pnpm release:validate
    • Review changes with git diff
    • Commit: git add . && git commit -S -m "chore: Bump version to X.Y.Z"
    • Tag: git tag -a vX.Y.Z -m "Release vX.Y.Z"
    • Push: git push && git push --tags
  3. Publish to npm:

    ./scripts/publish.sh

    This publishes all packages in the correct dependency order.

Use the release skill for the complete process.


License

MIT © 2026 Tom Van Schoor


Acknowledgments

About

No description, website, or topics provided.

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages