All notable changes to BackpackFlow will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.0.0 - 2024-12-21
This is a major breaking release that transforms BackpackFlow from a simple flow orchestrator into a production-ready, fully observable, config-driven LLM framework with complete nested flow composition and type-safe data contracts.
- Git-like State Management - Complete history, time-travel debugging, and state snapshots
- Core Storage - Scoped key-value storage with automatic metadata tracking
- History & Time-Travel - Full audit trail with
getSnapshotAtCommit(),diff(), andreplay() - Access Control - Key-based and namespace-based permissions with wildcards
- Namespace Query API - Filter data by patterns (
sales.*,*.chat) - Graph-Assigned Namespaces - Automatic namespace composition for nodes in flows
- BackpackNode Base Class - New base class with helper methods and automatic metadata injection
- Flow Class - Orchestrates nodes with shared Backpack and namespace composition
- EventStreamer - Type-safe event emission with wildcard pattern matching
- Lifecycle Events -
NODE_START,PREP_COMPLETE,EXEC_COMPLETE,NODE_END,ERROR - Backpack Events -
BACKPACK_PACK,BACKPACK_UNPACKwith access control tracking - Event History - Circular buffer with configurable size
- Event Filtering - Query by type, namespace, node ID, or run ID
- Statistics API - Track total events, unique nodes, namespaces, and runs
- Observable Demo - Complete observability tutorial (
v2.0-observable-agent.ts)
- Config-Driven Nodes - Serialize/deserialize nodes to/from JSON
- FlowLoader - Load and export entire flows from JSON configurations
- DependencyContainer - Dependency injection for non-serializable objects
- Config Validation - Validate flow configs before loading
- Version Support - Config versioning for future migrations
- Example Nodes -
SimpleChatNodeandSimpleDecisionNodewith full serialization
createInternalFlow()- Standard method for creating internal flows with auto-wiring- Automatic Context Inheritance - namespace, backpack, and eventStreamer passed to internal flows
internalFlowProperty - Public getter for accessing internal flow (read-only)isComposite()Helper - Check if a node has an internal flow- FlowAction Enum - Type-safe routing actions (COMPLETE, ERROR, SUCCESS, FAILURE, RETRY, DEFAULT)
- Convenience Methods -
.onComplete(),.onError(),.onSuccess(),.onFailure(),.onRetry() - Recursive Serialization -
FlowLoaderautomatically serializes nested flow hierarchies - Recursive Deserialization -
FlowLoaderreconstructs complete nested flow structures - Circular Reference Detection - Prevents infinite loops during serialization
- Depth Control - Configurable max depth for nested flow serialization
- Query Utilities -
flattenNodes(),flattenEdges(),findNode(),getCompositeNodes(),getMaxDepth() - Immutable Flows - Internal flows cannot be modified after creation (design decision)
- Enhanced Node Serialization -
toConfig()now exports all params (no empty params in JSON) - Edge Extraction -
FlowLoader.extractEdges()captures complete flow graph structure - Zod Data Contracts - Nodes declare explicit input/output schemas with full TypeScript inference
- Runtime Validation - Automatic validation with
ContractValidationErrorand detailed error messages - Type Inference - Full TypeScript types inferred from Zod schemas
- Edge-Level Data Mappings - Remap keys between connected nodes (
{ output: 'input' }) - Mapping Conflict Detection - Prevents accidental data overwrites with clear error messages
- JSON Schema Export - Generate schemas for UI form builders
- Backward Compatibility Removed - Clean break from string-based type system to Zod-only
- BREAKING: Replaced
SharedStorewithBackpack- Complete new API - BREAKING: Nodes should now extend
BackpackNodeinstead ofBaseNodefor v2.0 features - BREAKING: Namespace structure changed to hierarchical composition
- BREAKING: Flow instantiation now requires
FlowConfig - Updated tutorials to demonstrate v2.0 features
- Reorganized documentation into versioned structure (
docs/v2.0/,docs/v2.1/)
- Added comprehensive PRDs for all 5 core systems (PRD-001 through PRD-005)
- Added PRD-006 for documentation strategy (Docusaurus)
- Added 8 Mermaid diagrams to README for visual clarity
- Added technical specifications and implementation guides
- Added decision audit trail (
DECISIONS-AUDIT-v2.0.md) - Added v2.0 completion summary with use cases
- Added CI/CD setup guide for npm publishing
- Reorganized tutorials into
v2.0/andarchive-v1.x/ - Created YouTube Research Agent tutorial demonstrating all v2.0 features
- Updated README with v2.0 Quick Start examples and modern architecture diagrams
- Added GitHub Actions workflow for automatic npm publishing
- Added CI workflow for testing on PRs and main branch
- Tests run on Node 18 and Node 20
- All tests must pass before publishing
- Total Tests: 270+ passing (PRD-001: 175, PRD-002: 28, PRD-003: 34, PRD-004: 15, PRD-005: 21)
- Code Coverage: ~6,000+ lines of production code
- Implementation Timeline: December 2024 (v2.0 core) + December 21, 2024 (PRD-004 & PRD-005)
- Documentation: 5 comprehensive PRDs + 8 visual diagrams + migration guides
- Breaking Changes: Yes (major version bump)
See docs/v2.0/migration/MIGRATION-v1-to-v2.md for detailed migration instructions.
Key Changes:
- Replace
SharedStorewithBackpack - Extend
BackpackNodeinstead ofBaseNode - Update node instantiation to use
Flow.addNode() - Update namespace definitions (use
namespaceSegmentstatic property) - Pass
EventStreamerfor observability (optional)
v2.0 enables powerful new use cases:
- 🐛 Debug Production Agents - Time-travel through execution history
- 📊 Build Observability Dashboards - Real-time event streaming
- 🎨 Visual Flow Editors - Config-driven node serialization
- 🧪 A/B Testing - Swap configs without code changes
- 🤖 Multi-Agent Systems - Namespace isolation and access control
1.3.0 - 2024-12-XX
- Decision node with turn limiting to prevent infinite loops
- Configuration API improvements
- Improved error handling in decision nodes
- Updated storage demo examples
1.2.1 - 2024-11-XX
- Clean configuration API separation
- Improved conversational agent examples
1.2.0 - 2024-11-XX
- Conversational sales agent tutorial
- Enhanced storage capabilities
1.1.0 - 2024-10-XX
- Initial PocketFlow integration
- Basic storage system
- Simple agent examples
1.0.0 - 2024-09-XX
- Initial release
- Core flow orchestration
- Basic node system
- OpenAI integration