# sap-samples/ai-enabled-integrations-codejam architecture

> Architecture diagram of the GitHub repository sap-samples/ai-enabled-integrations-codejam, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sap-samples/ai-enabled-integrations-codejam
- Repository: https://github.com/sap-samples/ai-enabled-integrations-codejam

## Overview

This repository is a hands-on CodeJam, not a single deployed application: its exercises guide participants through an AI-enabled customer-support integration. A customer submits a request on the Altura website; the event is processed in Integration Suite with an AI Core prompt, then sent to the customer-service system. The workflow also covers service-center lookup, exposing APIs through MCP, and using those tools from an agent/chat interface. The README documents several platform-level stages whose implementation is external or exercise-configured; paths below identify the closest supporting material. Sampled source confirms website event publishing, CAP service access, and agent MCP/event handling.

Main entry points: [`exercises/02-generate-iflow/README.md`](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/exercises/02-generate-iflow/README.md) (Integration flow), [`apps/altura-customer-service/srv/customer-requests-service.cds`](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-customer-service/srv/customer-requests-service.cds) (Customer service API), [`apps/customer-request-agent/app/agent_executor.py`](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/agent_executor.py) (Agent executor), [`apps/customer-request-agent/app/event_consumer.py`](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/event_consumer.py) (Event consumer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_intake["Request intake"]
  node_coffee_web["Support website<br/>[main.js]"]
  node_website_api["Request publisher<br/>[server.js]"]
  node_aem["Event mesh"]
end

subgraph group_processing["AI integration"]
  node_integration_suite["Integration flow<br/>[README.md]"]
  node_prompt["Prompt handling<br/>[README.md]"]
  node_ai_core["SAP AI Core"]
  node_script_opt["Flow scripts"]
end

subgraph group_domain["Support systems"]
  node_customer_service["Customer service API"]
  node_support_agent_api["Support agent API"]
  node_requests_db[("Request data<br/>[schema.cds]")]
  node_service_locator["Service locator"]
  node_locator_db[("Center data<br/>[schema.cds]")]
end

subgraph group_tools["MCP access"]
  node_customer_mcp["Customer API MCP<br/>[README.md]"]
  node_gateway["MCP Gateway<br/>[README.md]"]
  node_locator_mcp["Locator MCP<br/>[mcp_tools.py]"]
end

subgraph group_agent["Agent experience"]
  node_agent_ui["Chat interface<br/>[ui.py]"]
  node_agent_server["A2A agent server<br/>[main.py]"]
  node_agent_executor["Agent executor<br/>[agent_executor.py]"]
  node_agent_core["Request agent<br/>[agent.py]"]
  node_event_consumer["Event consumer<br/>[event_consumer.py]"]
end

node_customer(("Customer"))
node_agent_user(("Agent user"))

node_customer -->|"submits request"| node_coffee_web
node_coffee_web -->|"posts request"| node_website_api
node_website_api -->|"publishes event"| node_aem
node_aem -->|"delivers event"| node_integration_suite
node_integration_suite -->|"prepares prompt"| node_prompt
node_prompt -->|"invokes model"| node_ai_core
node_integration_suite -->|"uses scripts"| node_script_opt
node_integration_suite -->|"sends request"| node_customer_service
node_integration_suite -->|"looks up center"| node_service_locator
node_customer_service -->|"reads and writes"| node_requests_db
node_service_locator -->|"reads centers"| node_locator_db
node_customer_service -->|"exposes operations"| node_support_agent_api
node_customer_service -->|"exposes API"| node_customer_mcp
node_gateway -->|"exposes API"| node_service_locator
node_agent_user -->|"asks question"| node_agent_ui
node_agent_ui -->|"sends chat"| node_agent_server
node_agent_server -->|"dispatches task"| node_agent_executor
node_agent_executor -->|"runs agent"| node_agent_core
node_agent_executor -->|"loads and calls tools"| node_customer_mcp
node_agent_executor -->|"loads and calls tools"| node_locator_mcp
node_agent_server -.->|"starts optionally"| node_event_consumer
node_aem -.->|"delivers request events"| node_event_consumer
node_event_consumer -.->|"invokes agent"| node_agent_core
node_event_consumer -.->|"publishes reply"| node_aem

click node_coffee_web "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-coffee-website/src/main.js"
click node_website_api "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-coffee-website/server.js"
click node_integration_suite "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/exercises/02-generate-iflow/README.md"
click node_prompt "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/exercises/01-sap-ai-core-prompt-template/README.md"
click node_script_opt "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/files/PrepareLLMRequest.groovy"
click node_customer_service "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-customer-service/srv/customer-requests-service.cds"
click node_support_agent_api "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-customer-service/srv/support-agent-service.cds"
click node_requests_db "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-customer-service/db/schema.cds"
click node_service_locator "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-service-locator/assets/service-locator-cap/srv/service-locator-service.cds"
click node_locator_db "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-service-locator/assets/service-locator-cap/db/schema.cds"
click node_customer_mcp "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/exercises/04-customer-service-api-mcp-server/README.md"
click node_gateway "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/exercises/05-expose-api-mcp-gateway/README.md"
click node_locator_mcp "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/mcp_tools.py"
click node_agent_ui "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/ui.py"
click node_agent_server "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/main.py"
click node_agent_executor "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/agent_executor.py"
click node_agent_core "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/agent.py"
click node_event_consumer "https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/event_consumer.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_coffee_web,node_website_api,node_aem,node_agent_user toneBlue
class node_integration_suite,node_prompt,node_ai_core,node_script_opt toneAmber
class node_customer_service,node_support_agent_api,node_requests_db,node_service_locator,node_locator_db toneMint
class node_customer_mcp,node_gateway,node_locator_mcp toneRose
class node_agent_ui,node_agent_server,node_agent_executor,node_agent_core,node_event_consumer,node_customer toneIndigo
```

## Components

### Request intake

- [Support website](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-coffee-website/src/main.js): `apps/altura-coffee-website/src/main.js`
- [Request publisher](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-coffee-website/server.js): `apps/altura-coffee-website/server.js`
- **Event mesh**

### AI integration

- [Integration flow](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/exercises/02-generate-iflow/README.md): `exercises/02-generate-iflow/README.md`
- [Prompt handling](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/exercises/01-sap-ai-core-prompt-template/README.md): `exercises/01-sap-ai-core-prompt-template/README.md`
- **SAP AI Core**
- [Flow scripts](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/files/PrepareLLMRequest.groovy): `files/PrepareLLMRequest.groovy`

### Support systems

- [Customer service API](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-customer-service/srv/customer-requests-service.cds): `apps/altura-customer-service/srv/customer-requests-service.cds`
- [Support agent API](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-customer-service/srv/support-agent-service.cds): `apps/altura-customer-service/srv/support-agent-service.cds`
- [Request data](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-customer-service/db/schema.cds): `apps/altura-customer-service/db/schema.cds`
- [Service locator](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-service-locator/assets/service-locator-cap/srv/service-locator-service.cds): `apps/altura-service-locator/assets/service-locator-cap/srv/service-locator-service.cds`
- [Center data](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/altura-service-locator/assets/service-locator-cap/db/schema.cds): `apps/altura-service-locator/assets/service-locator-cap/db/schema.cds`

### MCP access

- [Customer API MCP](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/exercises/04-customer-service-api-mcp-server/README.md): `exercises/04-customer-service-api-mcp-server/README.md`
- [MCP Gateway](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/exercises/05-expose-api-mcp-gateway/README.md): `exercises/05-expose-api-mcp-gateway/README.md`
- [Locator MCP](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/mcp_tools.py): `apps/customer-request-agent/app/mcp_tools.py`

### Agent experience

- [Chat interface](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/ui.py): `apps/customer-request-agent/app/ui.py`
- [A2A agent server](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/main.py): `apps/customer-request-agent/app/main.py`
- [Agent executor](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/agent_executor.py): `apps/customer-request-agent/app/agent_executor.py`
- [Request agent](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/agent.py): `apps/customer-request-agent/app/agent.py`
- [Event consumer](https://github.com/sap-samples/ai-enabled-integrations-codejam/blob/main/apps/customer-request-agent/app/event_consumer.py): `apps/customer-request-agent/app/event_consumer.py`

### Other components

- **Customer**
- **Agent user**

## Connections

- Customer → Support website: submits request
- Support website → Request publisher: posts request
- Request publisher → Event mesh: publishes event
- Event mesh → Integration flow: delivers event
- Integration flow → Prompt handling: prepares prompt
- Prompt handling → SAP AI Core: invokes model
- Integration flow → Flow scripts: uses scripts
- Integration flow → Customer service API: sends request
- Integration flow → Service locator: looks up center
- Customer service API → Request data: reads and writes
- Service locator → Center data: reads centers
- Customer service API → Support agent API: exposes operations
- Customer service API → Customer API MCP: exposes API
- MCP Gateway → Service locator: exposes API
- Agent user → Chat interface: asks question
- Chat interface → A2A agent server: sends chat
- A2A agent server → Agent executor: dispatches task
- Agent executor → Request agent: runs agent
- Agent executor → Customer API MCP: loads and calls tools
- Agent executor → Locator MCP: loads and calls tools
- A2A agent server → Event consumer: starts optionally
- Event mesh → Event consumer: delivers request events
- Event consumer → Request agent: invokes agent
- Event consumer → Event mesh: publishes reply
