Skip to main content
By default, Charm uses local file-backed memory (runtime.memory.provider: local). On the cloud runner, workspace files are persisted under a managed workspace path (backed by cloud storage for serverless/daemon workloads). For Redis, PostgreSQL, or other backends, install a memory plugin or use the built-in supabase provider where configured.

Configuring a provider

The cloud runner sets CHARM_MEMORY_PROVIDER from this block so runtime code can resolve the active backend. Built-in provider names today:

Underlying Checkpoint Mechanism

When using an external provider like supabase, Charm leverages thread identifiers (thread_id) and checkpoint namespaces to continuously sync state to the database. Upon waking up or migrating across devices, the runtime automatically queries the most recent state checkpoint. This architecture provides zero-downtime perception and seamless cross-device continuity without additional developer overhead.

Creating a memory plugin

1. Implement BaseMemoryStore

2. Register via entry points

3. Use in charm.yaml

Using memory from agent code

StorageManager caches the active provider for the process. Pass the same config dict shape as runtime.memory.config when constructing plugins that need connection settings.

Cloud deployment

Unlike heavy adapters, Memory plugins are typically lightweight (e.g. redis, pymongo). This means the Charm Cloud Runner can install them dynamically at boot time without timing out. You do NOT need a custom_image to use most Memory Providers!
  1. Add the package to your agent’s requirements.txt:
  1. Enable it in charm.yaml:
  1. Ensure policies.allow_internet_access (or network policy) allows reaching your database.
  2. Provide connection secrets via environment variables — not in committed charm.yaml.
If your memory plugin requires heavy native packages (e.g. psycopg2-binary takes longer), you should bake it into a runtime.custom_image instead. If the configured plugin is not found at runtime, Charm falls back to local file memory and logs a warning.

Share with the Community

Once your memory provider is working and published to PyPI, you can list it in the official Charm Store! Submit a Pull Request to the charm-community-plugin repository to add your package to memory/registry.json. Your integration will immediately appear on the Plugins page for other developers to discover.