How soumyabrata2003/tripcraft works
TripCraft is a benchmark and research implementation for generating and assessing constraint-aware travel itineraries. Its main workflow uses a planner to turn a trip query, persona, and travel information into a natural-language plan; postprocessing converts plans to evaluation-format JSON, which is assessed with feasibility and continuous quality metrics. Supporting components provide travel-domain lookups, planning-time cost checks, and budget/query utilities. The repository excerpts show planner dependencies and evaluation data access; the README documents the plan-to-JSON and evaluation stages. Some subsystem links are omitted where the sampled source does not establish a caller.
Main entry points: hard_constraint.py Hard constraints · commonsense_constraint.py Commonsense constraints · budget_estimation.py Budget estimation · env.py Planning cost checks
Components 22
Itinerary planning
- Planner runner
tools/planner/sole_planning_mltp.py - LLM planner
tools/planner/apis.py - Planner prompts
agents/prompts.py - Planning cost checks
tools/planner/env.py
Travel information
- Flight lookup
tools/flights/apis.py - Accommodation lookup
tools/accommodations/apis.py - Restaurant lookup
tools/restaurants/apis.py - Attraction lookup
tools/attractions/apis.py - Event lookup
tools/events/apis.py - Distance lookup
tools/googleDistanceMatrix/apis.py
Plan processing
- Plan postprocessor
postprocess/openai_request.py - Evaluation query generation
postprocess/generate_atp_query.py - Evaluation-format plans
postprocess/sample_evaluation_format.jsonl
Plan assessment
- Feasibility checks
evaluation/eval.py - Hard constraints
evaluation/hard_constraint.py - Commonsense constraints
evaluation/commonsense_constraint.py - Continuous quality metrics
evaluation/qualitative_metrics.py
Planning utilities
- Budget estimation
utils/budget_estimation.py - Query element selection
utils/query_element_selection.py - Parsing helpers
utils/func.py
Other components
- Trip request
- Chat model
Connections 39
- Trip request → Planner runner: provides trip request
- Planner runner → LLM planner: invokes
tools/planner/sole_planning_mltp.py - LLM planner → Planner prompts: uses prompts
tools/planner/apis.py - LLM planner → Planning cost checks: uses environment
tools/planner/apis.py - LLM planner → Chat model: queries
tools/planner/apis.py - Planning cost checks → Flight lookup: checks costs
tools/planner/env.py - Planning cost checks → Accommodation lookup: checks costs
tools/planner/env.py - Planning cost checks → Restaurant lookup: checks costs
tools/planner/env.py - Planning cost checks → Distance lookup: checks travel cost
tools/planner/env.py - Planning cost checks → Attraction lookup: checks itinerary
tools/planner/env.py - Planner runner → Plan postprocessor: submits plan
- Evaluation query generation → Plan postprocessor: calls
postprocess/generate_atp_query.py - Plan postprocessor → Evaluation-format plans: produces JSON
README.md - Evaluation-format plans → Feasibility checks: is evaluated by
README.md - Feasibility checks → Hard constraints: runs checks
evaluation/eval.py - Feasibility checks → Commonsense constraints: runs checks
evaluation/eval.py - Evaluation-format plans → Continuous quality metrics: is scored by
README.md - Hard constraints → Flight lookup: checks plan data
evaluation/hard_constraint.py - Hard constraints → Accommodation lookup: checks plan data
evaluation/hard_constraint.py - Hard constraints → Restaurant lookup: checks plan data
evaluation/hard_constraint.py - Hard constraints → Distance lookup: checks travel cost
evaluation/hard_constraint.py - Hard constraints → Attraction lookup: checks plan data
evaluation/hard_constraint.py - Hard constraints → Event lookup: checks plan data
evaluation/hard_constraint.py - Commonsense constraints → Flight lookup: checks itinerary
evaluation/commonsense_constraint.py - Commonsense constraints → Accommodation lookup: checks itinerary
evaluation/commonsense_constraint.py - Commonsense constraints → Restaurant lookup: checks itinerary
evaluation/commonsense_constraint.py - Commonsense constraints → Distance lookup: checks travel
evaluation/commonsense_constraint.py - Commonsense constraints → Attraction lookup: checks itinerary
evaluation/commonsense_constraint.py - Commonsense constraints → Event lookup: checks itinerary
evaluation/commonsense_constraint.py - Budget estimation → Flight lookup: estimates costs
utils/budget_estimation.py - Budget estimation → Accommodation lookup: estimates costs
utils/budget_estimation.py - Budget estimation → Restaurant lookup: estimates costs
utils/budget_estimation.py - Budget estimation → Distance lookup: estimates travel cost
utils/budget_estimation.py - Budget estimation → Attraction lookup: estimates costs
utils/budget_estimation.py - Budget estimation → Event lookup: estimates costs
utils/budget_estimation.py - Query element selection → Budget estimation: uses estimates
utils/query_element_selection.py - Query element selection → Distance lookup: uses lookup
utils/query_element_selection.py - Hard constraints → Parsing helpers: uses parsing
evaluation/hard_constraint.py - Commonsense constraints → Parsing helpers: uses parsing
evaluation/commonsense_constraint.py