How to Back Up Your Personalized AI Agent to GitHub
A practical guide to safely backing up your AI agent’s configuration, memory, and workflows to a private GitHub repository β without exposing secrets.
The More You Use Your Agent, The More Valuable It Becomes
You customize its personality, add skills, teach it how you work, and build up memory and context. If the machine running it fails, rebuilding all of that from scratch would be painful.
β οΈ The Golden Rule:
Back up the agent’s identity, not the keys to your accounts. A private repo is a backup location, not a password vault.
What to Back Up
The goal is simple: (your personalized agent) β (generic install) β (secrets).
Configuration Files
Model, provider, personality, terminal preferences, and other agent-level settings.
Personality / Instructions
The role, tone, and rules that define how your agent behaves and responds.
Memory Files
Long-term context and preferences β review carefully for personal info first.
Scheduled Tasks
Cron jobs and recurring automations that are easy to forget during a rebuild.
Custom Skills
Scripts and workflows you created or modified for your specific needs.
What Never Belongs in the Repo
.envfiles- API keys and access tokens
- OAuth and authentication files
- Private URLs, chat IDs, or other sensitive identifiers
The 6-Step Backup Workflow
Create a Private GitHub Repository
Create a new repo, set visibility to Private. Initialize empty β no README, no .gitignore, no license.
Generate a Fine-Grained Access Token
Settings β Developer settings β Personal access tokens β Fine-grained tokens. Restrict to backup repo only, Contents: Read and write.
Store the Token Securely
Copy the token into a password manager. Never paste it into files that will be committed. Revoke immediately if exposed.
Connect the Agent
Add the token via agent config as a secret: agent config set GITHUB_TOKEN <your-token>
Run the First Manual Backup
Commit config, memory, skills, and scheduling files. Then review every committed file β confirm no secrets slipped in.
Automate Recurring Backups
Schedule a daily job with notifications after each run. Keep reviewing occasionally β automation is helpful, but not blind.
Final Thoughts
A personalized AI agent becomes hard to replace once it holds your settings, memory, and workflows. A clean private GitHub backup gives you a restore path when hardware fails or you migrate machines β without turning GitHub into a secrets manager.
Inspired by a guide from Zawanah about backing up a Hermes agent to GitHub.
Ready to Protect Your AI Agent?
Set up your private GitHub backup today and never worry about losing your personalized agent again.