Deep dive

Weather Integration and Global Preferences

You can now persist user preferences like 'home_city' across sessions and safely fetch weather data. The flow engine handles missing state by prompting the user before calling external APIs.

riff

What was built & why

The weather flow stalled because it lacked state persistence and safe API integration. You added `riff/preferences.py` to save the home city to a JSON file without requiring user identity. `riff/weather_tools.py` injects the Open-Meteo fetcher, keeping external calls isolated from core logic. The `flows/weather.yaml` finite state machine checks for a saved city first. It prompts the user only if the city is missing, satisfying safety gates before fetching data.

Principles

Patterns

How to apply

Pitfalls