Skip to content

TVScoundrel/agentforge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

832 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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 - 2185 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.16.13 Core abstractions (tools, registry, LangGraph utilities, middleware, streaming, resources, monitoring) npm
@agentforge/patterns 0.16.13 Agent patterns (ReAct, Plan-Execute, Reflection, Multi-Agent) npm
@agentforge/tools 0.16.13 Standard tool library (81 production-ready tools) npm
@agentforge/skills 0.16.13 Agent Skills system (SKILL.md discovery, activation, trust policies) npm
@agentforge/testing 0.16.13 Testing utilities (mocks, assertions, fixtures) npm
@agentforge/cli 0.16.13 CLI tool (156 tests, 98.11% coverage) npm

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, registerWorkers } from '@agentforge/patterns';

const system = createMultiAgentSystem({
  supervisor: { model: llm, strategy: 'skill-based' },
  workers: [],
  aggregator: { model: llm },
});

registerWorkers(system, [
  { name: 'tech_support', capabilities: ['technical'], tools: [...] },
  { name: 'billing_support', capabilities: ['billing'], tools: [...] },
]);

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.16.13 - 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: 2185 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.


🀝 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 release process guide):

    • Update docs-site/changelog.md with release notes
    • Run pnpm build and pnpm test
    • 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.

See .ai/RELEASE_PROCESS.md for the complete process.


πŸ“„ License

MIT Β© 2026 Tom Van Schoor


πŸ™ Acknowledgments

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages