If you've ever fought with an LLM to produce valid JSON only to get malformed output, this is the fix. Guidance is Microsoft Research's framework that uses grammars and regex to constrain generation at the token level, so you get guaranteed valid JSON, XML, or any structured format you define. It backs up one token before generating to avoid awkward spacing issues, supports multi-step workflows with Python control flow, and works with Claude, GPT-4, or local models. The regex constraint approach is clever: it filters invalid tokens during generation rather than hoping the model gets it right. Most useful when you're building agents or data pipelines where parsing failures break everything downstream.
npx skills add https://github.com/orchestra-research/ai-research-skills --skill guidance