Shopify River Brain-Hands Decoupling Architecture
Decoupling the brain from the hands: the harness calls the LLM and emits tool intents, while the sandbox executes them, so a new agent is a profile and not a platform.
Slack as interface, River as agent surface, Aquifer as foundation and a separate harness: the four layers behind an internal agent that treats a session as a durable entity.
Copy and paste the following FlowZap code into a project in your FlowZap account to see this template diagram.
slack { # Slack - Interface
n1: circle label:"@River in Slack"
n2: rectangle label:"Public channel question"
n11: rectangle label:"Response received"
n1.handle(right) -> n2.handle(left)
n2.handle(bottom) -> river.n3.handle(top) [label="1. Request"]
}
river { # River - Agent Surface
n3: rectangle label:"Analyzes request"
n4: rectangle label:"Delegates to Aquifer"
n10: rectangle label:"Formats response"
n3.handle(right) -> n4.handle(left)
n4.handle(bottom) -> aquifer.n5.handle(top) [label="2. Session"]
aquifer.n9.handle(top) -> n10.handle(bottom) [label="5. Result"]
n10.handle(top) -> slack.n11.handle(bottom) [label="6. Response"]
}
aquifer { # Aquifer - Foundation
n5: rectangle label:"Harness plans"
n6: rectangle label:"Sandbox executes"
n7: diamond label:"Done?"
n8: rectangle label:"Consolidates"
n9: rectangle label:"Returns result"
n5.handle(right) -> n6.handle(left)
n6.handle(bottom) -> world.n12.handle(top) [label="3. Read/write"]
n6.handle(right) -> n7.handle(left)
n7.handle(top) -> n5.handle(bottom) [label="No"]
n7.handle(bottom) -> n8.handle(top) [label="Yes"]
n8.handle(right) -> n9.handle(left)
}
world { # World - Monorepo
n12: rectangle label:"Executes on repo"
n13: rectangle label:"Runs tests - opens PR"
n12.handle(right) -> n13.handle(left)
n13.handle(top) -> aquifer.n7.handle(bottom) [label="4. Output"]
}
Install the MCP packagenpm install -g flowzap-mcpMCP documentation
Decoupling the brain from the hands: the harness calls the LLM and emits tool intents, while the sandbox executes them, so a new agent is a profile and not a platform.
Three session modes in one agent: interactive in Slack, automated review in the pull request, and ephemeral batch runs triggered by CI — cattle, not pets.
n8n as the central integration layer: one workflow decides whether an event is a product sync or an order, routes it to the right channel and closes the loop.
Coinbase AgentKit flow: a human allocates a USDC budget, the agent authenticates its Base wallet, pays an x402 invoice and processes the supplier data, with no fiat in the path.
Stripe Agent Toolkit flow: the consumer approves an agent spend, the agent requests a scoped token, passes it to the merchant and the order completes in fiat.
The trust layer behind agent-to-agent payments on Coinbase: the agent initiates the spend, the transaction is broadcast, the block confirms and the payment finalizes on-chain.