Capture Trajectories
Capture is the first step of the Agent Skills workflow. A Trajectory is the record of one bounded task attempt. Zep compiles Skills only from Trajectories, so the quality of the capture controls the quality of the Skills. For a complete example, see the Agent Skills quickstart.
Create a Trajectory
Choose task families that are specific enough to share one procedure. Zep compiles, admits, and filters Skills by task family. Two different tasks in one task family can give a Skill that applies to neither task.
Append events
Append the events in the order that they occur. Each event has an event_type and usually a content string.
Record decisions and the reasons for them. The compiler uses decision events to write the decision points of a Skill. A Trajectory that has only tool calls and results gives a less useful procedure.
Set context on an event to give the model, the tools, and the environments that the agent used. A compiled Skill can name a model, a tool, or an environment only when the event context of a cited Trajectory contains that value.
To retry a failed append safely, set event_id to your own identifier for the event. When you send the same event_id again, Zep returns the existing event and does not add a second event. For the other optional event fields, see the API reference.
Close a Trajectory
Close the Trajectory when the attempt ends. The close request sets the outcome and the verification strength.
Zep compiles Skills only from successful attempt families with strong verification. The strong values are tool, customer, and external. Zep keeps Trajectories with other values, but does not compile Skills from them.
For strong verification, send one of these fields:
verifier: an inline verifier withverifier_id,class, and optionaloutcome,assertion_id, andevidence_reference. Theclassis necessary the first time that the Agent receives theverifier_id. Zep then registers the verifier. Later requests can omitclass. If a later request sends a differentclass, the API returns a conflict.verifier_id: the ID of a verifier that you registered for the Agent.
If the request has strong verification and no verifier, the API returns 400 with the message verifier is required for this verification strength.
The close request returns 202 Accepted. Zep summarizes the Trajectory in the background.
Retries
A retry is a new Trajectory with parent_trajectory_uuid set to the earlier attempt. The initial attempt and its retries are one attempt family. Zep counts attempt families, not Trajectories, when it decides if it has sufficient evidence to compile or admit a Skill. Ten retries of one failed task are one attempt family.
Close each attempt with its own outcome. Do not reopen a closed Trajectory.
Idempotency
Trajectory and event writes accept an optional Idempotency-Key header. The value must be a UUIDv4. Use a new key for each logical write, and send the same key again when you retry that write.
Correct or remove captured data
Use these operations to correct or remove data after capture. When an operation changes the evidence of a Skill, Zep repairs the affected summaries and Skills in the background.
The correction, deletion, and revocation requests need the current revision of the Trajectory or the verifier as expected_revision. An evidence invalidation request names the verifier revisions that gave the incorrect results.