> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-beta.getzep.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-beta.getzep.com/_mcp/server.

# Inspect and restore Skills

> Compare Agent Skill versions, restore an earlier version, and read the Trajectory 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.

**`Python`**

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

**`TypeScript`**

```typescript TypeScript
const comparison = await client.agent.skill.version.compare(agentUuid, skillUuid, {
  fromVersion: 2,
  toVersion: 3,
});
console.log(comparison.changedFields);
```

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](/agent-skills/learning-and-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.

**`Python`**

```python Python
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)
```

**`TypeScript`**

```typescript TypeScript
const skill = await client.agent.skill.get(agentUuid, skillUuid);
const candidate = await client.agent.skill.version.restoreVersion(agentUuid, skillUuid, {
  expectedVersion: skill.currentVersion!,
  version: 2,
}, { idempotencyKey: randomUUID() });
console.log(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"`.

**`Python`**

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

**`TypeScript`**

```typescript TypeScript
const evidence = await client.agent.skill.evidence.list(agentUuid, skillUuid, {
  limit: 20,
  cursor: null,
});
for await (const item of evidence) {
  console.log(item.polarity, item.verification, item.trajectoryUuid);
}
```

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](/agent-skills/capture-trajectories#correct-or-remove-captured-data), Zep repairs the affected Skills in the background.

## Next steps

* [Retire a Skill](/agent-skills/author-skills#retire-a-skill) to remove the Skill from search.
* [Share Agent Skills](/agent-skill-publication) to copy a Skill to a different Agent.