Project Jack V7 is a stateful cognitive companion framework built entirely in n8n. This release focuses on architecture, context management, state handling, and workflow reliability under real-world conditions. It is designed as a foundation for building persistent, multi-layered agents, not a single-use chatbot.
System Overview
Project Jack treats conversation as part of a living system. Jack maintains persistent internal state across interactions, evolves over time, and operates through deterministic, inspectable mechanisms. Identity, behavior rules, and persona definitions are stored externally in data files, separating who Jack is from how Jack reasons.
Architectural Layers
Context Layers
Jack’s runtime input is assembled from structured context:
-
System Context
Contains absolute rules that cannot be overridden. Injected first and immutable. -
Authoritative Context
Holds canonical state and environmental data including mood, energy, time, weather, threads, and relationship metrics. Treated as factual input for internal consistency. -
Narrative Context
Read-only content that shapes tone and personality, stored in external persona JSONs. Swappable without modifying workflow logic. -
User Input
Latest messages, modality labels, making user input the lowest authority in the system.
Deterministic JSON merges enforce layering and ensure downstream nodes always execute, even if upstream data is missing or delayed.
Temporal Core
The temporal core produces a canonical snapshot of time and environment per session, including:
-
Absolute timestamp
-
Delta since last interaction
-
Local time for Jack and user
-
Phase of day (sleeping, morning, afternoon, night)
-
External weather and temperature (ephemeral-only context)
This data influences behavior in the current session but is not persisted in state stores.
Stateful Persistence
State is managed with strict principles:
-
Immutable logs store all interactions in append-only format.
-
Delta-based reducer calculates Jack’s canonical internal state including mood, energy, and availability.
-
State extraction is JSON-driven and resilient to malformed outputs.
-
Persistent storage uses MongoDB for threads and state deltas.
-
All state changes result from validated deltas; raw outputs are never stored directly.
This ensures resilience and prevents corruption of canonical state.
Workflow Mechanics
The workflow is organized into distinct execution phases:
-
Input Hub
Normalizes incoming requests and labels modality (text or audio). -
Context Assembly
System, authoritative, and narrative contexts are merged in controlled order. -
Core Processing Node
Executes reasoning logic using the assembled context. -
Output Sanitization
Cleans responses of structural artifacts, code fences, and metadata. -
State Parsing & Logging
Extracted state deltas are parsed and written to persistent storage. Threads are archived for canonical history. -
Relationship Metrics (Optional)
Evaluates engagement, trust, and other session-specific metrics.
Merge nodes are critical for deterministic execution and flow safety.
Persona Modularity
Identity, behavioral rules, and personality traits live in external JSON files. The workflow consumes these files as input. This allows:
-
Persona swaps without modifying workflow logic
-
Versioned, inspectable definitions of agent behavior
-
Consistent behavior across sessions and deployments
Deterministic Merges & Flow Safety
Multiple merge nodes are intentionally placed to:
-
Prevent downstream workflow failures
-
Guarantee consistent input shapes
-
Enforce execution order across multi-source context
This is structural flow control; redundancy is deliberate for operational reliability.
Deployment Notes
-
Requires n8n version compatible with Code nodes and webhooks
-
Uses MongoDB for state and thread persistence
-
Optional real-time integration via Matrix or other homeserver endpoints
-
Environment variables for TTS/STT integration are isolated and configurable
The workflow is designed for modularity, persistence, and extensibility. It is not a generic chatbot, and core reasoning logic is not exposed or distributed.
Summary
Project Jack V7 is a technical framework for persistent, layered cognitive agents. It provides a reliable architecture for multi-user, multi-modal interactions with deterministic context management, temporal coherence, and modular personas. This release focuses strictly on system mechanics and workflow reliability, making it suitable for experimentation, research, and deployment within controlled environments.
