Verified by the sovseal team

Persistent Eliza Characters

Bring persistent context and state continuity to Eliza OS characters using the zero-knowledge sovseal memory adapter.

This cookbook provides a step-by-step guide on integrating the official @sovseal/adapter-eliza memory adapter into your Eliza OS agent setup. This ensures your characters maintain persistent context, remember user interactions across restarts, and sync encrypted states without exposing plaintext secrets to the cloud.

Zero-Knowledge Identity Isolation

  • Secure API Keys: The agent runtime encrypts state snapshots client-side using AES-256-GCM before sending them to the edge gateway.
  • 0 RTT Agent Response: Because recall_memory acts on local LanceDB vector files, the agent does not suffer from network latency during chat processing.

1. Character Configuration

To register the sovereign memory adapter, configure your character profile file:

  • File Path: characters/sovereign.character.json
{
  "name": "SovereignAgent",
  "plugins": [
    "@sovseal/adapter-eliza"
  ],
  "clients": ["discord", "twitter"],
  "modelProvider": "google",
  "settings": {
    "mcp": {
      "servers": {
        "sovseal": {
          "command": "npx",
          "args": ["-y", "@sovseal/mcp-server"]
        }
      }
    },
    "secrets": {
      "SOVSEAL_API_KEY": "sov_live_your-api-key",
      "SOVSEAL_ENDPOINT": "https://ksrlmubaxzwufziwarps.supabase.co/functions/v1/v2-agent-state"
    }
  },
  "bio": [
    "An autonomous entity running with unkillable, zero-knowledge memory continuity.",
    "Decodes context locally; replicates encrypted state in the background."
  ]
}

2. Bootstrapping the Runtime

Register the adapter in your agent initialization code to wire memory functions directly into Eliza's hook cycle:

import { AgentRuntime, elizaLogger } from "@elizaos/core";
import { SovsealAdapter } from "@sovseal/adapter-eliza";

export async function bootstrapAgentMemory(runtime: AgentRuntime) {
  elizaLogger.log("Initializing sovereign memory adapter...");

  // Instantiate the local-first adapter
  const sovsealMemory = new SovsealAdapter({
    dbPath: "~/.sovseal/db/memories.lance",
    apiKey: runtime.getSetting("SOVSEAL_API_KEY"),
    endpoint: runtime.getSetting("SOVSEAL_ENDPOINT")
  });

  // Ensure local indexes are pre-warmed and ready
  await sovsealMemory.initialize();

  // Register memory hooks into Eliza room runtime
  runtime.registerAction(sovsealMemory.actions.storeMemory);
  runtime.registerAction(sovsealMemory.actions.recallMemory);

  elizaLogger.success("Sovereign memory hooks successfully active.");
}

3. How the Hook Cycle Works

Once registered, the adapter intercepts room messages:

  1. Room Entry (Recall): When a user enters a room or sends a message, Eliza triggers the recall_memory action. The adapter queries the local LanceDB instance (latency ~6.1 ms) for previous facts about the user's wallet address, past requests, or preferences.
  2. Room Exit (Store): After generating a response, the runtime triggers the store_memory action to save the interaction fact. The adapter commits the write locally in ~3.8 ms (returning control to the user immediately) and queues the encrypted ciphertext block for write-behind replication.

On this page