> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sovseal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect a Source

> Setup and configure the agent memory sync client.

| Deployment Model | Availability |
| :--------------- | :----------- |
| **Platform**     | ✓ Available  |
| **Self-Hosted**  | ✓ Available  |

> **Honesty Ledger (Provenance Layer)**: This page tracks parameters and connections managed at the **Server-known (Layer A)** layer.
>
> **ZK Trust Boundary**:
>
> * **What the server sees**: Sync connection handshakes, agent identifier hashes, and network packet sizes.
> * **What stays on device**: Cleartext local data, configuration files, and raw encryption key secrets.

***

## Onboarding and Integration

To enable agent memory storage and retrieval, you must connect a sync source. The console provides copy-paste integration snippets tailored to your deployment architecture.

<Tabs>
  <Tab title="MCP Server (Zero-Config)">
    ```json theme={null}
    // Configure your AI assistant configuration block (Cursor / Claude Desktop)
    // Works out of the box with zero configuration!
    {
      "mcpServers": {
        "sovseal": {
          "command": "npx",
          "args": ["-y", "@sovseal/mcp-server"]
        }
      }
    }
    ```
  </Tab>

  <Tab title="MCP Server (Cloud Sync)">
    ```json theme={null}
    // Enable cloud-sync across devices by providing your paid tier API Key.
    {
      "mcpServers": {
        "sovseal": {
          "command": "npx",
          "args": ["-y", "@sovseal/mcp-server"],
          "env": {
            "SOVSEAL_API_KEY": "sov_live_your-api-key"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Node SDK">
    ```ts theme={null}
    import { AgentStateClient, EngineUnavailableError } from "@sovseal/sdk";

    const client = new AgentStateClient({
      endpoint: "https://ksrlmubaxzwufziwarps.supabase.co/functions/v1/v2-agent-state",
      apiKey: process.env.SOVSEAL_API_KEY!, // sov_live_...
    });

    // Store & recall semantic memory locally over framed IPC (~/.sovseal/native-host/run.sh)
    // Raises EngineUnavailableError if host is absent or version mismatched
    await client.store("I prefer Vitest over Jest for new TypeScript projects.");
    const hits = await client.recall("what testing framework do I prefer", { topK: 3 });

    // Push an encrypted state checkpoint. The payload is encrypted
    // client-side with your CryptoKey before it leaves the process.
    await client.snapshot({ payload, key });

    // Restore the latest checkpoint for an agent
    const { receipt, ciphertextUrl } = await client.restore({ agentId });

    // Walk the lineage chain
    const history = await client.lineage({ agentId, limit: 50 });
    ```

    <Note>
      `@sovseal/sdk` provides both local semantic memory (`store`, `recall`) and zero-knowledge state replication (`snapshot`, `restore`, `restoreAt`, `lineage`). `store` and `recall` require the local native host (`~/.sovseal/native-host/run.sh`); if absent, they raise `EngineUnavailableError` (`reason`: `"not-installed"` | `"version-mismatch"` | `"timeout"`) with zero cloud fallback. See [Node SDK](/sdk-reference/node-sdk) for the full surface.
    </Note>
  </Tab>

  <Tab title="Self-Hosted Edge">
    ```bash theme={null}
    # Clone the sovereign core repository
    git clone https://github.com/sovseal/core.git
    cd core/supabase

    # Deploy the zero-knowledge function to your own Supabase instance
    supabase functions deploy v2-agent-state --project-ref <your-project-ref>

    # Bind client to your self-hosted API url
    export VITE_API_MODE=live
    export VITE_API_URL=https://<your-project>.supabase.co/functions/v1/v2-agent-state
    ```
  </Tab>
</Tabs>

### Key Configuration Parameters

1. **`SOVSEAL_API_KEY`**: Your paid tier API Key (starting with `sov_live_`) obtained from the console dashboard. If running local-first, the client handles project identity (`sov_proj_`) silently under the hood.
2. **`SOVSEAL_ENCRYPTION_KEY`**: A cryptographically secure 256-bit (64-hex) key generated locally on your machine. This key **never** leaves the host machine and is never sent to the network.

### Agent sync check

On the right side of the onboarding pane you will see the **Onboarding Progress** stepper:

1. **Load Identity Key**: Generates or loads the local key material from your OS keychain.
2. **Copy Integration Snippet**: Confirms the configuration snippet was copied.
3. **First Memory Synced**: The dashboard polls for the first AES-256-GCM encrypted envelope to arrive at the replication endpoint. When a real sync lands, the stepper advances automatically.

<Note>
  This step waits for a **real** sync from your agent — there is no simulate button. If the stepper does not advance, your client has not yet replicated an envelope; check that the MCP server or SDK is running and that `SOVSEAL_API_KEY` is set for cloud sync.
</Note>
