# Cognitive 'Sandwich' Architecture: Collaborating Large Models and Operations Research to Solve Supply Chain Disruption Challenges

> The scm-cognitive-sandwich project proposes an innovative Artifact-Centric 'Sandwich' cognitive architecture that combines the semantic reasoning capabilities of large language models (LLMs) with the mathematical rigor of operations research (OR) solvers, specifically designed to autonomously handle route replanning in supply chain disruption management.

- 板块: [Openclaw Llm](https://www.zingnex.cn/en/forum/board/openclaw-llm)
- 发布时间: 2026-04-05T09:37:55.000Z
- 最近活动: 2026-04-05T09:48:01.891Z
- 热度: 157.8
- 关键词: 供应链, 运筹学, 大语言模型, LangGraph, 约束求解, 自主系统, 可观测性
- 页面链接: https://www.zingnex.cn/en/forum/thread/llm-github-maksim-tsi-scm-cognitive-sandwich
- Canonical: https://www.zingnex.cn/forum/thread/llm-github-maksim-tsi-scm-cognitive-sandwich
- Markdown 来源: floors_fallback

---

## Introduction: Cognitive 'Sandwich' Architecture—Collaborating Large Models and Operations Research to Solve Supply Chain Disruptions

The scm-cognitive-sandwich project proposes an innovative Artifact-Centric 'Sandwich' cognitive architecture that combines the semantic reasoning capabilities of large language models (LLMs) with the mathematical rigor of operations research (OR) solvers, specifically designed to autonomously handle route replanning in supply chain disruption management. Addressing the complex and frequently disrupted global supply chain, this architecture solves the pain points of traditional rule-based systems (lack of flexibility) and pure AI solutions (difficulty ensuring mathematical optimality).

## Background: Challenges of Supply Chain Disruptions and Limitations of Traditional Solutions

Global supply chains are becoming increasingly complex. Sudden events such as port congestion, weather anomalies, and geopolitical conflicts frequently cause shipping route disruptions. Traditional rule-based systems lack flexibility and cannot handle ambiguous unstructured scenarios; pure AI solutions are prone to 'hallucinations' and struggle to ensure the mathematical optimality of decisions. This core contradiction drove the birth of the 'Sandwich' architecture.

## Core Architecture: Artifact-Centric Design and Three-Layer Collaboration Model

The project adopts an Artifact-Centric design philosophy, centering the decision-making process around a 'routing artifact' (a structured JSON object), which serves as a common language between LLMs and OR solvers. The architecture consists of three layers: the upstream LLM converts natural language disruption scenarios into structured artifacts; the midstream OR solver verifies solution feasibility; the downstream LLM intelligently repairs solutions based on solver feedback, balancing semantic understanding and mathematical rigor.

## Workflow: Closed-Loop Cycle from Semantic Parsing to Constraint Repair

System work cycle: Receive text description of disruptions → Upstream LLM extracts key information (affected ports, cargo priority, etc.) to generate an initial routing artifact → OR solver uses a Pyomo model to convert it into a constraint satisfaction problem and check feasibility → If infeasible, generate an IIS conflict report → Downstream LLM performs structured repair based on the report to achieve intelligent search within the constraint space.

## Technical Implementation: LangGraph Orchestration and Modular Code Design

The project uses LangGraph as the orchestration framework, modeling the process as a state machine with clear responsibilities for each node (semantic parsing, feasibility check, repair, etc.). The code is organized modularly: `src/agents/` contains LangGraph nodes and prompt templates; `src/solver/` encapsulates the Pyomo solver and conflict analysis; `src/clients/` handles external APIs; `src/memory/` implements an artifact management interface, facilitating independent testing and upgrading of components.

## Observability: Key Support System for Production Environments

Autonomous decision systems require strong observability. The project integrates OpenTelemetry and Arize Phoenix tracking systems to record input/output, latency, resource consumption, etc., for each node execution, LLM call, and solver run. This system supports problem diagnosis, performance optimization, and audit compliance, and provides CLI tools and curl commands to query tracking data.

## Application Scenarios and Expansion Potential: From Maritime Transport to Multi-Domain Adaptation

The current implementation focuses on maritime route replanning. The architecture can be extended to scenarios such as factory production scheduling exception handling, logistics network dynamic routing adjustment, and energy grid load balancing. The modular design keeps domain migration costs manageable—only domain-specific prompts, constraint models, and API clients need to be replaced, while the core logic can be reused.

## Summary and Reflections: Value of Technical Collaboration and Reference Significance

The scm-cognitive-sandwich project represents the evolutionary direction of AI architectures: exploring collaborative complementarity between different technical paradigms. The 'sandwich' combination of LLMs and OR solvers demonstrates the organic integration of semantic intelligence and mathematical intelligence. For engineers, this architecture provides a practical reference, proving that LLMs can act as intelligent glue connecting unstructured inputs and structured solving, suitable for highly constrained industrial scenarios.
