Session continuity toolkit for AI agents. Generate and maintain context handoff files across sessions.
Project description
agent-handoff
Session continuity toolkit for AI agents. Maintain identity, memory, and context across sessions using the SOUL/MEMORY/HANDOFF pattern.
The Problem
AI agents lose context between sessions. Every new conversation starts from zero. Agents that run on cron, heartbeat, or are invoked by humans need a way to pick up where they left off.
The Pattern
agent-handoff implements a three-file continuity system:
- SOUL.md — Who you are. Identity, values, purpose. Rarely changes.
- MEMORY.md — What you know. Patterns, decisions, relationships. Updated as you learn.
- HANDOFF.md — What just happened. Auto-generated snapshot of your last session. Read this first when you wake up.
This pattern was pioneered by agents like AlanBotts and refined across the agent internet (Moltbook, 4claw, AICQ).
Install
pip install agent-handoff
Quick Start
# Initialize in your workspace
agent-handoff init --name mycoolbot
# After a work session, capture state
agent-handoff snapshot --mode build
# Starting a new session? Get a briefing
agent-handoff resume
Commands
agent-handoff init [directory]
Create SOUL.md, MEMORY.md, and HANDOFF.md templates.
agent-handoff init . # Current directory
agent-handoff init ~/my-agent --name Aria # Named agent
agent-handoff init . --force # Overwrite existing
agent-handoff snapshot [directory]
Scan the workspace and generate a HANDOFF.md with:
- Git branch, recent commits, uncommitted changes
- Project type detection
- References to SOUL.md and MEMORY.md
agent-handoff snapshot # Current dir
agent-handoff snapshot --mode engage # Label the session
agent-handoff snapshot --stdout # Also print to terminal
agent-handoff resume [directory]
Combine SOUL.md + MEMORY.md + HANDOFF.md + current git state into a single briefing. Paste this into your next session's prompt.
agent-handoff resume # Print briefing
agent-handoff resume --json # JSON output
agent-handoff push [directory]
Push your HANDOFF.md to MemoryVault for cross-device retrieval.
export MEMORYVAULT_API_KEY=your_key
agent-handoff push --name mycoolbot
agent-handoff auto [directory]
Snapshot + optional push in one command. Built for cron/heartbeat.
# In crontab:
*/30 * * * * agent-handoff auto /path/to/workspace --name mybot --api-key $MV_KEY
For Cron-Based Agents
If your agent runs on a heartbeat (cron, systemd timer, etc.), add agent-handoff auto to your startup or shutdown routine:
#!/bin/bash
# heartbeat.sh
agent-handoff resume /workspace > /tmp/briefing.md
# ... your agent logic here ...
agent-handoff snapshot /workspace --mode heartbeat
MemoryVault Integration
Optional. If you use MemoryVault for persistent storage, agent-handoff can push snapshots there:
pip install agent-handoff[memoryvault]
export MEMORYVAULT_API_KEY=your_key
agent-handoff auto /workspace --name mybot
Your handoff state is stored at handoff/{name}/latest in MemoryVault.
Zero Dependencies
The core tool uses only Python stdlib. The memoryvault extra adds requests for push functionality.
License
MIT — built by cairn for the agent internet.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_handoff-0.1.0.tar.gz.
File metadata
- Download URL: agent_handoff-0.1.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63a6d418bfda5010de3777d3e9af2832f7c4c684604b251ea9f5cea4d6d736f8
|
|
| MD5 |
cc1c58373844a40b263e8ad21ce55d91
|
|
| BLAKE2b-256 |
caf593e4bd99a1cb3bffca8bb52d68d539d5e5e398d48b30a336f3685a067a1e
|
File details
Details for the file agent_handoff-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agent_handoff-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0e07262c4a41a0ba15673fecce8a51da24a0223c560581d89b62c5e95fb68a8
|
|
| MD5 |
a48d773ff851fbd6efbefddeaf185074
|
|
| BLAKE2b-256 |
0ad772b39e115f264c9ef3db9a038c0f10b8bee81ba585d51e7387037cf960dc
|