# krishnaikgaunekar/groupcart architecture

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

- Interactive diagram: https://gitdiagram.com/krishnaikgaunekar/groupcart
- Repository: https://github.com/krishnaikgaunekar/groupcart

## Overview

GroupCart turns a receipt photo and a list of diners into itemized individual amounts and payment options, using agents that coordinate through a shared room and ask each person what they ordered. The README documents iMessage/Spectrum, Gemini receipt reading, Nessie reimbursements, and a card vault as product capabilities. The split implementation is represented by the named modules in `app/split/`; relationships between those modules are based on the documented workflow, since their source was not excerpted. The README also describes `app/spectrum-bot/` as an earlier shopping-cart bot, so it is shown separately rather than as part of the current split flow.

Main entry points: [`app/split/session.py`](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/session.py) (Split session), [`app/split/flow.py`](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/flow.py) (Agent room), [`app/split/images.py`](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/images.py) (Receipt intake), [`app/split/signup.py`](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/signup.py) (Diner signup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_split["Bill splitting"]
  node_receipt["Receipt intake<br/>[images.py]"]
  node_signup["Diner signup<br/>[signup.py]"]
  node_room["Agent room<br/>[flow.py]"]
  node_session["Split session<br/>[session.py]"]
  node_shares["Share calculation<br/>[splitter.py]"]
  node_money["Money math<br/>[money.py]"]
  node_ledger[("Reimbursement ledger<br/>[ledger.py]")]
  node_notify["Text results<br/>[notify.py]"]
  node_hooks["Workflow hooks<br/>[hooks.py]"]
end

subgraph group_runtime["Agent runtime"]
  node_agentloop["Agent loop"]
end

subgraph group_integrations["External services"]
  node_bank["Bank integration<br/>[bank.py]"]
  node_payment["Payment tools<br/>[payments.ts]"]
  node_vault[("Card vault<br/>[vault_store.py]")]
  node_gemini["Gemini"]
  node_nessie["Capital One Nessie"]
  node_imessage["iMessage"]
end

subgraph group_legacy["Earlier bot"]
  node_spectrum["Spectrum bot<br/>[server.ts]"]
end

node_diner(("Diners"))

node_diner -->|"sends photo"| node_receipt
node_diner -->|"names diners"| node_signup
node_receipt -->|"reads receipt"| node_gemini
node_signup -->|"starts coordination"| node_room
node_room -->|"asks order"| node_diner
node_room -->|"coordinates split"| node_session
node_session -->|"computes shares"| node_shares
node_shares -->|"includes tax tip"| node_money
node_session -.->|"tracks reimbursements"| node_ledger
node_ledger -->|"uses accounts"| node_bank
node_bank -->|"handles reimbursements"| node_nessie
node_session -->|"sends amounts"| node_notify
node_notify -->|"texts payment details"| node_diner
node_diner -->|"texts agent"| node_imessage
node_agentloop -.->|"supports agents"| node_room
node_vault -->|"gates checkout"| node_payment
node_spectrum -->|"talks directly"| node_imessage

click node_receipt "https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/images.py"
click node_signup "https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/signup.py"
click node_room "https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/flow.py"
click node_session "https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/session.py"
click node_shares "https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/splitter.py"
click node_money "https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/money.py"
click node_ledger "https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/ledger.py"
click node_bank "https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/bank.py"
click node_payment "https://github.com/krishnaikgaunekar/groupcart/blob/main/app/spectrum-bot/src/tools/payments.ts"
click node_notify "https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/notify.py"
click node_hooks "https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/hooks.py"
click node_agentloop "https://github.com/krishnaikgaunekar/groupcart/blob/main/core/agent/conversation_loop.py"
click node_vault "https://github.com/krishnaikgaunekar/groupcart/blob/main/core/agent/vault_store.py"
click node_spectrum "https://github.com/krishnaikgaunekar/groupcart/blob/main/app/spectrum-bot/src/server.ts"

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_receipt,node_signup,node_room,node_session,node_shares,node_money,node_ledger,node_notify,node_hooks toneBlue
class node_agentloop toneAmber
class node_bank,node_payment,node_vault,node_gemini,node_nessie,node_imessage toneMint
class node_spectrum toneRose
class node_diner toneIndigo
```

## Components

### Bill splitting

- [Receipt intake](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/images.py): `app/split/images.py`
- [Diner signup](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/signup.py): `app/split/signup.py`
- [Agent room](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/flow.py): `app/split/flow.py`
- [Split session](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/session.py): `app/split/session.py`
- [Share calculation](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/splitter.py): `app/split/splitter.py`
- [Money math](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/money.py): `app/split/money.py`
- [Reimbursement ledger](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/ledger.py): `app/split/ledger.py`
- [Text results](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/notify.py): `app/split/notify.py`
- [Workflow hooks](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/hooks.py): `app/split/hooks.py`

### Agent runtime

- [Agent loop](https://github.com/krishnaikgaunekar/groupcart/blob/main/core/agent/conversation_loop.py): `core/agent/conversation_loop.py`

### External services

- [Bank integration](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/split/bank.py): `app/split/bank.py`
- [Payment tools](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/spectrum-bot/src/tools/payments.ts): `app/spectrum-bot/src/tools/payments.ts`
- [Card vault](https://github.com/krishnaikgaunekar/groupcart/blob/main/core/agent/vault_store.py): `core/agent/vault_store.py`
- **Gemini**
- **Capital One Nessie**
- **iMessage**

### Earlier bot

- [Spectrum bot](https://github.com/krishnaikgaunekar/groupcart/blob/main/app/spectrum-bot/src/server.ts): `app/spectrum-bot/src/server.ts`

### Other components

- **Diners**

## Connections

- Diners → Receipt intake: sends photo (evidence: `README.md`)
- Diners → Diner signup: names diners (evidence: `README.md`)
- Receipt intake → Gemini: reads receipt (evidence: `README.md`)
- Diner signup → Agent room: starts coordination (evidence: `README.md`)
- Agent room → Diners: asks order (evidence: `README.md`)
- Agent room → Split session: coordinates split (evidence: `README.md`)
- Split session → Share calculation: computes shares (evidence: `README.md`)
- Share calculation → Money math: includes tax tip (evidence: `README.md`)
- Split session → Reimbursement ledger: tracks reimbursements
- Reimbursement ledger → Bank integration: uses accounts (evidence: `README.md`)
- Bank integration → Capital One Nessie: handles reimbursements (evidence: `README.md`)
- Split session → Text results: sends amounts (evidence: `README.md`)
- Text results → Diners: texts payment details (evidence: `README.md`)
- Diners → iMessage: texts agent (evidence: `README.md`)
- Agent loop → Agent room: supports agents
- Card vault → Payment tools: gates checkout (evidence: `README.md`)
- Spectrum bot → iMessage: talks directly (evidence: `README.md`)
