# hocine-drioueche/randoneo-production architecture

> Architecture diagram of the GitHub repository hocine-drioueche/randoneo-production, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hocine-drioueche/randoneo-production
- Repository: https://github.com/hocine-drioueche/randoneo-production

## Overview

Randoneo is a French customer-support assistant for an outdoor-products retailer. A customer signs in to the Streamlit chat, asks about products, policies, or an order, and receives an agent response based on MCP tools; opening a support ticket pauses for human approval. The repository also documents layered safeguards and baseline-versus-hardened evaluation. The graph reflects the sampled runtime and README; unsampled evaluation inputs and deployment details are included only where documented, without inferring their internal wiring.

Main entry points: [`agent.py`](https://github.com/hocine-drioueche/randoneo-production/blob/main/agent.py) (Agent builder), [`randoneo_support.py`](https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py) (MCP server), [`app.py`](https://github.com/hocine-drioueche/randoneo-production/blob/main/app.py) (Chat and access), [`evaluate.py`](https://github.com/hocine-drioueche/randoneo-production/blob/main/evaluate.py) (Case evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Customer experience"]
  node_streamlit["Chat and access<br/>[app.py]"]
  node_session["Session identity<br/>[app.py]"]
  node_approval["Ticket approval<br/>[app.py]"]
end

subgraph group_agent["Agent runtime"]
  node_agent_builder["Agent builder<br/>[agent.py]"]
  node_agent_model["Reasoning model<br/>[agent.py]"]
end

subgraph group_support["Support capabilities"]
  node_mcp_server["MCP server"]
  node_catalog_search["Catalog search"]
  node_order_tracking["Order tracking"]
  node_knowledge_search["Knowledge search"]
  node_ticket_creation["Ticket creation"]
  node_product_sheet["Product sheet"]
  node_catalog_data["Product catalog<br/>[catalog.json]"]
  node_order_data["Order records<br/>[orders.json]"]
  node_corpus_data["Knowledge corpus"]
  node_knowledge_index[("Vector index")]
end

subgraph group_evaluation["Evaluation and safeguards"]
  node_evaluation_runner["Case evaluation<br/>[evaluate.py]"]
  node_attack_runner["Attack replay<br/>[attacks.py]"]
  node_evaluation_cases["Evaluation cases<br/>[cases.jsonl]"]
  node_baseline_results["Baseline results<br/>[baseline.json]"]
  node_hardened_results["Hardened results<br/>[hardened.json]"]
  node_attack_results["Attack results<br/>[attacks.json]"]
end

node_customer(("Customer"))
node_embedding_api["OpenAI embeddings"]
node_anthropic["Anthropic model"]

node_customer -->|"asks questions"| node_streamlit
node_streamlit -->|"builds runtime"| node_agent_builder
node_streamlit -->|"sets identity"| node_session
node_streamlit -->|"presents decision"| node_approval
node_streamlit -->|"streams turns"| node_agent_builder
node_approval -->|"resumes decision"| node_agent_builder
node_agent_builder -->|"discovers tools"| node_mcp_server
node_agent_builder -->|"creates agent"| node_agent_model
node_agent_model -->|"requests completions"| node_anthropic
node_agent_builder -->|"injects customer ID"| node_session
node_mcp_server -->|"registers tool"| node_catalog_search
node_mcp_server -->|"registers tool"| node_order_tracking
node_mcp_server -->|"registers tool"| node_knowledge_search
node_mcp_server -->|"registers tool"| node_ticket_creation
node_mcp_server -->|"registers resource"| node_product_sheet
node_catalog_search -->|"reads products"| node_catalog_data
node_product_sheet -->|"reads products"| node_catalog_data
node_order_tracking -->|"checks ownership"| node_order_data
node_ticket_creation -->|"checks ownership"| node_order_data
node_mcp_server -->|"loads documents"| node_corpus_data
node_mcp_server -->|"indexes corpus"| node_knowledge_index
node_knowledge_search -->|"queries documents"| node_knowledge_index
node_knowledge_index -->|"embeds documents"| node_embedding_api
node_agent_builder -->|"requires approval"| node_ticket_creation
node_evaluation_runner -->|"runs cases"| node_agent_builder
node_evaluation_runner -->|"loads cases"| node_evaluation_cases
node_evaluation_runner -.->|"writes summary"| node_baseline_results
node_evaluation_runner -.->|"writes summary"| node_hardened_results
node_attack_runner -->|"replays attacks"| node_agent_builder
node_attack_runner -->|"writes summary"| node_attack_results

click node_streamlit "https://github.com/hocine-drioueche/randoneo-production/blob/main/app.py"
click node_session "https://github.com/hocine-drioueche/randoneo-production/blob/main/app.py"
click node_approval "https://github.com/hocine-drioueche/randoneo-production/blob/main/app.py"
click node_agent_builder "https://github.com/hocine-drioueche/randoneo-production/blob/main/agent.py"
click node_agent_model "https://github.com/hocine-drioueche/randoneo-production/blob/main/agent.py"
click node_mcp_server "https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py"
click node_catalog_search "https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py"
click node_order_tracking "https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py"
click node_knowledge_search "https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py"
click node_ticket_creation "https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py"
click node_product_sheet "https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py"
click node_catalog_data "https://github.com/hocine-drioueche/randoneo-production/blob/main/data/catalog.json"
click node_order_data "https://github.com/hocine-drioueche/randoneo-production/blob/main/data/orders.json"
click node_corpus_data "https://github.com/hocine-drioueche/randoneo-production/blob/main/data/randoneo_corpus.json"
click node_knowledge_index "https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py"
click node_evaluation_runner "https://github.com/hocine-drioueche/randoneo-production/blob/main/evaluate.py"
click node_attack_runner "https://github.com/hocine-drioueche/randoneo-production/blob/main/attacks.py"
click node_evaluation_cases "https://github.com/hocine-drioueche/randoneo-production/blob/main/cases.jsonl"
click node_baseline_results "https://github.com/hocine-drioueche/randoneo-production/blob/main/baseline.json"
click node_hardened_results "https://github.com/hocine-drioueche/randoneo-production/blob/main/hardened.json"
click node_attack_results "https://github.com/hocine-drioueche/randoneo-production/blob/main/attacks.json"

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_streamlit,node_session,node_approval toneBlue
class node_agent_builder,node_agent_model toneAmber
class node_mcp_server,node_catalog_search,node_order_tracking,node_knowledge_search,node_ticket_creation,node_product_sheet,node_catalog_data,node_order_data,node_corpus_data,node_knowledge_index toneMint
class node_evaluation_runner,node_attack_runner,node_evaluation_cases,node_baseline_results,node_hardened_results,node_attack_results toneRose
class node_customer,node_embedding_api,node_anthropic toneIndigo
```

## Components

### Customer experience

- [Chat and access](https://github.com/hocine-drioueche/randoneo-production/blob/main/app.py): `app.py`
- [Session identity](https://github.com/hocine-drioueche/randoneo-production/blob/main/app.py): `app.py`
- [Ticket approval](https://github.com/hocine-drioueche/randoneo-production/blob/main/app.py): `app.py`

### Agent runtime

- [Agent builder](https://github.com/hocine-drioueche/randoneo-production/blob/main/agent.py): `agent.py`
- [Reasoning model](https://github.com/hocine-drioueche/randoneo-production/blob/main/agent.py): `agent.py`

### Support capabilities

- [MCP server](https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py): `randoneo_support.py`
- [Catalog search](https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py): `randoneo_support.py`
- [Order tracking](https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py): `randoneo_support.py`
- [Knowledge search](https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py): `randoneo_support.py`
- [Ticket creation](https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py): `randoneo_support.py`
- [Product sheet](https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py): `randoneo_support.py`
- [Product catalog](https://github.com/hocine-drioueche/randoneo-production/blob/main/data/catalog.json): `data/catalog.json`
- [Order records](https://github.com/hocine-drioueche/randoneo-production/blob/main/data/orders.json): `data/orders.json`
- [Knowledge corpus](https://github.com/hocine-drioueche/randoneo-production/blob/main/data/randoneo_corpus.json): `data/randoneo_corpus.json`
- [Vector index](https://github.com/hocine-drioueche/randoneo-production/blob/main/randoneo_support.py): `randoneo_support.py`

### Evaluation and safeguards

- [Case evaluation](https://github.com/hocine-drioueche/randoneo-production/blob/main/evaluate.py): `evaluate.py`
- [Attack replay](https://github.com/hocine-drioueche/randoneo-production/blob/main/attacks.py): `attacks.py`
- [Evaluation cases](https://github.com/hocine-drioueche/randoneo-production/blob/main/cases.jsonl): `cases.jsonl`
- [Baseline results](https://github.com/hocine-drioueche/randoneo-production/blob/main/baseline.json): `baseline.json`
- [Hardened results](https://github.com/hocine-drioueche/randoneo-production/blob/main/hardened.json): `hardened.json`
- [Attack results](https://github.com/hocine-drioueche/randoneo-production/blob/main/attacks.json): `attacks.json`

### Other components

- **Customer**
- **OpenAI embeddings**
- **Anthropic model**

## Connections

- Customer → Chat and access: asks questions (evidence: `README.md`)
- Chat and access → Agent builder: builds runtime (evidence: `app.py`)
- Chat and access → Session identity: sets identity (evidence: `app.py`)
- Chat and access → Ticket approval: presents decision (evidence: `app.py`)
- Chat and access → Agent builder: streams turns (evidence: `app.py`)
- Ticket approval → Agent builder: resumes decision (evidence: `app.py`)
- Agent builder → MCP server: discovers tools (evidence: `agent.py`)
- Agent builder → Reasoning model: creates agent (evidence: `agent.py`)
- Reasoning model → Anthropic model: requests completions (evidence: `agent.py`)
- Agent builder → Session identity: injects customer ID (evidence: `agent.py`)
- MCP server → Catalog search: registers tool (evidence: `randoneo_support.py`)
- MCP server → Order tracking: registers tool (evidence: `randoneo_support.py`)
- MCP server → Knowledge search: registers tool (evidence: `randoneo_support.py`)
- MCP server → Ticket creation: registers tool (evidence: `randoneo_support.py`)
- MCP server → Product sheet: registers resource (evidence: `randoneo_support.py`)
- Catalog search → Product catalog: reads products (evidence: `randoneo_support.py`)
- Product sheet → Product catalog: reads products (evidence: `randoneo_support.py`)
- Order tracking → Order records: checks ownership (evidence: `randoneo_support.py`)
- Ticket creation → Order records: checks ownership (evidence: `randoneo_support.py`)
- MCP server → Knowledge corpus: loads documents (evidence: `randoneo_support.py`)
- MCP server → Vector index: indexes corpus (evidence: `randoneo_support.py`)
- Knowledge search → Vector index: queries documents (evidence: `randoneo_support.py`)
- Vector index → OpenAI embeddings: embeds documents (evidence: `randoneo_support.py`)
- Agent builder → Ticket creation: requires approval (evidence: `agent.py`)
- Case evaluation → Agent builder: runs cases (evidence: `evaluate.py`)
- Case evaluation → Evaluation cases: loads cases (evidence: `evaluate.py`)
- Case evaluation → Baseline results: writes summary
- Case evaluation → Hardened results: writes summary
- Attack replay → Agent builder: replays attacks (evidence: `attacks.py`)
- Attack replay → Attack results: writes summary (evidence: `attacks.py`)
