LoomiFlow AI is an advanced, production-ready real-time autonomous commerce operations engine. It acts as a headless system intelligence that ingests signals, orchestrates complex decisions using governance councils, and triggers automated remediation workflows.
Designed for Bloomreach Loomi Connect Hackathon 2026 (Track 6: Cross-MCP Orchestration), LoomiFlow moves beyond passive "chat UI wrappers" by implementing a fully automated, state-aware multi-agent architecture.
- π― Core Value Proposition
- ποΈ V4 Multi-Agent Architecture
- β‘ V4 Key Features (Γvolutions A-G)
- π Demo Scenarios Walkthrough
- π Information Flow & Dependencies
- π Quick Start & Developer Guide
- βοΈ SRE & Observability Layer
- π Telemetry & Debugging Logs Guide
In high-throughput e-commerce, transaction latency and API costs make sequential LLM evaluation impractical. LoomiFlow AI solves this with a Hybrid Multi-Agent architecture:
- Dual-Speed Evaluation: Sub-millisecond rule-based local agent heuristics for standard traffic, combined with an asynchronous LLM-fallback Orchestrator for anomalous scenarios.
- Decoupled Read/Write Paths: Low-latency context enrichment via Loomi Connect MCP tools (Read-Only) paired with robust Bloomreach Engagement REST APIs (Write) for triggering scenarios.
- Governance-Centered Decisions: Individual agents do not decide alone; they vote within Councils whose proposals are arbitrated in an Opinion Market using economic utility.
LoomiFlow V4 structure organizes 9 specialized agents across 3 Governance Councils:
[ EVENT SIGNAL ]
(PayPal Webhook / System Anomaly)
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LAYER 1: Context Engine & Quality Scorer β
β - Ingests signal and executes pre-fetching queries via 5 MCP Tools β
β - Computes data completeness -> Context Quality Score (Grade A to F) β
βββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
βΌ (CommerceKnowledgeState)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LAYER 2: 9 Specialized Agents (TS Opinions with Reasoning + Confidence) β
β β
β π‘οΈ GUARDIANS: π GROWTH AGENTS: π§ SELF-LEARNING: β
β - Fraud Agent - Recovery Agent - Session Learning β
β - Revenue Agent - Retention Agent Agent β
β - CX Agent - Merchandising Agent β
β - Personal Shopper Agent β
β - Growth Experiment Agent β
βββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β (Member Opinions)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LAYER 3: 3 Governance Councils (Consensus Building & Weights) β
β β
β π¨ Risk Council π° Revenue Council π€ Customer Council β
β (Guardians + Veto) (Economic growth agents) (Client experience agents) β
βββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β (3 Council Proposals)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LAYER 4: Opinion Market & Coalition Detector β
β - Calculates utility scores for each Council based on budgets & ROI β
β - Detects Coalition Alignment: UNANIMOUS | MAJORITY | SPLIT | VETO β
βββββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββ
βΌ (Execution Plan) βΌ (Telemetry)
βββββββββββββββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββ
β LAYER 5: Write Actions & Execution β β SRE & Observability Layer β
β - Writes status back to Bloomreach REST APIs β β - Observability Envelope β
β - Triggers user journeys / marketing flows β β - Decision Memory Graph β
β - Logs to Session Ledger for feedback loop β β - Incident Reconstructor β
βββββββββββββββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββ
Note
Implementation State: The V4 engine is fully functional, simulated, and demo-ready. However, to maintain seamless backward compatibility with existing V3 components, the system currently executes V4 logic as an overlay on top of V3 data models (mapped via backward-compatible stubs). For the clean, native V4 migration path, please read the V4 Structural Migration Blueprint.
We have expanded the engine with 7 state-of-the-art features for the hackathon:
- Γvolution A β Commerce Narrative Engine: Automatically translates complex JSON traces and utility weights into natural language stories for business stakeholders.
- Γvolution B β Decision Confidence Heatmap: Visualizes the confidence trends of each Council over the last 20 decisions in a real-time matrix.
- Γvolution C β Agent Disagreement Detector: Flags critical business tensions when agents clash (e.g., high fraud risk vs. VIP customer retention), exposing the decision logic.
- Γvolution D β Predictive Scenario Simulator: Runs comparative simulations of alternative outcomes (what if we
ALLOW? what if weBLOCK?) with computed probabilities. - Γvolution E β Autonomous Commerce Pulse: Continuous real-time health index (0-100) reflecting fraud, operational, conversion, and customer metrics in session.
- Γvolution G β MCP Context Quality Score: Implements responsible AI by grading data completeness (Grades A-F) and dynamically downgrading confidence on degraded contexts.
- Coalition Detection: Automatically identifies governance alignment (
UNANIMOUSconsensus,MAJORITYagreement,SPLITdecisions, or absoluteVETOoverride) and displays color-coded badges in the cockpit.
We have created 6 interactive, detailed scenarios to test and showcase the pipeline in both technical and conceptual terms:
- π¨ Scenario 1: VIP Payment Failure β Demonstrates high-tension arbitration between Risk and Customer councils on a VIP client.
- π‘οΈ Scenario 2: High Risk Fraud β Shows the absolute Veto override mechanism blocking a brute-force transaction.
- π± Scenario 3: Mobile Conversion Drop β Illustrates state-aware SRE alerting and search ranking optimization.
- π Scenario 4: Cart Abandonment Recovery β Shows a standard, unanimous recovery campaign flow.
- π Scenario 5: Context Quality Degradation β Explains how the system safely degrades trust when APIs are failing.
- π§ Scenario 6: Adaptive Learning β Showcases session-based feedback loops adjusting anti-fraud thresholds dynamically.
- π«π· Lisez le README en FranΓ§ais
- CRITICAL_VERIFICATIONS_EN.md β Critical submission checklist & robustness verifications
- COUNCILS_GOVERNANCE_EN.md β Deep-dive into Councils, utility math, and consensus
- V4_STRUCTURAL_MIGRATION_EN.md β Blueprint for clean V3 to V4 native codebase migration
- ARCHITECTURE.md β Full ASCII diagrams + pipeline flows
- AGENTS_GUIDE.md β Agent deep-dive + decision matrix
- MCP_GUIDE.md β MCP tools + auth + write patterns
- MASTER_BUILD_GUIDE.md β Complete from-scratch build guide
- Sub-READMEs:
core/agents,core/sre,lib,server
LoomiFlow orchestrates data through structured pipelines. The following sequence diagram maps the exact lifecycle of a decision trace:
sequenceDiagram
participant P as PayPal / Webhook
participant CE as Context Engine
participant MCP as Loomi Connect MCP
participant A as 9 Agents
participant C as 3 Councils
participant OM as Opinion Market
participant BE as Bloomreach Engagement
participant LA as Learning Agent
P->>CE: Send webhook event (e.g., payment_failed)
activate CE
CE->>MCP: Query properties (LTV, Churn, Events)
MCP-->>CE: Return enriched context fields
CE->>CE: Score context completeness (Context Quality Score)
CE->>A: Build CommerceKnowledgeState & dispatch
deactivate CE
activate A
A->>C: Calculate opinions (Reasoning, Confidence, ROI)
deactivate A
activate C
C->>OM: Submit council proposals & member opinions
deactivate C
activate OM
OM->>OM: Calculate Utility Scores & detect Coalition Type
OM->>BE: Execute API Write actions (Trigger campaigns)
OM->>LA: Record decision in Session Ledger
OM-->>P: Return final DecisionTrace
deactivate OM
LA->>LA: Analyze session performance & adjust thresholds
- Node.js 18+
- NPM or Yarn
- A Bloomreach Engagement account (optional, fallback mocks are included)
- Clone the repository:
git clone <repo-url> loomiflow && cd loomiflow
- Install dependencies:
npm install
- Copy local environment configuration:
Edit
cp .env.example .env.local
.env.localto fill in your API tokens and credentials.
Start the Next.js development server:
npm run devOpen http://localhost:3000/cockpit to access the Interactive Control Center Cockpit.
We provide CLI scripts to validate the pipeline and view console telemetry:
npm run build: Standard production build check.npm run test:all: Executes the complete test suite.npx ts-node scripts/test-pipeline.ts: Directly runs a simulation trace in the terminal.
LoomiFlow cockpit comes equipped with enterprise-grade monitoring panels:
- Traffic Splitter: Adjust canary and shadow routing percentages (85% / 10% / 5%) with auto-rollback triggers.
- Memory Graph (Explainability): Click the "Why" button on any decision to see a visual directed graph linking raw MCP inputs to intermediate agent opinions and the final consensus.
- Incident Reconstructor: Analyzes error states and constructs a root-cause autopsy automatically.
- Replay Buffer: Fast-forward and play back past transactions like a video stream to debug decision timing.
- Discovery Defenses: If search/merchandising features are offline in the hackathon sandbox, the
Merchandising Agentgracefully yields (NO_CATALOG_DATA) instead of crashing the multi-agent consensus. - 403 API Trigger Mitigation: If writes encounter a
HTTP 403 "No limit for API Trigger module set"error, the write execution engine intercepts it and returns a mock success status logged as'write-back confirmed in sandbox testing'to ensure the demo dashboard remains operational and fully green. - Structured Terminal Telemetry: For deep troubleshooting or agent assistance, refer to our Logging & Debugging Guide detailing all console print prefixes and LLM-copy debug blueprints.
Built with β€οΈ by Team nΓΆL for the Bloomreach Loomi Connect AI Hackathon 2026. Sandbox: silent-ukulele.