File size: 1,954 Bytes
39a12de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Hermes Memory Synchronization System

This repository contains tools for backing up and restoring Hermes AI agent state to Hugging Face Datasets.

## Files

1. `hermes_sync.py` - The main synchronization script for backing up and restoring Hermes state
2. `AGENTS.md` - Documentation for the Hermes Memory Synchronization System

## hermes_sync.py

This script provides a complete backup and restore solution for Hermes AI agent state. It can:

- Create backups of all Hermes state files
- Upload backups to Hugging Face Datasets
- Restore from backups stored on Hugging Face
- Run automatic hourly backups
- Automatically clean up local backup files after upload

## Usage

### Download the script

```bash
wget https://huggingface.co/datasets/R1000/Hermes-Memory/resolve/main/hermes_sync.py
```

### Set your Hugging Face token

```bash
export HF_TOKEN=your_huggingface_token_here
```

### Create and upload a backup

```bash
python3 hermes_sync.py backup --upload
```

### Restore from the latest backup

```bash
python3 hermes_sync.py restore
```

### List available backups

```bash
python3 hermes_sync.py list
```

### Run automatic backup (for cron jobs)

```bash
python3 hermes_sync.py auto-backup
```

## What gets backed up

The script backs up all essential Hermes state:

- `state.db` + WAL files - core KV state
- `response_store.db` - chat response cache
- `sessions/` - session transcripts
- `skills/` - user-installed skills
- `cron/` - cron job definitions
- `memories/` - persistent memories
- `auth.json` - OAuth tokens
- `channel_directory.json` - registered channels
- `config.yaml` - active configuration
- `gateway_state.json` - gateway routing state
- `.env` - environment overrides
- `SOUL.md` - persona
- `.skills_prompt_snapshot.json` - skill snapshot

## Security

- Token is stored only in environment variables
- Local backup files are automatically deleted after successful upload
- No tokens are stored in the repository