How jmcico/triplanify works
Triplanify is a stateful travel-planning API with a separate workflow worker. Users submit trip details and commands, the API persists and queues them, and the worker advances plans through input collection, travel-data retrieval, planning, evaluation, review, and confirmation. PostgreSQL stores business state and graph checkpoints. The README documents a temporary legacy Azure Foundry API alongside v1; the current v1 runtime uses mock travel providers and a deterministic model. Some workflow wiring is unsampled, so the graph omits unverified stage-to-stage transitions.
Main entry points: factory.py Plan workflow · runtime.py Runtime wiring · aggregation.py Provider aggregation · worker.py Workflow worker
Components 22
API and commands
- FastAPI entry
app/main.py - V1 endpoints
app/api/v1/router.py - Legacy endpoints
app/api/agent_service.py - Workflow worker
app/worker.py
Planning workflow
- Runtime wiring
app/core/runtime.py - Plan workflow
app/graph/factory.py - Graph projection
app/graph/projection.py - Workflow state
app/graph/state.py
Trip domain
- Trip requirements
app/domain/trip_request.py - Itinerary plans
app/domain/itinerary.py - Travel data models
app/domain/providers.py - Plan evaluation rules
app/domain/rules.py
Providers and model
- Provider aggregation
app/providers/aggregation.py - Provider adapters
app/providers/mock.py - Provider resilience
app/providers/resilience.py - Deterministic model
app/llm/deterministic.py
Persistence
- Database sessions
app/persistence/database.py - Business repositories
app/persistence/repositories.py - Business records
app/persistence/models.py - Graph checkpoints
app/persistence/checkpoints.py
Other components
- Traveler
- PostgreSQL
Connections 34
- Traveler → FastAPI entry: submits trip
README.md - FastAPI entry → V1 endpoints: routes v1
app/main.py - FastAPI entry → Legacy endpoints: routes legacy
app/main.py - Traveler → Legacy endpoints: uses legacy API
README.md - V1 endpoints → Business repositories: reads and writes
app/api/v1/router.py - V1 endpoints → Workflow worker: queues commands
README.md - Traveler → V1 endpoints: polls and refines
README.md - Workflow worker → Plan workflow: runs workflow
app/worker.py - Workflow worker → Business repositories: claims and updates runs
app/worker.py - Workflow worker → Graph checkpoints: initializes checkpoints
app/worker.py - Runtime wiring → Database sessions: creates sessions
app/core/runtime.py - Runtime wiring → Plan workflow: provides dependencies
app/core/runtime.py - Runtime wiring → Provider aggregation: configures providers
app/core/runtime.py - Runtime wiring → Provider adapters: instantiates mocks
app/core/runtime.py - Runtime wiring → Provider resilience: configures retries
app/core/runtime.py - Runtime wiring → Deterministic model: selects model
app/core/runtime.py - Runtime wiring → Graph projection: configures projection
app/core/runtime.py - Plan workflow → Deterministic model: extracts trip details
app/graph/factory.py - Plan workflow → Provider aggregation: fetches travel data
app/graph/factory.py - Plan workflow → Graph projection: saves snapshots
app/graph/factory.py - Plan workflow → Workflow state: uses state
app/graph/factory.py - Plan workflow → Plan evaluation rules: evaluates plans
app/graph/factory.py - Plan workflow → Trip requirements: parses requirements
app/graph/factory.py - Plan workflow → Itinerary plans: validates plan
app/graph/factory.py - Plan workflow → Travel data models: uses travel results
app/graph/factory.py - Provider aggregation → Provider adapters: dispatches requests
app/providers/aggregation.py - Provider aggregation → Provider resilience: executes resiliently
app/providers/aggregation.py - Provider aggregation → Travel data models: returns normalized data
app/providers/aggregation.py - Graph projection → Business repositories: persists projections
app/graph/projection.py - Business repositories → Business records: queries records
app/persistence/repositories.py - Database sessions → PostgreSQL: connects
app/persistence/database.py - Graph checkpoints → PostgreSQL: stores checkpoints
app/persistence/checkpoints.py - Database sessions → Business records: provides ORM base
app/persistence/models.py - Trip requirements → Itinerary plans: informs planning