# lorenzejay/convo-flow-example-jev architecture

> Architecture diagram of the GitHub repository lorenzejay/convo-flow-example-jev, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lorenzejay/convo-flow-example-jev
- Repository: https://github.com/lorenzejay/convo-flow-example-jev

## Overview

This small CrewAI example routes each customer turn through Jev, applies a confidence policy, and dispatches to a sample reply handler. The flow retains a shared conversation session and reports request measurements. Source confirms the live request and handler behavior; the README documents the routing lifecycle. Sample order and reply data live in scenario.json. No separate storage or production order/refund operations are shown.

Main entry points: [`flow.py`](https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py) (Turn router), [`scenario.json`](https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/scenario.json) (Sample scenario)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversation["Conversation"]
  node_support_flow["Support flow<br/>[flow.py]"]
  node_conversation_state["Session state<br/>[flow.py]"]
  node_scenario["Sample scenario<br/>[scenario.json]"]
  node_order_handler["Order handler<br/>[flow.py]"]
  node_returns_handler["Returns handler<br/>[flow.py]"]
  node_clarify_handler["Clarify handler<br/>[flow.py]"]
end

subgraph group_routing["Routing"]
  node_route_turn["Turn router<br/>[flow.py]"]
  node_decision["Route decision<br/>[flow.py]"]
end

subgraph group_integration["Integration"]
  node_jev{{"Jev API"}}
end

node_customer(("Customer"))

node_customer -->|"submits turns"| node_support_flow
node_support_flow -->|"routes turn"| node_route_turn
node_route_turn -->|"reads history"| node_conversation_state
node_route_turn -->|"calls"| node_decision
node_decision -->|"sends request"| node_jev
node_jev -->|"returns choice"| node_decision
node_decision -->|"reads order data"| node_scenario
node_route_turn -->|"stores decision"| node_conversation_state
node_route_turn -->|"dispatches order"| node_order_handler
node_route_turn -->|"dispatches returns"| node_returns_handler
node_route_turn -->|"dispatches clarify"| node_clarify_handler
node_order_handler -->|"reads reply"| node_scenario
node_returns_handler -->|"reads reply"| node_scenario
node_clarify_handler -->|"reads reply"| node_scenario
node_order_handler -->|"appends reply"| node_conversation_state
node_returns_handler -->|"appends reply"| node_conversation_state
node_clarify_handler -->|"appends reply"| node_conversation_state
node_order_handler -->|"returns reply"| node_customer
node_returns_handler -->|"returns reply"| node_customer
node_clarify_handler -->|"returns reply"| node_customer

click node_support_flow "https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py"
click node_conversation_state "https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py"
click node_scenario "https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/scenario.json"
click node_route_turn "https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py"
click node_decision "https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py"
click node_order_handler "https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py"
click node_returns_handler "https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py"
click node_clarify_handler "https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_support_flow,node_conversation_state,node_scenario,node_order_handler,node_returns_handler,node_clarify_handler toneBlue
class node_route_turn,node_decision toneAmber
class node_jev toneMint
class node_customer toneIndigo
```

## Components

### Conversation

- [Support flow](https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py): `flow.py`
- [Session state](https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py): `flow.py`
- [Sample scenario](https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/scenario.json): `scenario.json`
- [Order handler](https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py): `flow.py`
- [Returns handler](https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py): `flow.py`
- [Clarify handler](https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py): `flow.py`

### Routing

- [Turn router](https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py): `flow.py`
- [Route decision](https://github.com/lorenzejay/convo-flow-example-jev/blob/codex/jev-routing-example/flow.py): `flow.py`

### Integration

- **Jev API**

### Other components

- **Customer**

## Connections

- Customer → Support flow: submits turns
- Support flow → Turn router: routes turn
- Turn router → Session state: reads history
- Turn router → Route decision: calls
- Route decision → Jev API: sends request
- Jev API → Route decision: returns choice
- Route decision → Sample scenario: reads order data
- Turn router → Session state: stores decision
- Turn router → Order handler: dispatches order
- Turn router → Returns handler: dispatches returns
- Turn router → Clarify handler: dispatches clarify
- Order handler → Sample scenario: reads reply
- Returns handler → Sample scenario: reads reply
- Clarify handler → Sample scenario: reads reply
- Order handler → Session state: appends reply
- Returns handler → Session state: appends reply
- Clarify handler → Session state: appends reply
- Order handler → Customer: returns reply
- Returns handler → Customer: returns reply
- Clarify handler → Customer: returns reply
