All Products
Search
Document Center

Hologres:Integrate Hologres long memory service with DeepSeek Harness

Last Updated:Aug 31, 2026

DeepSeek Harness (DSH) is an AI coding assistant framework from DeepSeek that can be extended with plugins. Because the Hologres long memory service (OpenMemory) is compatible with the Mem0 API, you can connect DSH to it through the official Mem0 plugin @mem0/deepseek-plugin and give your AI agent persistent, cross-session memory. This topic describes how to set up the integration.

Prerequisites

  • DeepSeek Harness is installed. We recommend version v0.1.0-rc.8 or later.

  • Node.js v18 or later and npm are installed.

  • A long memory service is created in the Hologres console, and you have its endpoint and API key. For more information, see Create and use long memory service.

  • The environment where DSH runs can reach the endpoint of the long memory service. Within the same VPC, we recommend the internal endpoint. Across VPCs or from a local environment, use the public endpoint and add your IP address to the whitelist.

Step 1: Create a DSH profile and install the Mem0 plugin

DSH uses profiles to keep plugin and model configurations separate. The following steps install the Mem0 plugin in a profile named mem0-holo.

  1. Create the profile directory and initialize an npm project.

    mkdir -p ~/.dsh/profiles/mem0-holo && cd ~/.dsh/profiles/mem0-holo
    npm init -y
  2. Install the Mem0 plugin and its dependency.

    # @mem0/deepseek-plugin is published only to the public npmjs.org registry,
    # so specify the registry explicitly.
    npm install @mem0/deepseek-plugin --registry https://registry.npmjs.org
    npm install mem0ai --registry https://registry.npmjs.org
Note

If two copies of the @deepseek-ai dependencies exist, one in the profile and one in the main DSH installation, an internal symbol check fails and DSH reports Cannot read properties of undefined (reading 'prepare') at startup. Running npm install again recreates the duplicates, so you must repeat the symbolic link step.

Step 2: Configure DSH to connect to the Hologres long memory service

The configuration consists of two parts: environment variables and the profile configuration file.

Set environment variables

Run the following commands to set the environment variables:

export MEM0_API_KEY="<YOUR-HOLOGRES-MEM0-API-KEY>"
export DASHSCOPE_API_KEY="<YOUR-DASHSCOPE-API-KEY>"

Parameters:

Environment variable

Description

MEM0_API_KEY

The API key of the Hologres long memory service. The key is prefixed with om-. For information about how to obtain it, see Obtain connection information.

DASHSCOPE_API_KEY

The API key of Alibaba Cloud Model Studio, used to call the large language model. Skip this variable if you have configured a different LLM provider.

Note

DSH reads environment variables at startup. Export the variables before you start DSH. If you set them while DSH is running, restart DSH for the change to take effect.

Write the DSH profile configuration file

In the ~/.dsh/profiles/mem0-holo/ directory, create a file named cordis.patch.yml with the following content:

# Model Studio provider configuration. Replace this block if you use a different LLM provider.
- id: llm-pi-ai
  config:
    providers:
      bailian:
        apiKeyEnv: DASHSCOPE_API_KEY
        api: openai-completions
        baseURL: https://dashscope.aliyuncs.com/compatible-mode/v1
        compat:
          supportsDeveloperRole: false
          maxTokensField: max_tokens
        models:
          - id: deepseek-v3
            input: [text]

# Default model
- id: agent-default-model
  config:
    provider: bailian
    model: deepseek-v3

# Official Mem0 plugin. Point host to the Hologres long memory service endpoint.
- insert:
    - id: mem0
      name: "/absolute/path/to/node_modules/@mem0/deepseek-plugin/dist/index.js"
      config:
        userId: "<YOUR-USER-ID>"
        host: "<YOUR-HOLOGRES-MEM0-ENDPOINT>"

Parameters:

Parameter

Description

name

The absolute path to the entry file of the Mem0 plugin. Replace /absolute/path/to with the actual path to the node_modules directory in your profile.

userId

The user identifier that isolates memory data between users. We recommend a meaningful value, such as your employee ID or username.

host

The endpoint of the Hologres long memory service, including the protocol prefix. For example, http://hgprecn-cn-xxxxx.hologres.aliyuncs.com:80. Use the internal endpoint within the same VPC, or the public endpoint across VPCs or from a local environment. For information about how to obtain it, see Obtain connection information.

Note

To use a different LLM provider, modify only the llm-pi-ai and agent-default-model blocks. Leave the mem0 plugin configuration unchanged.

Step 3: Start DSH and verify the connection

Run one of the following commands to start DSH with the mem0-holo profile:

# Command line mode
dsh --profile mem0-holo

# Web UI mode
# Note: --profile is a global option and must precede the subcommand, such as web.
dsh --profile mem0-holo web

After DSH starts, enter the following prompt in the conversation to verify that the plugin is loaded:

Search my memories for anything relevant.

If the plugin is loaded, DSH calls the search_memory tool. The result may be empty the first time you use the service, because no memories exist yet. This is expected.

Step 4: Use the long memory service

After the plugin is loaded, it registers the following tools. DSH calls them automatically during a conversation, so no manual action is required.

Tool

Description

add_memory

Writes information to long-term memory. DSH decides from the conversation whether information is important enough to save.

Example: Cross-session memory recall

The following example writes a memory in one session and recalls it in a new session.

Write a memory

Tell the agent what to remember:

Remember this: our team uses Hologres as its real-time data warehouse, and our main query pattern is vector retrieval combined with graph aggregation.

The agent calls add_memory to write the information to the long memory service.

Recall across sessions

Start a new session and ask the agent:

Which data warehouse does our team use, and what query patterns have we been using?

The agent calls search_memory to retrieve the stored memory and refers to it in the answer.

Manage memories directly

You can also manage memories with natural language:

Operation

Example prompt

Add a memory

Remember this: Zhang San owns project X.

Delete memories

Delete my memories about the old API version. They are out of date.

FAQ

The search_memory and add_memory tools are not loaded

Check the following items in order:

  1. The profile name that you pass at startup matches the profile that you created.

  2. cordis.patch.yml exists in the profile directory, and the file that name points to exists.

  3. MEM0_API_KEY is set, and its value is prefixed with om-.

A memory search returns no results

Check the following items in order:

  1. The long memory service contains memory data.

  2. The current userId matches the one used when the memory was written. Memory data is isolated by userId.

  3. The environment where DSH runs can reach the endpoint of the long memory service, and its outbound IP address is in the whitelist.

An error occurs when the Model Studio model is called

Check that DASHSCOPE_API_KEY is valid and that the configured model ID, such as deepseek-v3, is available in Alibaba Cloud Model Studio.

Cannot read properties of undefined (reading 'prepare')

Cause: Two copies of the @deepseek-ai dependencies exist, one in the profile and one in the main DSH installation, which makes an internal symbol check fail.

Solution: Follow Step 1 to replace the duplicated dependencies in the profile with symbolic links to the main installation, and then restart DSH.

search_memory failed: Internal Server Error

Cause: When the model calls the search operation with an empty query, the search operation of the long memory service returns HTTP status code 500.

Solution: Modify the plugin file node_modules/@mem0/deepseek-plugin/dist/index.js so that an empty query is routed to the list operation instead.

  1. Find the following line:

    query: { type: "string", description: "What to recall.", required: true },

    Replace it with:

    query: { type: "string", description: "What to recall. Optional: if omitted or empty, returns the most recent memories instead of running a semantic search." },
  2. Replace the try block of the execute method with the following code:

    async execute({ query, limit, userId: u, agentId, runId }) {
      const filters = resolveSearchFilters({ userId: u, agentId, runId }, userId);
      try {
        const topK = limit && limit > 0 ? limit : DEFAULT_SEARCH_LIMIT;
        if (!query || !String(query).trim()) {
          // For an empty query, call the list operation to return the most recent
          // memories and avoid the error from the search operation.
          const listed = await client.getAll({ filters, pageSize: topK });
          const results = listed?.results ?? [];
          return truncateOutput(formatMemoryList(results));
        }
        const { results } = await client.search(query, { filters, topK });
        return truncateOutput(formatMemoryList(results ?? []));
      } catch (err) {
        return `search_memory failed: ${err instanceof Error ? err.message : String(err)}`;
      }
    }
  3. Restart DSH to apply the change.

Note

This change applies to the build output of the plugin. Reinstalling or upgrading @mem0/deepseek-plugin overwrites it, and you must apply the change again.

invalid arguments: missing required property 'query'

Cause: The query parameter is required by default, so the framework rejects the call when the model omits it. DSH usually retries automatically, and the error does not normally affect usage.

Solution: This error has the same root cause as search_memory failed: Internal Server Error. Use the same procedure to make query optional.

The --profile option has no effect

--profile is a global option and must precede the subcommand. For example, to start the web UI, run dsh --profile mem0-holo web instead of dsh web --profile mem0-holo.

MEM0_API_KEY has no effect after it is set

DSH reads environment variables at startup. Export the variable before you start DSH. If DSH is already running, restart it.