05 Build eval datasets
Workshop source
Workshop material is maintained in the public langfuse/langfuse-workshop repository. Use the repository for the runnable app, checkpoint branches, and local setup.
Learner guide: 05 Build eval datasets
Instructor notes
- Start with the goal, not the items: decide what you want to evaluate (for Specs, correct answers and the right reply/defer/follow-up behavior), then pick cases that exercise it.
- Point out that 9 of the 25 items come from the 4.1 error analysis traces (
"source": "error-analysis"), including multi-turn conversations where an out-of-scope question arrives after a normal fix. The other 16 cover cases error analysis didn't include, so the step 07 prompt is also measured on cases it wasn't written from. - The code path is intentionally simple: seed curated JSON into Langfuse, then inspect the hosted dataset.
- Call out why
expectedOutputhas two fields:idealAnswerfeeds thecorrectnessLLM-as-a-judge callback, andexpectedBehavior(reply,defer_question, orask_follow_up) feeds thebehavior_matchcallback in the next chapter. - Connect this chapter back to monitoring: good dataset items often come from surprising production traces. Show one error-analysis trace next to its dataset item.
Demo rhythm
- Open
data/seed-dataset.jsonand point outinput,expectedOutput, andmetadata, including one multi-turn item. - Run
npm run dataset:seed. - Open the dataset list and item table in Langfuse.
Watch for
- Learners expecting exact-answer matching. The ideal answer is reference material for evaluators, not a string equality target.
- Duplicate dataset items if the seed script is run repeatedly against the same project.
Was this page helpful?