@agentforge/patterns 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +72 -45
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,74 +1,91 @@
1
1
  # @agentforge/patterns
2
2
 
3
- Agent patterns (ReAct, Plan-Execute, Reflection, Multi-Agent) for the AgentForge framework.
3
+ > Production-ready agent patterns for the AgentForge framework
4
4
 
5
- ## Status
5
+ [![npm version](https://img.shields.io/npm/v/@agentforge/patterns)](https://www.npmjs.com/package/@agentforge/patterns)
6
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue)](https://www.typescriptlang.org/)
7
+ [![License](https://img.shields.io/badge/license-MIT-green)](../../LICENSE)
6
8
 
7
- **Phase 3 Complete** - All Core Patterns Implemented
9
+ ## 🎉 Status: Production Ready & Published
8
10
 
9
- **100+ tests passing** | **Full TypeScript support** | **Comprehensive documentation**
11
+ **All 4 patterns complete** | **143 tests passing** | **Full TypeScript support** | **Comprehensive documentation**
10
12
 
11
- ## Features
13
+ ## 🤖 Agent Patterns
12
14
 
13
- ### ✅ ReAct Pattern (Phase 3.1)
15
+ ### ✅ ReAct Pattern (Reasoning and Action)
14
16
 
15
- The ReAct (Reasoning and Action) pattern implements a thought-action-observation loop where the agent:
16
- 1. **Thinks** about what to do next
17
- 2. **Acts** by calling a tool or responding
18
- 3. **Observes** the result
19
- 4. **Repeats** until the task is complete
17
+ The ReAct pattern implements a thought-action-observation loop for exploratory tasks:
20
18
 
21
- **Components**:
22
- - **State Management** - Type-safe state with Zod schemas (10 tests)
23
- - **Node Implementations** - Reasoning, action, and observation nodes (9 tests)
24
- - **Agent Factory** - `createReActAgent()` function (10 tests)
25
- - **Fluent Builder** - `ReActAgentBuilder` with method chaining (19 tests)
26
- - **Integration Tests** - End-to-end scenarios (7 tests)
19
+ 1. **Think** - Reason about what to do next
20
+ 2. **Act** - Execute a tool or provide final answer
21
+ 3. **Observe** - Process the result
22
+ 4. **Repeat** - Continue until task complete
27
23
 
28
- ### Plan-Execute Pattern (Phase 3.2)
24
+ **Best for**: Research, exploration, problem-solving, multi-step reasoning
29
25
 
30
- The Plan-Execute pattern separates planning from execution for better performance on complex tasks:
31
- 1. **Plan** - Create a structured, multi-step plan
32
- 2. **Execute** - Execute each step of the plan
33
- 3. **Replan** (optional) - Adjust the plan based on results
34
- 4. **Finish** - Synthesize results into final response
26
+ **Features**:
27
+ - Type-safe state with Zod schemas
28
+ - Fluent builder API (`ReActAgentBuilder`)
29
+ - Configurable max iterations and timeouts
30
+ - Comprehensive error handling
31
+ - **55 tests** - Full coverage
32
+
33
+ ### ✅ Plan-Execute Pattern
34
+
35
+ The Plan-Execute pattern separates planning from execution for complex, structured tasks:
36
+
37
+ 1. **Plan** - Create a multi-step plan
38
+ 2. **Execute** - Execute each step (sequential or parallel)
39
+ 3. **Replan** (optional) - Adjust based on results
40
+ 4. **Finish** - Synthesize final response
41
+
42
+ **Best for**: Complex workflows, data analysis, structured problem-solving
35
43
 
36
44
  **Features**:
37
- - **Structured Planning** - Multi-step plan generation
38
- - **Sequential & Parallel Execution** - Execute steps in order or parallel
39
- - **Dependency Management** - Handle step dependencies
40
- - **Adaptive Replanning** - Adjust plan based on results
41
- - **Progress Tracking** - Monitor execution progress
45
+ - Structured multi-step planning
46
+ - Sequential & parallel execution
47
+ - Dependency management
48
+ - Adaptive replanning
49
+ - Progress tracking
50
+ - **35+ tests** - Comprehensive coverage
51
+
52
+ ### ✅ Reflection Pattern
42
53
 
43
- ### Reflection Pattern (Phase 3.3)
54
+ The Reflection pattern implements iterative self-improvement through critique and revision:
44
55
 
45
- The Reflection pattern implements iterative self-improvement through generation, critique, and revision:
46
56
  1. **Generate** - Create initial response
47
- 2. **Reflect** - Critique the response
57
+ 2. **Reflect** - Critique the output
48
58
  3. **Revise** - Improve based on critique
49
59
  4. **Repeat** - Continue until quality threshold met
50
60
 
61
+ **Best for**: Content generation, code review, quality optimization
62
+
51
63
  **Features**:
52
- - **Iterative Improvement** - Multiple revision cycles
53
- - **Self-Critique** - Agent evaluates its own output
54
- - **Quality Focus** - Optimizes for output quality
55
- - **Flexible Criteria** - Custom reflection criteria
56
- - **Configurable Iterations** - Control refinement depth
64
+ - Iterative improvement cycles
65
+ - Self-critique capabilities
66
+ - Quality-focused optimization
67
+ - Flexible reflection criteria
68
+ - Configurable iteration limits
69
+ - **30+ tests** - Full coverage
57
70
 
58
- ### ✅ Multi-Agent Pattern (Phase 3.4)
71
+ ### ✅ Multi-Agent Pattern
59
72
 
60
73
  The Multi-Agent pattern coordinates multiple specialized agents for complex tasks:
61
- 1. **Supervisor** - Routes tasks to appropriate workers
74
+
75
+ 1. **Supervisor** - Routes tasks to workers
62
76
  2. **Workers** - Execute specialized tasks
63
- 3. **Aggregator** - Combines results from workers
77
+ 3. **Aggregator** - Combines results
64
78
  4. **Routing** - Intelligent task distribution
65
79
 
80
+ **Best for**: Customer support, complex workflows, specialized task distribution
81
+
66
82
  **Features**:
67
- - **Specialized Agents** - Workers with distinct capabilities
68
- - **Flexible Routing** - LLM-based, skill-based, rule-based, round-robin, load-balanced
69
- - **Parallel Execution** - Workers can run concurrently
70
- - **Result Aggregation** - Combine outputs intelligently
71
- - **Scalable Coordination** - Add workers dynamically
83
+ - Specialized worker agents
84
+ - Flexible routing strategies (LLM-based, skill-based, rule-based, round-robin, load-balanced)
85
+ - Parallel execution support
86
+ - Intelligent result aggregation
87
+ - Dynamic worker registration
88
+ - **22+ tests** - Comprehensive coverage
72
89
 
73
90
  ## Installation
74
91
 
@@ -462,7 +479,17 @@ import {
462
479
  | **Reflection** | Quality-critical outputs | Iterative improvement | Slow, expensive |
463
480
  | **Multi-Agent** | Specialized tasks | Coordinated expertise | High complexity |
464
481
 
465
- See the [Pattern Comparison Guide](./docs/pattern-comparison.md) for detailed guidance.
482
+ 📚 **[Pattern Comparison Guide](https://tvscoundrel.github.io/agentforge/guide/patterns/comparison)** - Detailed guidance on choosing the right pattern
483
+
484
+ ## Documentation
485
+
486
+ - 📖 **[Full Documentation](https://tvscoundrel.github.io/agentforge/)**
487
+ - 🚀 **[Quick Start](https://tvscoundrel.github.io/agentforge/guide/quick-start)**
488
+ - 🤖 **[ReAct Pattern Guide](https://tvscoundrel.github.io/agentforge/guide/patterns/react)**
489
+ - 📋 **[Plan-Execute Pattern Guide](https://tvscoundrel.github.io/agentforge/guide/patterns/plan-execute)**
490
+ - 🔄 **[Reflection Pattern Guide](https://tvscoundrel.github.io/agentforge/guide/patterns/reflection)**
491
+ - 👥 **[Multi-Agent Pattern Guide](https://tvscoundrel.github.io/agentforge/guide/patterns/multi-agent)**
492
+ - 💡 **[Examples](https://tvscoundrel.github.io/agentforge/examples/react-agent)**
466
493
 
467
494
  ## Development
468
495
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge/patterns",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Agent patterns (ReAct, Planner-Executor) for AgentForge framework",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -39,7 +39,7 @@
39
39
  "@langchain/core": "^0.3.29",
40
40
  "@langchain/langgraph": "^0.2.20",
41
41
  "zod": "^3.23.8",
42
- "@agentforge/core": "0.1.0"
42
+ "@agentforge/core": "0.1.2"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@eslint/js": "^9.17.0",