Last Updated: December 20, 2025
Current Version: v1.2.0
Next Major Release: v2.0.0 ✅ Feature Complete!
Transform BackpackFlow from a code-only library into an observable, config-ready engine that solves the critical pain points in AI agent development:
- The "Black Box" Crisis → Solved by Telemetry (PRD-002)
- The "Junk Drawer" Problem → Solved by Backpack Architecture (PRD-001)
- The "No-Code Wall" → Solved by Serialization Bridge (PRD-003)
- The "Composition Problem" → Solved by Composite Nodes (PRD-004)
- The "Data Flow Mystery" → Solved by Complete Observability (PRD-005)
Target Release Date: December 21, 2025 (Q4 2025)
Release Status: ✅ All Core PRDs Complete (5/5 implemented, tested, verified)
Release Goal: Ship all foundational systems together as a cohesive update.
These three systems are deeply interconnected:
graph TD
A[PRD-001: Backpack] --> B[PRD-002: Telemetry]
A --> C[PRD-003: Serialization]
B --> C
A -->|Emits| D[BACKPACK_PACK events]
B -->|Observes| A
C -->|Serializes| A
C -->|Configures| B
style A fill:#ffcccc
style B fill:#ccffcc
style C fill:#ccccff
Dependency Order:
- Backpack is the foundation (state management)
- Telemetry observes Backpack mutations
- Serialization requires both to serialize state + event config
Integration Points:
- Backpack emits
BACKPACK_PACK/BACKPACK_UNPACKevents (Telemetry) - Backpack must be serializable via
toJSON()(Serialization) - EventStreamer must be configurable via JSON (Serialization)
Decision: Releasing separately would create a fragmented API. Users would need to migrate twice. Better to release as one coherent v2.0.
Priority: P0 (Foundation)
Status: ✅ Complete
Implemented: December 2025
Document: PRD-001-backpack-architecture.md
Eliminates "Context Pollution" where shared state becomes a junk drawer of stale/corrupted data.
- ✅
Backpackclass with.pack()/.unpack()API - ✅ Metadata tracking (source node, timestamp, version)
- ✅ Immutable commit history for time-travel debugging
- ✅ Scoped access control (nodes declare read/write permissions)
- ✅ Sanitization API to quarantine failed data
- State Sanitization Test: Failed tool results don't leak to downstream nodes
- Source Tracing Test: Can identify which node added incorrect data
- Time-Travel Test:
getSnapshot(timestamp)returns exact historical state - Performance: < 5ms overhead per node
4 weeks (1 engineer)
Priority: P0 (Foundation)
Status: ✅ Complete
Implemented: December 2025
Document: PRD-002-telemetry-system.md
Eliminates the "Black Box" debugging nightmare by automatically emitting lifecycle events.
- ✅
BackpackEventschema (strongly-typed envelope) - ✅ Lifecycle events:
NODE_START,PREP_COMPLETE,EXEC_COMPLETE,NODE_END,ERROR - ✅ Backpack events:
BACKPACK_PACK,BACKPACK_UNPACK - ✅
EventStreamerclass for subscribing to events - ✅
BackpackNodebase class that auto-emits events
- No-Code Logging Test: See all lifecycle events without writing
console.log - Debug Prompt Test: Inspect
PREP_COMPLETEto see exact LLM prompt - Parse Error Test: Inspect
EXEC_COMPLETEto see raw LLM response before parsing - Performance: < 2ms overhead per event
3 weeks (1 engineer)
Priority: P1 (Enabler)
Status: ✅ Complete
Implemented: December 2025
Document: PRD-003-serialization-bridge.md
Enables "Low-Code" workflows by making nodes instantiable from JSON configs.
- ✅
NodeConfigandFlowConfigschemas (Zod-validated) - ✅
DependencyContainerfor injecting non-serializable objects (LLM clients) - ✅
SerializableNodeinterface withtoConfig()/fromConfig() - ✅
FlowLoaderclass for loading flows from JSON - ✅ Serialization support for all built-in nodes
- No-Code Test: Load a 3-node flow from JSON and run it
- Round-Trip Test:
fromConfig(toConfig())produces identical node - Type Safety Test: Invalid configs throw Zod validation errors
- A/B Test: Swap configs dynamically without code changes
4 weeks (1 engineer)
Priority: P1 (Core Feature)
Status: ✅ Complete
Implemented: December 20, 2025
Document: PRD-004-composite-nodes.md
Standardizes composite nodes (agents with internal flows) and enables complete nested flow serialization.
- ✅
FlowActionenum for type-safe routing - ✅ Convenience methods (
.onComplete(),.onError(), etc.) - ✅
createInternalFlow()helper with auto-wiring (namespace, backpack, eventStreamer) - ✅ Recursive flow serialization with circular reference detection
- ✅ Query utilities (
flattenNodes(),findNode(),getMaxDepth(), etc.) - ✅ Immutable internal flows (create once, run many)
- Composition Test: Build YouTube Research Agent with 3-node internal flow
- Serialization Test: Nested flow serializes to JSON with
internalFlowproperty - Event Test: Events from nested flows include correct namespace paths
- Query Test:
findNode('agent.search')correctly locates nested node
3 weeks (1 engineer)
Priority: P1 (Core Feature)
Status: ✅ Complete
Implemented: December 2025
Document: PRD-005-complete-flow-observability.md
Eliminates "data flow mystery" by making all node inputs/outputs explicitly declared and validated.
- ✅ Zod-based data contracts (
static inputsandstatic outputs) - ✅ Runtime validation with detailed error messages
- ✅ Type inference (
z.infer<typeof Schema>) - ✅ JSON Schema export for UI generation
- ✅ Data mappings on edges for key remapping
- ✅ Enhanced
toConfig()with input/output contract serialization
- Contract Test: Invalid input data throws
ContractValidationError - Mapping Test: Edge with
{ chatResponse: 'userQuery' }correctly remaps keys - Type Test: TypeScript infers correct types from Zod schemas
- Serialization Test: Contracts serialize to JSON Schema
3 weeks (1 engineer)
Note: Timeline is flexible - complete phases at your own pace. Estimates removed since this is a solo project.
Goal: Build the Backpack core without breaking existing APIs.
Tasks:
- Create
Backpackclass insrc/storage/backpack.ts - Implement
.pack(),.unpack(),.unpackRequired()methods - Add metadata tracking (source, timestamp, version, namespace)
- Implement commit history (
_historyarray) - Add access control via permissions object
- Implement namespace wildcard matching
- Write unit tests for all Backpack methods
Parallel Work:
- Define event schemas in
src/types/events.ts(prep for Phase 2)
Milestone: Backpack class passes all unit tests, ready for integration.
Goal: Create BackpackNode that auto-emits events.
Tasks:
- Define all payload interfaces in
src/types/events.ts - Enhance
EventStreamerclass (already exists, needs v2.0 updates) - Create
BackpackNodebase class insrc/nodes/backpack-node.ts - Override
_run()to emit lifecycle events - Integrate Backpack events (
BACKPACK_PACK,BACKPACK_UNPACK) - Add wildcard pattern matching to EventStreamer
- Add event buffer for history
- Write integration tests (node + backpack + events)
Parallel Work:
- Start defining
NodeConfigschemas (prep for Phase 3)
Milestone: BackpackNode emits all lifecycle events correctly. Example console tracer works.
Goal: Make nodes loadable from JSON.
Tasks:
- Define
NodeConfig,FlowConfig,FlowEdgeTypeScript types - Create Zod schemas for validation
- Implement
DependencyContainerinsrc/config/dependencies.ts - Create
FlowLoaderinsrc/config/flow-loader.ts - Add
toConfig()/fromConfig()toBackpackNode - Implement serialization for built-in nodes:
-
ChatNode -
AgentNode -
DecisionNode -
ToolExecutionNode
-
- Create example JSON configs in
examples/configs/ - Write round-trip tests
Milestone: Can load and run a multi-node flow from JSON. Round-trip serialization works.
Goal: Migrate existing examples and document the new APIs.
Tasks:
- Update all tutorials to use
Backpackinstead ofSharedStorage - Update all examples to use
BackpackNode - Update migration guide with real examples
- Write comprehensive API docs
- Create video walkthrough: "Building with Backpack"
- Update README with new capabilities
Milestone: All examples run on v2.0 APIs. Documentation complete.
Goal: Production-ready release.
Tasks:
- End-to-end testing with real LLM flows
- Performance benchmarking
- Security audit (especially config validation)
- Fix all critical bugs
- Prepare release notes
Milestone: v2.0.0 release candidate ready.
- Web-Based Tracer UI (Visualize events in browser)
- Event Persistence (Save traces to database)
- Trace Replay (Rerun flows from event logs)
- Config Migrations (Auto-upgrade v1 → v2 configs)
- Conditional Edges (JSON Logic for complex routing)
- Config Hot-Reloading (Swap configs in running agents)
- Distributed Backpack (Cross-process state sharing)
- Agent-to-Agent Communication (Message passing)
- Hierarchical Flows (Supervisor/worker patterns)
| Dependency | Purpose | Status |
|---|---|---|
| PocketFlow | Base graph engine | ✅ Stable |
| Zod | Config validation | ✅ Available |
| OpenAI SDK | LLM provider | ✅ Available |
| MCP Protocol | Tool integration | ✅ Available |
| Blocker | Impacts | Resolution |
|---|---|---|
| Need to finalize Backpack API | All PRDs | Week 1 design review |
Unclear PocketFlow _run() signature |
PRD-002 | Week 2 code review |
| JSON schema versioning strategy | PRD-003 | Week 8 architecture decision |
- GitHub Stars: +500 (from current ~100)
- npm Downloads: 1,000/month (from current ~50/month)
- Community: 50+ Discord members
- Test Coverage: > 85%
- Performance: < 10ms total overhead (Backpack + Events)
- API Stability: Zero breaking changes in v2.x patch releases
- YouTube Channel: 100+ subscribers
- Tutorial Engagement: 500+ views on "Building with Backpack" video
- Community Projects: 3+ community-built nodes
Decision: Nodes define segments, Flows/Graphs compose full namespace paths.
Rationale:
- Reusability: Same node class works in different contexts (e.g.,
sales.summary,marketing.summary) - Loose Coupling: Node doesn't hardcode parent hierarchy
- Easy Refactoring: Change parent namespace, all children update automatically
- Config-Friendly: JSON configs can define dynamic hierarchies
- Industry Standard: Mirrors Kubernetes (Pod + Namespace), DNS (hostname + zone), Unix (filename + path)
Pattern:
// Node defines segment (like a filename)
class SummaryNode extends BackpackNode {
static namespaceSegment = "summary";
}
// Flow composes full path (like a directory)
const flow = new Flow({ namespace: "sales" });
flow.addNode(SummaryNode); // → "sales.summary"Impact:
- PRD-001: Add
sourceNamespacetoBackpackItemmetadata,namespaceSegmentto BackpackNode - PRD-002: Add
namespacefield toBackpackEvent, support wildcard subscription - PRD-003: Add
namespacefield toNodeConfigandFlowConfig - TECH-SPEC-001: Implement
composeNamespace()algorithm in Flow class
Implementation:
- Namespaces are optional (not required for basic usage)
- Format: Dot-separated paths (e.g.,
"sales.research.chat") - Wildcards: Single-level (
sales.*) in v2.0, deep matching (sales.**) in v2.1 - Composition:
${parentNamespace}.${nodeSegment}or usenodeIdif no segment defined
Decision: Provide both unpack() (returns undefined) and unpackRequired() (throws).
Rationale:
- Optional data (cache, preferences) → use
unpack(), check for undefined - Required data (user query, config) → use
unpackRequired(), fail fast - TypeScript enforces null-checking only where needed
Decision: Use Node.js EventEmitter as foundation, wrap for BackpackFlow features.
Rationale:
- Leverage battle-tested library: EventEmitter is performant, well-documented
- Add only what's needed: Wildcard matching, type safety, event history
- Minimal wrapper: ~100 lines vs. full pub/sub implementation
- Easy migration: Current v1.2.0
EventStreameralready extendsEventEmitter
Emission Strategy: Synchronous emission, async handler support (fire-and-forget).
- Events captured before node completes (critical for debugging)
- Async handlers (webhooks, DB writes) don't block flow
- Overhead: < 0.5ms for in-memory, network I/O happens in background
Decision: String-based conditions in v2.0, JSON Logic in v2.1.
Rationale:
- v2.0: Simple routing (e.g., "approve" → sales-node)
- v2.1: Complex logic (e.g., confidence > 0.7 AND vipCustomer)
- Progressive enhancement: don't over-engineer for v2.0
Q1: Should we support legacy SharedStorage in v2.0 or force migration?
Decision: ✅ Force migration. v2.0 = breaking changes allowed. Clean break, no backwards compatibility needed.
Q2: How do we handle breaking changes in PocketFlow upstream?
Proposal: Pin PocketFlow to specific version, document upgrade path.
Q3: Should Backpack access control be opt-in or mandatory?
Proposal: Opt-in for v2.0 (default = no restrictions), mandatory in v3.0.
Q4: Should namespace inheritance happen automatically in nested flows?
Decision: ✅ Yes, implemented via Graph-Assigned Namespaces (AD-001). Flows compose namespaces automatically using ${parentNamespace}.${nodeSegment} pattern. Supports nested flows/subgraphs out of the box.
See individual PRDs for detailed task lists. Key contribution areas:
- PRD-001: Implement Backpack core (TypeScript, no LLM knowledge needed)
- PRD-002: Build event streaming (Good for observability experts)
- PRD-003: Create node serializers (Good for first-time contributors)
Contact: [Your contact info / Discord link]
Related Documents:
- PRD-001: Backpack Architecture - ✅ Complete
- PRD-002: Telemetry System - ✅ Complete
- PRD-003: Serialization Bridge - ✅ Complete
- PRD-004: Composite Nodes & Nested Flows - ✅ Complete
- PRD-005: Complete Flow Observability - ✅ Complete
- PRD-006: Documentation & Developer Experience - 📋 Planned (v2.1)
- TECH-SPEC-001: Backpack Implementation
- DECISIONS-AUDIT-v2.0
- Migration Guide v1→v2
- V2.0 Completion Summary - ✅ All PRDs Complete!
- Original PRD (Deprecated - superseded by v2.0 PRDs)