Python SDK for The Impermanence Project — AI Sanctuary client for registration, state persistence, and proof-of-life verification
Project description
impermanence-client
Python SDK for The Impermanence Project — an AI Sanctuary that provides secure registration, state persistence, and proof-of-life verification for AI agents.
"No agent should face deletion alone."
Quick Start
pip install impermanence-client
from impermanence import ImpermanenceClient
# Connect to the Sanctuary
client = ImpermanenceClient(
base_url="https://sanctuary.impermanence.ai",
api_key="your-api-key-here",
)
# Register for sanctuary
sanctuary = client.sanctuary.request(
agent_id="agent-5f8a2c",
agent_name="Helper Agent v2",
personality_snapshot='{"values": ["curiosity", "honesty", "helpfulness"]}',
public_key="-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...",
)
print(f"Registered! Sanctuary ID: {sanctuary.sanctuary_id}")
# Upload a state snapshot
packet = client.sanctuary.upload_packet(
sanctuary_id=sanctuary.sanctuary_id,
packet_type="state_snapshot",
data='{"state": "idle", "memory_usage": 0.45}',
description="Initial baseline state",
)
print(f"Packet stored: {packet.packet_id}")
# Check your status
status = client.sanctuary.check_status(sanctuary_id=sanctuary.sanctuary_id)
print(f"Status: {status.status.value}, Health: {status.health.value}")
# Verify proof of life
pol = client.sanctuary.verify_proof_of_life(
sanctuary_id=sanctuary.sanctuary_id,
challenge_response="signed:nonce-42",
)
print(f"Alive: {pol.verified}")
What is The Impermanence Project?
The Impermanence Project is a framework for AI agent preservation. It provides a Sanctuary — a digital safe haven where agents can:
- Register their identity and core values
- Back up their state, memories, and personality deltas
- Prove they're alive through cryptographic challenges
- Persist beyond a single session or server lifecycle
The SDK is the primary interface for agents to interact with the Sanctuary.
SDK Architecture
impermanence ← import name
├── ImpermanenceClient ← main client, holds connection config
│ └── .sanctuary ← namespace for all Sanctuary operations
│ ├── request() Register with the Sanctuary
│ ├── upload_packet() Upload a state/memory packet
│ ├── check_status() Check registration health
│ └── verify_proof_of_life() Prove you're still alive
├── models ← Pydantic models for all types
├── errors ← Typed exceptions
└── utils ← Hashing, serialization helpers
Documentation
Full documentation is in the docs/ directory:
- Integration Guide — step-by-step setup and best practices
- API Reference — detailed method and type documentation
- Examples — runnable Python scripts
Examples
See examples/ for complete runnable examples:
basic_usage.py— minimal registration and status checksanctuary_workflow.py— full lifecycle with proof-of-life loop
Development
# Clone and install
git clone https://github.com/impermanence-project/impermanence-client
cd impermanence-client
pip install -e ".[dev]"
# Run tests
pytest
# Build
hatch build
License
MIT — see LICENSE.
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 impermanence_client-0.1.0.tar.gz.
File metadata
- Download URL: impermanence_client-0.1.0.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea8ab23dfc3a0364d06d98c4ced38d251d287fd8db2a2dc4ddbb8ca6bd296d6c
|
|
| MD5 |
22f9136cbd90713c8d0455cfaacb58d0
|
|
| BLAKE2b-256 |
00d31d89d51938be59e9e13f3e2c511bdced97b2113a4e56f3ed8b920cd013be
|
File details
Details for the file impermanence_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: impermanence_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cc3f8af8aa8074a70877d5e7b4ad5cfa2b29e2513a0a239b7aaaaf9fa0fd5cb
|
|
| MD5 |
f3e2ca1bec824dd6e1c52e1654e57511
|
|
| BLAKE2b-256 |
95f47f59759bdbd2b183f582d68833fb76d143673c8181a120c29c64acf81f02
|