# sarveshdujari/trippy---travel-companion architecture

> Architecture diagram of the GitHub repository sarveshdujari/trippy---travel-companion, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sarveshdujari/trippy---travel-companion
- Repository: https://github.com/sarveshdujari/trippy---travel-companion

## Overview

Trippy is a family travel assistant: messages arrive through Telegram and Switch, the Coordinator routes conversations and tool requests, and validated replies or exact reservation proposals return to the family. Its broader product includes contextual trip utilities, family identity and preferences, sourced comparisons, image-assisted itinerary import, optional specialists, an operator dashboard, and durable recovery. Edges follow README statements or the supplied source excerpts and index; unsampled implementations are represented only where documented, with uncertain links omitted.

Main entry points: [`src/trip_coordinator/service.py`](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/service.py) (Coordinator), [`src/trip_coordinator/specialists.py`](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/specialists.py) (Specialist handoffs), [`src/trip_coordinator/travel_tools.py`](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/travel_tools.py) (Travel tool clients), [`src/trip_coordinator/runtime.py`](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/runtime.py) (Worker runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversation["Conversation runtime"]
  node_coordinator["Coordinator<br/>[service.py]"]
  node_runtime["Worker runtime<br/>[runtime.py]"]
  node_discussion["Conversation workflow<br/>[discussion.py]"]
  node_contracts["Typed contracts<br/>[contracts.py]"]
  node_specialists["Specialist handoffs<br/>[specialists.py]"]
end

subgraph group_trust["Trust and decisions"]
  node_privacy["Privacy policy<br/>[privacy.py]"]
  node_memory["Evidence memory<br/>[memory.py]"]
  node_familydata["Family directory<br/>[family.py]"]
  node_approvals["Scoped approvals<br/>[approvals.py]"]
  node_verifier["Claim verification<br/>[verifier.py]"]
  node_grounding["Grounded citations<br/>[grounding.py]"]
end

subgraph group_travel["Travel assistance"]
  node_traveltools["Travel tool clients<br/>[travel_tools.py]"]
  node_weather["Weather data<br/>[weather.py]"]
  node_comparison["Outing comparison<br/>[comparison.py]"]
  node_features["Trip features<br/>[features.py]"]
  node_companion["Contextual utilities<br/>[companion.py]"]
  node_media["Image handling<br/>[media.py]"]
end

subgraph group_operations["Operations"]
  node_storage[("SQLite state<br/>[storage.py]")]
  node_dashboard["Operator dashboard<br/>[dashboard.py]"]
  node_operator_api["Operator API<br/>[operator_api.py]"]
end

node_family(("Family group"))
node_switch["Switch bridge"]
node_planner["Planner role"]
node_researcher["Researcher role"]
node_mediator["Mediator role"]
node_watcher["Watcher role"]
node_reservation["Reservation role"]
node_simulator["Change simulator"]
node_weather_service["Open-Meteo"]
node_maps_service["OpenStreetMap and routing"]

node_family -->|"sends messages"| node_switch
node_switch -->|"bridges messages"| node_coordinator
node_runtime -->|"connects"| node_switch
node_runtime -->|"runs"| node_coordinator
node_coordinator -->|"persists state"| node_storage
node_coordinator -->|"routes conversations"| node_discussion
node_coordinator -->|"assigns planning"| node_planner
node_coordinator -->|"routes handoffs"| node_specialists
node_specialists -.->|"dispatches optionally"| node_researcher
node_specialists -.->|"dispatches optionally"| node_mediator
node_specialists -.->|"dispatches optionally"| node_watcher
node_coordinator -->|"validates messages"| node_contracts
node_coordinator -->|"checks sharing"| node_privacy
node_coordinator -->|"uses memory"| node_memory
node_coordinator -->|"validates identity"| node_familydata
node_coordinator -->|"requests tools"| node_traveltools
node_traveltools -->|"fetches forecasts"| node_weather_service
node_traveltools -->|"queries places and routes"| node_maps_service
node_traveltools -->|"runs comparisons"| node_comparison
node_runtime -->|"schedules observations"| node_weather
node_coordinator -->|"routes trip commands"| node_features
node_coordinator -->|"serves trip utilities"| node_companion
node_coordinator -->|"handles attachments"| node_media
node_coordinator -->|"checks evidence"| node_grounding
node_grounding -->|"validates claims"| node_verifier
node_coordinator -->|"creates proposals"| node_approvals
node_approvals -->|"requests approval"| node_family
node_coordinator -->|"coordinates changes"| node_reservation
node_reservation -->|"simulates outcomes"| node_simulator
node_operator_api -->|"serves views"| node_dashboard
node_operator_api -->|"reads records"| node_storage
node_operator_api -->|"controls demo"| node_approvals

click node_coordinator "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/service.py"
click node_runtime "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/runtime.py"
click node_discussion "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/discussion.py"
click node_contracts "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/contracts.py"
click node_specialists "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/specialists.py"
click node_storage "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/storage.py"
click node_privacy "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/privacy.py"
click node_memory "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/memory.py"
click node_familydata "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/family.py"
click node_approvals "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/approvals.py"
click node_verifier "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/verifier.py"
click node_grounding "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/grounding.py"
click node_traveltools "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/travel_tools.py"
click node_weather "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/weather.py"
click node_comparison "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/comparison.py"
click node_features "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/features.py"
click node_companion "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/companion.py"
click node_media "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/media.py"
click node_dashboard "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/dashboard.py"
click node_operator_api "https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/operator_api.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_coordinator,node_runtime,node_discussion,node_contracts,node_specialists toneBlue
class node_privacy,node_memory,node_familydata,node_approvals,node_verifier,node_grounding toneAmber
class node_traveltools,node_weather,node_comparison,node_features,node_companion,node_media toneMint
class node_storage,node_dashboard,node_operator_api toneRose
class node_family,node_switch,node_planner,node_researcher,node_mediator,node_watcher,node_reservation,node_simulator,node_weather_service,node_maps_service toneIndigo
```

## Components

### Conversation runtime

- [Coordinator](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/service.py): `src/trip_coordinator/service.py`
- [Worker runtime](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/runtime.py): `src/trip_coordinator/runtime.py`
- [Conversation workflow](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/discussion.py): `src/trip_coordinator/discussion.py`
- [Typed contracts](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/contracts.py): `src/trip_coordinator/contracts.py`
- [Specialist handoffs](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/specialists.py): `src/trip_coordinator/specialists.py`

### Trust and decisions

- [Privacy policy](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/privacy.py): `src/trip_coordinator/privacy.py`
- [Evidence memory](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/memory.py): `src/trip_coordinator/memory.py`
- [Family directory](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/family.py): `src/trip_coordinator/family.py`
- [Scoped approvals](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/approvals.py): `src/trip_coordinator/approvals.py`
- [Claim verification](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/verifier.py): `src/trip_coordinator/verifier.py`
- [Grounded citations](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/grounding.py): `src/trip_coordinator/grounding.py`

### Travel assistance

- [Travel tool clients](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/travel_tools.py): `src/trip_coordinator/travel_tools.py`
- [Weather data](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/weather.py): `src/trip_coordinator/weather.py`
- [Outing comparison](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/comparison.py): `src/trip_coordinator/comparison.py`
- [Trip features](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/features.py): `src/trip_coordinator/features.py`
- [Contextual utilities](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/companion.py): `src/trip_coordinator/companion.py`
- [Image handling](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/media.py): `src/trip_coordinator/media.py`

### Operations

- [SQLite state](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/storage.py): `src/trip_coordinator/storage.py`
- [Operator dashboard](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/dashboard.py): `src/trip_coordinator/dashboard.py`
- [Operator API](https://github.com/sarveshdujari/trippy---travel-companion/blob/main/src/trip_coordinator/operator_api.py): `src/trip_coordinator/operator_api.py`

### Other components

- **Family group**
- **Switch bridge**
- **Planner role**
- **Researcher role**
- **Mediator role**
- **Watcher role**
- **Reservation role**
- **Change simulator**
- **Open-Meteo**
- **OpenStreetMap and routing**

## Connections

- Family group → Switch bridge: sends messages (evidence: `README.md`)
- Switch bridge → Coordinator: bridges messages (evidence: `README.md`)
- Worker runtime → Switch bridge: connects (evidence: `src/trip_coordinator/runtime.py`)
- Worker runtime → Coordinator: runs (evidence: `src/trip_coordinator/runtime.py`)
- Coordinator → SQLite state: persists state (evidence: `README.md`)
- Coordinator → Conversation workflow: routes conversations (evidence: `src/trip_coordinator/service.py`)
- Coordinator → Planner role: assigns planning (evidence: `README.md`)
- Coordinator → Specialist handoffs: routes handoffs (evidence: `README.md`)
- Specialist handoffs → Researcher role: dispatches optionally (evidence: `README.md`)
- Specialist handoffs → Mediator role: dispatches optionally (evidence: `README.md`)
- Specialist handoffs → Watcher role: dispatches optionally (evidence: `README.md`)
- Coordinator → Typed contracts: validates messages (evidence: `src/trip_coordinator/service.py`)
- Coordinator → Privacy policy: checks sharing (evidence: `src/trip_coordinator/service.py`)
- Coordinator → Evidence memory: uses memory (evidence: `src/trip_coordinator/service.py`)
- Coordinator → Family directory: validates identity (evidence: `README.md`)
- Coordinator → Travel tool clients: requests tools (evidence: `README.md`)
- Travel tool clients → Open-Meteo: fetches forecasts (evidence: `src/trip_coordinator/travel_tools.py`)
- Travel tool clients → OpenStreetMap and routing: queries places and routes (evidence: `src/trip_coordinator/travel_tools.py`)
- Travel tool clients → Outing comparison: runs comparisons (evidence: `src/trip_coordinator/travel_tools.py`)
- Worker runtime → Weather data: schedules observations (evidence: `README.md`)
- Coordinator → Trip features: routes trip commands (evidence: `src/trip_coordinator/service.py`)
- Coordinator → Contextual utilities: serves trip utilities (evidence: `src/trip_coordinator/service.py`)
- Coordinator → Image handling: handles attachments (evidence: `src/trip_coordinator/service.py`)
- Coordinator → Grounded citations: checks evidence (evidence: `src/trip_coordinator/service.py`)
- Grounded citations → Claim verification: validates claims (evidence: `src/trip_coordinator/grounding.py`)
- Coordinator → Scoped approvals: creates proposals (evidence: `README.md`)
- Scoped approvals → Family group: requests approval (evidence: `README.md`)
- Coordinator → Reservation role: coordinates changes (evidence: `README.md`)
- Reservation role → Change simulator: simulates outcomes (evidence: `README.md`)
- Operator API → Operator dashboard: serves views (evidence: `src/trip_coordinator/operator_api.py`)
- Operator API → SQLite state: reads records (evidence: `src/trip_coordinator/operator_api.py`)
- Operator API → Scoped approvals: controls demo (evidence: `src/trip_coordinator/operator_api.py`)
