I built a small ASP.NET Core 8 assistant around three synthetic cooking lessons. I wanted to make its answer path easy to inspect. Before asking a model anything, my application selects a passage. Before accepting a generated answer, it checks the source identifiers against that passage.
The sample has a deterministic mode and an optional OpenAI-compatible chat adapter. The deterministic mode returns the selected lesson directly. The HTTP adapter can generate wording, but its response must pass a citation check.
This distinction matters. I can verify that a citation names the supplied passage. I cannot conclude from that identifier alone that every sentence is supported. My sample enforces a source-reference rule, not a guarantee of factual correctness.
I retrieve before generating
My lesson library uses fixed files with stable identifiers such as pasta-water . A question cannot choose an arbitrary file path.…