Before reading this: If you haven't read the first post, From Freeform to Constrained Generation, I'd recommend starting there to understand why .meph exists. This post requires zero prior knowledge — just a terminal and Go 1.26+.
In the previous post, we talked about why .meph is a better fit for narrative contracts than JSON or YAML. But talk is cheap.
Then let's stop talking and start building. We'll write a real contract from scratch, compile it, and run it. You'll have your first narrative running in no time — and you'll see, firsthand, how the rules you write drive LLM-generated storytelling.
I. What You'll Need
Three things:






