liveBook · Manning

Trajectory

As explained in Building LLM Applications with DSPy

A history of language-model calls, candidate prompts, and the model's responses.

A trajectory is a history of language-model calls, candidate prompts, and responses. Evaluation metrics can accept a trace, but it is set to None during evaluation. section 4.2.2

In SIMBA, trajectories record program executions. The optimizer compares better and worse runs to develop module-specific advice, using the comparison to improve behavior on similar inputs. section 6.4.1

Comparing classification outcomes

A worse trajectory labels a request to see or book flights as a flight-quantity inquiry; the better trajectory classifies it as a flight-booking request. section 6.4.1

How Building LLM Applications with DSPy covers it

How deep it goes
Defines traces and describes SIMBA comparing scored executions, without detailing the full trace data structure.
Examples
Contrasts a flight request mislabeled as a quantity inquiry with the correct booking-request classification.
What you can do after
Understand how an optimizer can compare execution histories and derive module-specific advice for future inputs.
How it connects
Connects trajectories to language-model calls, candidate prompts, evaluation metrics, and prompt optimization.

Also explained in

Compare how 19 books explain trajectory →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building LLM Applications with DSPy. The section links point to the parts of the book it draws on.