https://howtonotcode.com/story/1462-making-llms-behave-deterministic-layers-structured-retrieval-and-api-rethinks