什么是记忆管理

更新时间:
复制 MD 格式

智能体(AI Agent)应用的核心挑战之一是健忘特性——无法记住历史交互、用户偏好或长期上下文。PolarDB记忆管理是为 AI 应用提供长时记忆(Long-term Memory)能力的托管服务,将关键信息持久化存储在 PolarDB PostgreSQL 版集群中,并结合智能检索与动态上下文注入,在后续交互中复用已积累的记忆。

说明

若您在PolarDB记忆管理上有任何问题,可通过钉钉搜索群号入群咨询。您可以直接@群内专家,并附上您要咨询的问题。钉钉群号:34560007316。

工作原理

PolarDB记忆管理在您的PolarDB PostgreSQL集群中创建一个隔离的Schema,用于存储和管理AI应用的记忆。当您的应用与用户交互时,它会将对话内容发送给记忆管理服务。服务内部通过大语言模型(LLM)自动完成信息提取、摘要和结构化,并将处理后的记忆存入PolarDB。在后续交互中,应用可随时从服务中检索相关记忆,并将其作为上下文注入到新的Prompt中,从而让大模型做出更精准、更具连续性的回应。

核心概念

  • 记忆项目(Memory Project):一个独立的记忆管理单元,对应您的一项AI应用。在数据库层面,每个项目对应一个独立的Schema,确保数据隔离。

  • 长时记忆(Long-term Memory):被持久化存储在PolarDB中的信息。它能够将知识在不同的阶段保存下来,它记录了:

    • 事实记忆(Factual memory):用户偏好、账户详情和领域事实。

    • 情景记忆(Episodic memory):对过去交互或已完成任务的总结。

    • 语义记忆(Semantic memory):概念之间的关系,以便智能体后续能对它们进行推理。

  • 智能体(AI Agent):指代您开发的、集成了记忆管理能力的AI应用,例如智能客服或个人助手等。

适用范围

在使用PolarDB记忆管理前,请确认您的环境满足以下条件。本功能旨在帮助您快速判断是否适用,而非操作准备。

  • 集群形态:集中式PolarDB PostgreSQL集群,暂不支持PolarDB PostgreSQL分布式版集群。

  • 数据库引擎PostgreSQL 16

计费说明

  • 组件费用PolarDB记忆管理收取资源组件费用,费用根据您选择的组件规格(CPU和内存)和购买时长计算。

    单个组件价格信息

    中国内地

    节点规格码

    CPU和内存

    包年包月(元/月)

    按量付费(元/小时)

    polar.app.g1.tiny

    11 GB

    11

    0.02

    polar.app.g2.small

    12 GB

    18

    0.04

    polar.app.g2.medium

    24 GB

    250

    0.52

    polar.app.g4.medium

    28 GB

    270

    0.56

    polar.app.g8.medium

    216 GB

    330

    0.6875

    polar.app.g2.large

    48 GB

    475

    0.99

    polar.app.g4.large

    416 GB

    630

    1.31

    polar.app.g8.large
    432 GB

    660

    1.375

    polar.app.g2.xlarge

    816 GB

    1,000

    2.08

    polar.app.g4.xlarge

    832 GB

    1,240

    2.58

    polar.app.g8.xlarge
    864 GB

    1,320

    2.75

    polar.app.g2.2xlarge

    1632 GB

    2,000

    4.17

    polar.app.g4.2xlarge

    1664 GB

    2,400

    5.00

    polar.app.g8.2xlarge
    16128 GB

    2,640

    5.5

    polar.app.g2.4xlarge
    3264 GB

    4,000

    8.32

    polar.app.g4.4xlarge
    32128 GB

    4,320

    8.96

    polar.app.g8.4xlarge
    32256 GB

    5,280

    11

    中国(香港)

    节点规格码

    CPU和内存

    包年包月(元/月)

    按量付费(元/小时)

    polar.app.g1.tiny

    11 GB

    17.6

    0.032

    polar.app.g2.small

    12 GB

    28.8

    0.064

    polar.app.g2.medium

    24 GB

    400

    0.832

    polar.app.g4.medium

    28 GB

    432

    0.896

    polar.app.g8.medium
    216 GB

    528

    1.100

    polar.app.g2.large

    48 GB

    760

    1.584

    polar.app.g4.large

    416 GB

    1,008

    2.096

    polar.app.g8.large
    432 GB

    1,056

    2.200

    polar.app.g2.xlarge

    816 GB

    1,600

    3.330

    polar.app.g4.xlarge

    832 GB

    1,984

    4.130

    polar.app.g8.xlarge
    864 GB

    2,112

    4.400

    polar.app.g2.2xlarge

    1632 GB

    3,200

    6.670

    polar.app.g4.2xlarge

    1664 GB

    3,840

    8.000

    polar.app.g8.2xlarge
    16128 GB

    4,224

    8.800

    日本(东京)

    节点规格码

    CPU和内存

    包年包月(元/月)

    按量付费(元/小时)

    polar.app.g1.tiny

    11 GB

    17.6

    0.032

    polar.app.g2.small

    12 GB

    28.8

    0.064

    polar.app.g2.medium

    24 GB

    400

    0.832

    polar.app.g4.medium

    28 GB

    432

    0.896

    polar.app.g8.medium
    216 GB

    528

    1.100

    polar.app.g2.large

    48 GB

    760

    1.584

    polar.app.g4.large

    416 GB

    1,008

    2.096

    polar.app.g8.large
    432 GB

    1,056

    2.200

    polar.app.g2.xlarge

    816 GB

    1,600

    3.330

    polar.app.g4.xlarge

    832 GB

    1,984

    4.130

    polar.app.g8.xlarge
    864 GB

    2,112

    4.400

    polar.app.g2.2xlarge

    1632 GB

    3,200

    6.670

    polar.app.g4.2xlarge

    1664 GB

    3,840

    8.000

    polar.app.g8.2xlarge
    16128 GB

    4,224

    8.800

    韩国

    节点规格码

    CPU和内存

    包年包月(元/月)

    按量付费(元/小时)

    polar.app.g1.tiny

    11 GB

    17.6

    0.032

    polar.app.g2.small

    12 GB

    28.8

    0.064

    polar.app.g2.medium

    24 GB

    400

    0.832

    polar.app.g4.medium

    28 GB

    432

    0.896

    polar.app.g8.medium
    216 GB

    528

    1.100

    polar.app.g2.large

    48 GB

    760

    1.584

    polar.app.g4.large

    416 GB

    1,008

    2.096

    polar.app.g8.large
    432 GB

    1,056

    2.200

    polar.app.g2.xlarge

    816 GB

    1,600

    3.330

    polar.app.g4.xlarge

    832 GB

    1,984

    4.130

    polar.app.g8.xlarge
    864 GB

    2,112

    4.400

    polar.app.g2.2xlarge

    1632 GB

    3,200

    6.670

    polar.app.g4.2xlarge

    1664 GB

    3,840

    8.000

    polar.app.g8.2xlarge
    16128 GB

    4,224

    8.800

    新加坡

    节点规格码

    CPU和内存

    包年包月(元/月)

    按量付费(元/小时)

    polar.app.g1.tiny

    11 GB

    17.6

    0.032

    polar.app.g2.small

    12 GB

    28.8

    0.064

    polar.app.g2.medium

    24 GB

    400

    0.832

    polar.app.g4.medium

    28 GB

    432

    0.896

    polar.app.g8.medium
    216 GB

    528

    1.100

    polar.app.g2.large

    48 GB

    760

    1.584

    polar.app.g4.large

    416 GB

    1,008

    2.096

    polar.app.g8.large
    432 GB

    1,056

    2.200

    polar.app.g2.xlarge

    816 GB

    1,600

    3.330

    polar.app.g4.xlarge

    832 GB

    1,984

    4.130

    polar.app.g8.xlarge
    864 GB

    2,112

    4.400

    polar.app.g2.2xlarge

    1632 GB

    3,200

    6.670

    polar.app.g4.2xlarge

    1664 GB

    3,840

    8.000

    polar.app.g8.2xlarge
    16128 GB

    4,224

    8.800

    polar.app.g2.4xlarge
    3264 GB

    6,400

    13.310

    polar.app.g4.4xlarge
    32128 GB

    6,912

    14.340

    polar.app.g8.4xlarge
    32256 GB

    8,448

    17.600

    马来西亚(吉隆坡)

    节点规格码

    CPU和内存

    包年包月(元/月)

    按量付费(元/小时)

    polar.app.g1.tiny

    11 GB

    17.6

    0.032

    polar.app.g2.small

    12 GB

    28.8

    0.064

    polar.app.g2.medium

    24 GB

    400

    0.832

    polar.app.g4.medium

    28 GB

    432

    0.896

    polar.app.g8.medium
    216 GB

    528

    1.100

    polar.app.g2.large

    48 GB

    760

    1.584

    polar.app.g4.large

    416 GB

    1,008

    2.096

    polar.app.g8.large
    432 GB

    1,056

    2.200

    polar.app.g2.xlarge

    816 GB

    1,600

    3.330

    polar.app.g4.xlarge

    832 GB

    1,984

    4.130

    polar.app.g8.xlarge
    864 GB

    2,112

    4.400

    polar.app.g2.2xlarge

    1632 GB

    3,200

    6.670

    polar.app.g4.2xlarge

    1664 GB

    3,840

    8.000

    polar.app.g8.2xlarge
    16128 GB

    4,224

    8.800

    印度尼西亚(雅加达)

    节点规格码

    CPU和内存

    包年包月(元/月)

    按量付费(元/小时)

    polar.app.g1.tiny

    11 GB

    15.4

    0.028

    polar.app.g2.small

    12 GB

    25.2

    0.056

    polar.app.g2.medium

    24 GB

    350

    0.728

    polar.app.g4.medium

    28 GB

    378

    0.784

    polar.app.g8.medium
    216 GB

    462

    0.9625

    polar.app.g2.large

    48 GB

    665

    1.386

    polar.app.g4.large

    416 GB

    882

    1.834

    polar.app.g8.large
    432 GB

    924

    1.925

    polar.app.g2.xlarge

    816 GB

    1,400

    2.910

    polar.app.g4.xlarge

    832 GB

    1,736

    3.610

    polar.app.g8.xlarge
    864 GB

    1,848

    3.850

    polar.app.g2.2xlarge

    1632 GB

    2,800

    5.840

    polar.app.g4.2xlarge

    1664 GB

    3,360

    7.000

    polar.app.g8.2xlarge
    16128 GB

    3,696

    7.700

    polar.app.g2.4xlarge
    3264 GB

    5,600

    11.650

    polar.app.g4.4xlarge
    32128 GB

    6,048

    12.540

    polar.app.g8.4xlarge
    32256 GB

    7,392

    15.400

    菲律宾

    节点规格码

    CPU和内存

    包年包月(元/月)

    按量付费(元/小时)

    polar.app.g1.tiny

    11 GB

    15.4

    0.028

    polar.app.g2.small

    12 GB

    25.2

    0.056

    polar.app.g2.medium

    24 GB

    350

    0.728

    polar.app.g4.medium

    28 GB

    378

    0.784

    polar.app.g8.medium
    216 GB

    462

    0.9625

    polar.app.g2.large

    48 GB

    665

    1.386

    polar.app.g4.large

    416 GB

    882

    1.834

    polar.app.g8.large
    432 GB

    924

    1.925

    polar.app.g2.xlarge

    816 GB

    1,400

    2.910

    polar.app.g4.xlarge

    832 GB

    1,736

    3.610

    polar.app.g8.xlarge
    864 GB

    1,848

    3.850

    polar.app.g2.2xlarge

    1632 GB

    2,800

    5.840

    polar.app.g4.2xlarge

    1664 GB

    3,360

    7.000

    polar.app.g8.2xlarge
    16128 GB

    3,696

    7.700

    泰国(曼谷)

    节点规格码

    CPU和内存

    包年包月(元/月)

    按量付费(元/小时)

    polar.app.g1.tiny

    11 GB

    15.4

    0.028

    polar.app.g2.small

    12 GB

    25.2

    0.056

    polar.app.g2.medium

    24 GB

    350

    0.728

    polar.app.g4.medium

    28 GB

    378

    0.784

    polar.app.g8.medium
    216 GB

    462

    0.9625

    polar.app.g2.large

    48 GB

    665

    1.386

    polar.app.g4.large

    416 GB

    882

    1.834

    polar.app.g8.large
    432 GB

    924

    1.925

    polar.app.g2.xlarge

    816 GB

    1,400

    2.910

    polar.app.g4.xlarge

    832 GB

    1,736

    3.610

    polar.app.g8.xlarge
    864 GB

    1,848

    3.850

    polar.app.g2.2xlarge

    1632 GB

    2,800

    5.840

    polar.app.g4.2xlarge

    1664 GB

    3,360

    7.000

    polar.app.g8.2xlarge
    16128 GB

    3,696

    7.700

    德国(法兰克福)

    节点规格码

    CPU和内存

    包年包月(元/月)

    按量付费(元/小时)

    polar.app.g1.tiny

    11 GB

    15.4

    0.028

    polar.app.g2.small

    12 GB

    25.2

    0.056

    polar.app.g2.medium

    24 GB

    350

    0.728

    polar.app.g4.medium

    28 GB

    378

    0.784

    polar.app.g8.medium
    216 GB

    462

    0.9625

    polar.app.g2.large

    48 GB

    665

    1.386

    polar.app.g4.large

    416 GB

    882

    1.834

    polar.app.g8.large
    432 GB

    924

    1.925

    polar.app.g2.xlarge

    816 GB

    1,400

    2.910

    polar.app.g4.xlarge

    832 GB

    1,736

    3.610

    polar.app.g8.xlarge
    864 GB

    1,848

    3.850

    polar.app.g2.2xlarge

    1632 GB

    2,800

    5.840

    polar.app.g4.2xlarge

    1664 GB

    3,360

    7.000

    polar.app.g8.2xlarge
    16128 GB

    3,696

    7.700

    英国(伦敦)

    节点规格码

    CPU和内存

    包年包月(元/月)

    按量付费(元/小时)

    polar.app.g1.tiny

    11 GB

    15.4

    0.028

    polar.app.g2.small

    12 GB

    25.2

    0.056

    polar.app.g2.medium

    24 GB

    350

    0.728

    polar.app.g4.medium

    28 GB

    378

    0.784

    polar.app.g8.medium
    216 GB

    462

    0.9625

    polar.app.g2.large

    48 GB

    665

    1.386

    polar.app.g4.large

    416 GB

    882

    1.834

    polar.app.g8.large
    432 GB

    924

    1.925

    polar.app.g2.xlarge

    816 GB

    1,400

    2.910

    polar.app.g4.xlarge

    832 GB

    1,736

    3.610

    polar.app.g8.xlarge
    864 GB

    1,848

    3.850

    polar.app.g2.2xlarge

    1632 GB

    2,800

    5.840

    polar.app.g4.2xlarge

    1664 GB

    3,360

    7.000

    polar.app.g8.2xlarge
    16128 GB

    3,696

    7.700

    美国(硅谷)

    节点规格码

    CPU和内存

    包年包月(元/月)

    按量付费(元/小时)

    polar.app.g1.tiny

    11 GB

    13.2

    0.024

    polar.app.g2.small

    12 GB

    21.6

    0.048

    polar.app.g2.medium

    24 GB

    300

    0.624

    polar.app.g4.medium

    28 GB

    324

    0.672

    polar.app.g8.medium
    216 GB

    396

    0.825

    polar.app.g2.large

    48 GB

    570

    1.188

    polar.app.g4.large

    416 GB

    756

    1.572

    polar.app.g8.large
    432 GB

    792

    1.650

    polar.app.g2.xlarge

    816 GB

    1,200

    2.500

    polar.app.g4.xlarge

    832 GB

    1,488

    3.100

    polar.app.g8.xlarge
    864 GB

    1,584

    3.300

    polar.app.g2.2xlarge

    1632 GB

    2,400

    5.000

    polar.app.g4.2xlarge

    1664 GB

    2,880

    6.000

    polar.app.g8.2xlarge
    16128 GB

    3,168

    6.600

    polar.app.g2.4xlarge
    3264 GB

    4,800

    9.980

    polar.app.g4.4xlarge
    32128 GB

    5,184

    10.750

    polar.app.g8.4xlarge
    32256 GB

    6,336

    13.200

    美国(弗吉尼亚)

    节点规格码

    CPU和内存

    包年包月(元/月)

    按量付费(元/小时)

    polar.app.g1.tiny

    11 GB

    13.2

    0.024

    polar.app.g2.small

    12 GB

    21.6

    0.048

    polar.app.g2.medium

    24 GB

    300

    0.624

    polar.app.g4.medium

    28 GB

    324

    0.672

    polar.app.g8.medium
    216 GB

    396

    0.825

    polar.app.g2.large

    48 GB

    570

    1.188

    polar.app.g4.large

    416 GB

    756

    1.572

    polar.app.g8.large
    432 GB

    792

    1.650

    polar.app.g2.xlarge

    816 GB

    1,200

    2.500

    polar.app.g4.xlarge

    832 GB

    1,488

    3.100

    polar.app.g8.xlarge
    864 GB

    1,584

    3.300

    polar.app.g2.2xlarge

    1632 GB

    2,400

    5.000

    polar.app.g4.2xlarge

    1664 GB

    2,880

    6.000

    polar.app.g8.2xlarge
    16128 GB

    3,168

    6.600

  • 存储费用PolarDB记忆管理所产生的数据和文件等将存储在PolarDB PostgreSQL集群存储空间。

  • 模型费用PolarDB记忆管理中所使用的模型(例如qwen3-max、text-embedding-v4qwen3-rerank等)均为阿里云大模型服务平台百炼中的模型。详细计费规则,请参见模型调用计费

  • 流量与带宽:不收取费用。

相关文档