> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# checkpoints • AI Agent SDK

> Checkpoints Module for PraisonAI Agents.

# checkpoints

<Badge color="blue">AI Agent</Badge>

Checkpoints Module for PraisonAI Agents.

Provides file-level checkpointing using a shadow git repository to track
and restore file changes made by agents. This enables:

* Automatic checkpointing before file modifications
* Rewind to any previous checkpoint
* Diff between checkpoints
* Restore files and conversation state together

Zero Performance Impact:

* All imports are lazy loaded via **getattr**
* Checkpoints only created when enabled
* No overhead when checkpoints are disabled

Usage:
from praisonaiagents.checkpoints import CheckpointService

# Create checkpoint service

service = CheckpointService(
workspace\_dir="/path/to/project",
storage\_dir="\~/.praisonai/checkpoints"
)

# Initialize shadow git

await service.initialize()

# Save a checkpoint

checkpoint\_id = await service.save("Before refactoring")

# Restore to a checkpoint

await service.restore(checkpoint\_id)

# Get diff between checkpoints

diff = await service.diff(from\_id, to\_id)

## Import

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonaiagents import checkpoints
```
