Skip to navigation

Inspect and restore Skills

Compare Skill versions, restore an earlier version, and read the evidence of a Skill

Each Skill keeps the history of its versions and the evidence that supports each version. Use these records to find why the agent follows a procedure, to find the change that made a Skill worse, and to restore an earlier procedure.

Compare two versions

Skill versions are immutable. A compiled Skill gets a new version when Zep learns a change from new Trajectories. A comparison lists the public fields that are different between two versions.

comparison = client.agent.skill.version.compare(
agent_uuid=agent_uuid,
skill_uuid=skill_uuid,
from_version=2,
to_version=3,
)
print(comparison.changed_fields)

To read all versions, use client.agent.skill.version.list. To read one version, use client.agent.skill.version.get.

Restore an earlier version

A restore adds a copy of an earlier version as a new candidate. The restore does not move the current version back. The new candidate must pass admission before search returns the restored procedure.

The request needs the current version number of the Skill as expected_version. If another write added a version first, the API returns a conflict.

skill = client.agent.skill.get(agent_uuid=agent_uuid, skill_uuid=skill_uuid)
candidate = client.agent.skill.version.restore_version(
agent_uuid=agent_uuid,
skill_uuid=skill_uuid,
expected_version=skill.current_version,
version=2,
idempotency_key=str(uuid.uuid4()),
)
print(candidate.version)

Read the evidence of a Skill

The evidence of a compiled Skill links the Skill to the Trajectories that support the Skill. The evidence records do not contain the event content. Use the IDs to read the Trajectory, the event, or the summary.

The list contains the evidence of all versions of the Skill. To see the evidence that one version cites, call client.agent.skill.version.get with markdown_format="full".

for evidence in client.agent.skill.evidence.list(
agent_uuid=agent_uuid,
skill_uuid=skill_uuid,
):
print(evidence.polarity, evidence.verification, evidence.trajectory_uuid)

The polarity value is supporting, contradicting, or neutral. The verification value is the verification strength of the Trajectory outcome.

When you correct or remove captured data, Zep repairs the affected Skills in the background.

Next steps