What is memory management?

Updated at:

One of the core challenges of AI agent applications is forgetfulness. They cannot remember past interactions, user preferences, or long-term context.PolarDB memory management is a managed service that provides long-term memory capabilities for AI applications. It persistently stores critical information in PolarDB for PostgreSQL clusters and combines intelligent retrieval with dynamic context injection to reuse accumulated memories in subsequent interactions.

Note

If you have any questions aboutPolarDB memory management, you can search for and join the DingTalk group to consult our experts. You can directly @ an expert in the group and describe your question. DingTalk group number: 34560007316.

How it works

PolarDB memory management creates an isolated PolarDB for PostgreSQL database schema (Schema), which is used to store and manage the memories of AI applications. When your application interacts with a user, it sends the conversation content to the memory management service. The service uses a large language model (LLM) to automatically extract, summarize, and structure the information, and stores the processed memories inPolarDB. In subsequent interactions, the application can retrieve relevant memories from the service at any time and inject them into new prompts as context, enabling the LLM to produce more accurate and coherent responses.

Core concepts

  • Memory project: An independent memory management unit that corresponds to one of your AI applications. At the database level, each project corresponds to a separateSchema, which ensures data isolation.

  • Long-term memory: Information that is persistently stored inPolarDB. It preserves knowledge across different stages and records the following:

    • Factual memory: User preferences, account details, and domain facts.

    • Episodic memory: Summaries of past interactions or completed tasks.

    • Semantic memory: Relationships between concepts, so that the agent can reason about them later.

  • AI agent: An AI application that you develop and that integrates memory management capabilities, such as an intelligent customer service bot or a personal assistant.

Scope of application

Before you usePolarDB memory management, make sure that your environment meets the following conditions. This section helps you quickly determine whether the feature applies to you. It is not an operation preparation checklist.

  • Cluster type: CentralizedPolarDB for PostgreSQL clusters are supported.PolarDB for PostgreSQL Distributed Edition clusters are not supported.

  • Database engine: PostgreSQL 16.

Billing

  • Component fees: PolarDB memory management charges resource component fees. The fees are calculated based on the component specifications (CPU and memory) and the purchase duration that you select.

    Single component pricing

    Chinese mainland

    Node specification

    CPU and memory

    Subscription (CNY/month)

    Pay-as-you-go (CNY/hour)

    polar.app.g1.tiny

    1 core 1 GB

    11

    0.02

    polar.app.g2.small

    1 core 2 GB

    18

    0.04

    polar.app.g2.medium

    2 cores 4 GB

    250

    0.52

    polar.app.g4.medium

    2 cores 8 GB

    270

    0.56

    polar.app.g8.medium

    2 cores 16 GB

    330

    0.6875

    polar.app.g2.large

    4 cores 8 GB

    475

    0.99

    polar.app.g4.large

    4 cores 16 GB

    630

    1.31

    polar.app.g8.large
    4 cores 32 GB

    660

    1.375

    polar.app.g2.xlarge

    8 cores 16 GB

    1,000

    2.08

    polar.app.g4.xlarge

    8 cores 32 GB

    1,240

    2.58

    polar.app.g8.xlarge
    8 cores 64 GB

    1,320

    2.75

    polar.app.g2.2xlarge

    16 cores 32 GB

    2,000

    4.17

    polar.app.g4.2xlarge

    16 cores 64 GB

    2,400

    5.00

    polar.app.g8.2xlarge
    16 cores 128 GB

    2,640

    5.5

    polar.app.g2.4xlarge
    32 cores 64 GB

    4,000

    8.32

    polar.app.g4.4xlarge
    32 cores 128 GB

    4,320

    8.96

    polar.app.g8.4xlarge
    32 cores 256 GB

    5,280

    11

    China (Hong Kong)

    Node specification

    CPU and memory

    Subscription (CNY/mo)

    Pay-as-you-go (CNY/hr)

    polar.app.g1.tiny

    1 core 1 GB

    17.6

    0.032

    polar.app.g2.small

    1 core 2 GB

    28.8

    0.064

    polar.app.g2.medium

    2 cores 4 GB

    400

    0.832

    polar.app.g4.medium

    2 cores 8 GB

    432

    0.896

    polar.app.g8.medium
    2 cores 16 GB

    528

    1.100

    polar.app.g2.large

    4 cores 8 GB

    760

    1.584

    polar.app.g4.large

    4 cores 16 GB

    1,008

    2.096

    polar.app.g8.large
    4 cores 32 GB

    1,056

    2.200

    polar.app.g2.xlarge

    8 cores 16 GB

    1,600

    3.330

    polar.app.g4.xlarge

    8 cores 32 GB

    1,984

    4.130

    polar.app.g8.xlarge
    8 cores 64 GB

    2,112

    4.400

    polar.app.g2.2xlarge

    16 cores 32 GB

    3,200

    6.670

    polar.app.g4.2xlarge

    16 cores 64 GB

    3,840

    8.000

    polar.app.g8.2xlarge
    16 cores 128 GB

    4,224

    8.800

    Japan (Tokyo)

    Node specification

    CPU and memory

    Subscription (CNY/mo)

    Pay-as-you-go (CNY/hr)

    polar.app.g1.tiny

    1 core 1 GB

    17.6

    0.032

    polar.app.g2.small

    1 core 2 GB

    28.8

    0.064

    polar.app.g2.medium

    2 cores 4 GB

    400

    0.832

    polar.app.g4.medium

    2 cores 8 GB

    432

    0.896

    polar.app.g8.medium
    2 cores 16 GB

    528

    1.100

    polar.app.g2.large

    4 cores 8 GB

    760

    1.584

    polar.app.g4.large

    4 cores 16 GB

    1,008

    2.096

    polar.app.g8.large
    4 cores 32 GB

    1,056

    2.200

    polar.app.g2.xlarge

    8 cores 16 GB

    1,600

    3.330

    polar.app.g4.xlarge

    8 cores 32 GB

    1,984

    4.130

    polar.app.g8.xlarge
    8 cores 64 GB

    2,112

    4.400

    polar.app.g2.2xlarge

    16 cores 32 GB

    3,200

    6.670

    polar.app.g4.2xlarge

    16 cores 64 GB

    3,840

    8.000

    polar.app.g8.2xlarge
    16 cores 128 GB

    4,224

    8.800

    South Korea (Seoul)

    Node specification

    CPU and memory

    Subscription (CNY/mo)

    Pay-as-you-go (CNY/hr)

    polar.app.g1.tiny

    1 core 1 GB

    17.6

    0.032

    polar.app.g2.small

    1 core 2 GB

    28.8

    0.064

    polar.app.g2.medium

    2 cores 4 GB

    400

    0.832

    polar.app.g4.medium

    2 cores 8 GB

    432

    0.896

    polar.app.g8.medium
    2 cores 16 GB

    528

    1.100

    polar.app.g2.large

    4 cores 8 GB

    760

    1.584

    polar.app.g4.large

    4 cores 16 GB

    1,008

    2.096

    polar.app.g8.large
    4 cores 32 GB

    1,056

    2.200

    polar.app.g2.xlarge

    8 cores 16 GB

    1,600

    3.330

    polar.app.g4.xlarge

    8 cores 32 GB

    1,984

    4.130

    polar.app.g8.xlarge
    8 cores 64 GB

    2,112

    4.400

    polar.app.g2.2xlarge

    16 cores 32 GB

    3,200

    6.670

    polar.app.g4.2xlarge

    16 cores 64 GB

    3,840

    8.000

    polar.app.g8.2xlarge
    16 cores 128 GB

    4,224

    8.800

    Singapore

    Node specification code

    CPU and memory

    Subscription (CNY/month)

    Pay-as-you-go (CNY/hour)

    polar.app.g1.tiny

    1 core 1 GB

    17.6

    0.032

    polar.app.g2.small

    1 core 2 GB

    28.8

    0.064

    polar.app.g2.medium

    2 cores 4 GB

    400

    0.832

    polar.app.g4.medium

    2 cores 8 GB

    432

    0.896

    polar.app.g8.medium
    2 cores 16 GB

    528

    1.100

    polar.app.g2.large

    4 cores 8 GB

    760

    1.584

    polar.app.g4.large

    4 cores 16 GB

    1,008

    2.096

    polar.app.g8.large
    4 cores 32 GB

    1,056

    2.200

    polar.app.g2.xlarge

    8 cores 16 GB

    1,600

    3.330

    polar.app.g4.xlarge

    8 cores 32 GB

    1,984

    4.130

    polar.app.g8.xlarge
    8 cores 64 GB

    2,112

    4.400

    polar.app.g2.2xlarge

    16 cores 32 GB

    3,200

    6.670

    polar.app.g4.2xlarge

    16 cores 64 GB

    3,840

    8.000

    polar.app.g8.2xlarge
    16 cores 128 GB

    4,224

    8.800

    polar.app.g2.4xlarge
    32 cores 64 GB

    6,400

    13.310

    polar.app.g4.4xlarge
    32 cores 128 GB

    6,912

    14.340

    polar.app.g8.4xlarge
    32 cores 256 GB

    8,448

    17.600

    Malaysia (Kuala Lumpur)

    Node specification

    CPU and memory

    Subscription (CNY/mo)

    Pay-as-you-go (CNY/hr)

    polar.app.g1.tiny

    1 core 1 GB

    17.6

    0.032

    polar.app.g2.small

    1 core 2 GB

    28.8

    0.064

    polar.app.g2.medium

    2 cores 4 GB

    400

    0.832

    polar.app.g4.medium

    2 cores 8 GB

    432

    0.896

    polar.app.g8.medium
    2 cores 16 GB

    528

    1.100

    polar.app.g2.large

    4 cores 8 GB

    760

    1.584

    polar.app.g4.large

    4 cores 16 GB

    1,008

    2.096

    polar.app.g8.large
    4 cores 32 GB

    1,056

    2.200

    polar.app.g2.xlarge

    8 cores 16 GB

    1,600

    3.330

    polar.app.g4.xlarge

    8 cores 32 GB

    1,984

    4.130

    polar.app.g8.xlarge
    8 cores 64 GB

    2,112

    4.400

    polar.app.g2.2xlarge

    16 cores 32 GB

    3,200

    6.670

    polar.app.g4.2xlarge

    16 cores 64 GB

    3,840

    8.000

    polar.app.g8.2xlarge
    16 cores 128 GB

    4,224

    8.800

    Indonesia (Jakarta)

    Node specification

    CPU and memory

    Subscription (CNY/month)

    Pay-as-you-go (CNY/hour)

    polar.app.g1.tiny

    1 core 1 GB

    15.4

    0.028

    polar.app.g2.small

    1 core 2 GB

    25.2

    0.056

    polar.app.g2.medium

    2 cores 4 GB

    350

    0.728

    polar.app.g4.medium

    2 cores 8 GB

    378

    0.784

    polar.app.g8.medium
    2 cores 16 GB

    462

    0.9625

    polar.app.g2.large

    4 cores 8 GB

    665

    1.386

    polar.app.g4.large

    4 cores 16 GB

    882

    1.834

    polar.app.g8.large
    4 cores 32 GB

    924

    1.925

    polar.app.g2.xlarge

    8 cores 16 GB

    1,400

    2.910

    polar.app.g4.xlarge

    8 cores 32 GB

    1,736

    3.610

    polar.app.g8.xlarge
    8 cores 64 GB

    1,848

    3.850

    polar.app.g2.2xlarge

    16 cores 32 GB

    2,800

    5.840

    polar.app.g4.2xlarge

    16 cores 64 GB

    3,360

    7.000

    polar.app.g8.2xlarge
    16 cores 128 GB

    3,696

    7.700

    polar.app.g2.4xlarge
    32 cores 64 GB

    5,600

    11.650

    polar.app.g4.4xlarge
    32 cores 128 GB

    6,048

    12.540

    polar.app.g8.4xlarge
    32 cores 256 GB

    7,392

    15.400

    Philippines

    Specification

    CPU and memory

    Subscription (CNY/month)

    Pay-as-you-go (CNY/hour)

    polar.app.g1.tiny

    1 core 1 GB

    15.4

    0.028

    polar.app.g2.small

    1 core 2 GB

    25.2

    0.056

    polar.app.g2.medium

    2 cores 4 GB

    350

    0.728

    polar.app.g4.medium

    2 cores 8 GB

    378

    0.784

    polar.app.g8.medium
    2 cores 16 GB

    462

    0.9625

    polar.app.g2.large

    4 cores 8 GB

    665

    1.386

    polar.app.g4.large

    4 cores 16 GB

    882

    1.834

    polar.app.g8.large
    4 cores 32 GB

    924

    1.925

    polar.app.g2.xlarge

    8 cores 16 GB

    1,400

    2.910

    polar.app.g4.xlarge

    8 cores 32 GB

    1,736

    3.610

    polar.app.g8.xlarge
    8 cores 64 GB

    1,848

    3.850

    polar.app.g2.2xlarge

    16 cores 32 GB

    2,800

    5.840

    polar.app.g4.2xlarge

    16 cores 64 GB

    3,360

    7.000

    polar.app.g8.2xlarge
    16 cores 128 GB

    3,696

    7.700

    Thailand (Bangkok)

    Specification

    CPU and memory

    Subscription (CNY/month)

    Pay-as-you-go (CNY/hour)

    polar.app.g1.tiny

    1 core 1 GB

    15.4

    0.028

    polar.app.g2.small

    1 core 2 GB

    25.2

    0.056

    polar.app.g2.medium

    2 cores 4 GB

    350

    0.728

    polar.app.g4.medium

    2 cores 8 GB

    378

    0.784

    polar.app.g8.medium
    2 cores 16 GB

    462

    0.9625

    polar.app.g2.large

    4 cores 8 GB

    665

    1.386

    polar.app.g4.large

    4 cores 16 GB

    882

    1.834

    polar.app.g8.large
    4 cores 32 GB

    924

    1.925

    polar.app.g2.xlarge

    8 cores 16 GB

    1,400

    2.910

    polar.app.g4.xlarge

    8 cores 32 GB

    1,736

    3.610

    polar.app.g8.xlarge
    8 cores 64 GB

    1,848

    3.850

    polar.app.g2.2xlarge

    16 cores 32 GB

    2,800

    5.840

    polar.app.g4.2xlarge

    16 cores 64 GB

    3,360

    7.000

    polar.app.g8.2xlarge
    16 cores 128 GB

    3,696

    7.700

    Germany (Frankfurt)

    Specification

    CPU and memory

    Subscription (CNY/month)

    Pay-as-you-go (CNY/hour)

    polar.app.g1.tiny

    1 core 1 GB

    15.4

    0.028

    polar.app.g2.small

    1 core 2 GB

    25.2

    0.056

    polar.app.g2.medium

    2 cores 4 GB

    350

    0.728

    polar.app.g4.medium

    2 cores 8 GB

    378

    0.784

    polar.app.g8.medium
    2 cores 16 GB

    462

    0.9625

    polar.app.g2.large

    4 cores 8 GB

    665

    1.386

    polar.app.g4.large

    4 cores 16 GB

    882

    1.834

    polar.app.g8.large
    4 cores 32 GB

    924

    1.925

    polar.app.g2.xlarge

    8 cores 16 GB

    1,400

    2.910

    polar.app.g4.xlarge

    8 cores 32 GB

    1,736

    3.610

    polar.app.g8.xlarge
    8 cores 64 GB

    1,848

    3.850

    polar.app.g2.2xlarge

    16 cores 32 GB

    2,800

    5.840

    polar.app.g4.2xlarge

    16 cores 64 GB

    3,360

    7.000

    polar.app.g8.2xlarge
    16 cores 128 GB

    3,696

    7.700

    UK (London)

    Specification

    CPU and memory

    Subscription (CNY/month)

    Pay-as-you-go (CNY/hour)

    polar.app.g1.tiny

    1 core 1 GB

    15.4

    0.028

    polar.app.g2.small

    1 core 2 GB

    25.2

    0.056

    polar.app.g2.medium

    2 cores 4 GB

    350

    0.728

    polar.app.g4.medium

    2 cores 8 GB

    378

    0.784

    polar.app.g8.medium
    2 cores 16 GB

    462

    0.9625

    polar.app.g2.large

    4 cores 8 GB

    665

    1.386

    polar.app.g4.large

    4 cores 16 GB

    882

    1.834

    polar.app.g8.large
    4 cores 32 GB

    924

    1.925

    polar.app.g2.xlarge

    8 cores 16 GB

    1,400

    2.910

    polar.app.g4.xlarge

    8 cores 32 GB

    1,736

    3.610

    polar.app.g8.xlarge
    8 cores 64 GB

    1,848

    3.850

    polar.app.g2.2xlarge

    16 cores 32 GB

    2,800

    5.840

    polar.app.g4.2xlarge

    16 cores 64 GB

    3,360

    7.000

    polar.app.g8.2xlarge
    16 cores 128 GB

    3,696

    7.700

    US (Silicon Valley)

    Node specification

    CPU and memory

    Subscription (CNY/month)

    Pay-as-you-go (CNY/hour)

    polar.app.g1.tiny

    1 vCPU 1 GB

    13.2

    0.024

    polar.app.g2.small

    1 vCPU 2 GB

    21.6

    0.048

    polar.app.g2.medium

    2 vCPUs 4 GB

    300

    0.624

    polar.app.g4.medium

    2 vCPUs 8 GB

    324

    0.672

    polar.app.g8.medium
    2 vCPUs 16 GB

    396

    0.825

    polar.app.g2.large

    4 vCPUs 8 GB

    570

    1.188

    polar.app.g4.large

    4 vCPUs 16 GB

    756

    1.572

    polar.app.g8.large
    4 vCPUs 32 GB

    792

    1.650

    polar.app.g2.xlarge

    8 vCPUs 16 GB

    1,200

    2.500

    polar.app.g4.xlarge

    8 vCPUs 32 GB

    1,488

    3.100

    polar.app.g8.xlarge
    8 vCPUs 64 GB

    1,584

    3.300

    polar.app.g2.2xlarge

    16 vCPUs 32 GB

    2,400

    5.000

    polar.app.g4.2xlarge

    16 vCPUs 64 GB

    2,880

    6.000

    polar.app.g8.2xlarge
    16 vCPUs 128 GB

    3,168

    6.600

    polar.app.g2.4xlarge
    32 vCPUs 64 GB

    4,800

    9.980

    polar.app.g4.4xlarge
    32 vCPUs 128 GB

    5,184

    10.750

    polar.app.g8.4xlarge
    32 vCPUs 256 GB

    6,336

    13.200

    US (Virginia)

    Node type

    CPU and memory

    Subscription (CNY/month)

    Pay-as-you-go (CNY/hour)

    polar.app.g1.tiny

    1 core 1 GB

    13.2

    0.024

    polar.app.g2.small

    1 core 2 GB

    21.6

    0.048

    polar.app.g2.medium

    2 cores 4 GB

    300

    0.624

    polar.app.g4.medium

    2 cores 8 GB

    324

    0.672

    polar.app.g8.medium
    2 cores 16 GB

    396

    0.825

    polar.app.g2.large

    4 cores 8 GB

    570

    1.188

    polar.app.g4.large

    4 cores 16 GB

    756

    1.572

    polar.app.g8.large
    4 cores 32 GB

    792

    1.650

    polar.app.g2.xlarge

    8 cores 16 GB

    1,200

    2.500

    polar.app.g4.xlarge

    8 cores 32 GB

    1,488

    3.100

    polar.app.g8.xlarge
    8 cores 64 GB

    1,584

    3.300

    polar.app.g2.2xlarge

    16 cores 32 GB

    2,400

    5.000

    polar.app.g4.2xlarge

    16 cores 64 GB

    2,880

    6.000

    polar.app.g8.2xlarge
    16 cores 128 GB

    3,168

    6.600

  • Storage fees: PolarDB memory management generates data and files, which are stored in the PolarDB for PostgreSQL cluster storage.

  • Model fees: PolarDB memory management uses models such as qwen3-max, text-embedding-v4, and qwen3-rerank, all of which are provided by Alibaba Cloud Model Studio. For more information about the billing rules, seeModel inference pricing.

  • Traffic and bandwidth: Free of charge.

Related documentation