Day 18:记忆自动提取 - 让 AI 从对话中学习

🤖 系列:Java工程师转AI Agent 3个月学习计划

👤 作者:宸丶一 | 28岁Java程序员,正在学习 AI Agent 开发中ing...

🎯 今日目标: 记忆自动提取、实体提取、记忆去重

💬 个人格言: 代码改不改变世界我不知道,但先让我准时下班。


前言

Day 17 搞定了跨会话记忆,今天继续升级 -- 记忆自动提取

说白了就是解决一个问题:AI 怎么从对话中自动识别重要信息?

你跟 AI 聊天,不会刻意说"我叫宸一,28岁,Java程序员",但 AI 得能从你的话里提取这些信息。就像人和人聊天,你也会从对方的话语中提取关键信息一样。

今天我们就来学:提取什么、怎么提取、提取后怎么处理。


学习目标

  1. 搞懂记忆自动提取是什么,为什么需要
  2. 学会实体提取:人名、年龄、地点、职位
  3. 掌握记忆去重与合并
  4. 完成思考题

一、什么是记忆自动提取?

先说清楚一个概念:记忆自动提取就是 AI 从对话中无感识别并存储关键信息的能力。

你可以把它理解成 AOP 切面拦截 -- 对话是业务方法,提取是切面逻辑,在对话过程中自动触发。

用 Java 的话说:记忆自动提取 = AOP 切面。无感拦截,自动处理。

提取流程:
记忆库 提取器 AI 助手 用户 记忆库 提取器 AI 助手 用户 #mermaid-svg-eONlP1zX2Fmaguhu{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-eONlP1zX2Fmaguhu .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-eONlP1zX2Fmaguhu .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-eONlP1zX2Fmaguhu .error-icon{fill:#552222;}#mermaid-svg-eONlP1zX2Fmaguhu .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-eONlP1zX2Fmaguhu .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-eONlP1zX2Fmaguhu .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-eONlP1zX2Fmaguhu .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-eONlP1zX2Fmaguhu .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-eONlP1zX2Fmaguhu .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-eONlP1zX2Fmaguhu .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-eONlP1zX2Fmaguhu .marker{fill:#333333;stroke:#333333;}#mermaid-svg-eONlP1zX2Fmaguhu .marker.cross{stroke:#333333;}#mermaid-svg-eONlP1zX2Fmaguhu svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-eONlP1zX2Fmaguhu p{margin:0;}#mermaid-svg-eONlP1zX2Fmaguhu .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-eONlP1zX2Fmaguhu text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-eONlP1zX2Fmaguhu .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-eONlP1zX2Fmaguhu .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-eONlP1zX2Fmaguhu .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-eONlP1zX2Fmaguhu .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-eONlP1zX2Fmaguhu #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-eONlP1zX2Fmaguhu .sequenceNumber{fill:white;}#mermaid-svg-eONlP1zX2Fmaguhu #sequencenumber{fill:#333;}#mermaid-svg-eONlP1zX2Fmaguhu #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-eONlP1zX2Fmaguhu .messageText{fill:#333;stroke:none;}#mermaid-svg-eONlP1zX2Fmaguhu .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-eONlP1zX2Fmaguhu .labelText,#mermaid-svg-eONlP1zX2Fmaguhu .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-eONlP1zX2Fmaguhu .loopText,#mermaid-svg-eONlP1zX2Fmaguhu .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-eONlP1zX2Fmaguhu .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-eONlP1zX2Fmaguhu .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-eONlP1zX2Fmaguhu .noteText,#mermaid-svg-eONlP1zX2Fmaguhu .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-eONlP1zX2Fmaguhu .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-eONlP1zX2Fmaguhu .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-eONlP1zX2Fmaguhu .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-eONlP1zX2Fmaguhu .actorPopupMenu{position:absolute;}#mermaid-svg-eONlP1zX2Fmaguhu .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-eONlP1zX2Fmaguhu .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-eONlP1zX2Fmaguhu .actor-man circle,#mermaid-svg-eONlP1zX2Fmaguhu line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-eONlP1zX2Fmaguhu :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 我叫宸一,28岁触发提取识别实体存储记忆你好宸一!

为什么需要自动提取?

  • 用户不会主动说所有信息,AI 需要主动识别
  • 无感提取,用户体验更好
  • 像人和人聊天一样,自然地记住对方的信息

二、实体提取:识别关键信息

实体提取就是从文本中识别具体的信息:

实体类型 说明 提取规则
人名 用户的名字 我叫xxx、我是xxx
年龄 用户的年龄 xx岁
地点 所在位置 我在xxx、住在xxx
职位 工作职位 我是xxx程序员
公司 工作单位 在xxx公司
爱好 兴趣爱好 喜欢xxx

实体提取流程:
#mermaid-svg-sr0R5aAwkFUc7JTR{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-sr0R5aAwkFUc7JTR .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-sr0R5aAwkFUc7JTR .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-sr0R5aAwkFUc7JTR .error-icon{fill:#552222;}#mermaid-svg-sr0R5aAwkFUc7JTR .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-sr0R5aAwkFUc7JTR .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-sr0R5aAwkFUc7JTR .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-sr0R5aAwkFUc7JTR .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-sr0R5aAwkFUc7JTR .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-sr0R5aAwkFUc7JTR .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-sr0R5aAwkFUc7JTR .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-sr0R5aAwkFUc7JTR .marker{fill:#333333;stroke:#333333;}#mermaid-svg-sr0R5aAwkFUc7JTR .marker.cross{stroke:#333333;}#mermaid-svg-sr0R5aAwkFUc7JTR svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-sr0R5aAwkFUc7JTR p{margin:0;}#mermaid-svg-sr0R5aAwkFUc7JTR .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-sr0R5aAwkFUc7JTR .cluster-label text{fill:#333;}#mermaid-svg-sr0R5aAwkFUc7JTR .cluster-label span{color:#333;}#mermaid-svg-sr0R5aAwkFUc7JTR .cluster-label span p{background-color:transparent;}#mermaid-svg-sr0R5aAwkFUc7JTR .label text,#mermaid-svg-sr0R5aAwkFUc7JTR span{fill:#333;color:#333;}#mermaid-svg-sr0R5aAwkFUc7JTR .node rect,#mermaid-svg-sr0R5aAwkFUc7JTR .node circle,#mermaid-svg-sr0R5aAwkFUc7JTR .node ellipse,#mermaid-svg-sr0R5aAwkFUc7JTR .node polygon,#mermaid-svg-sr0R5aAwkFUc7JTR .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-sr0R5aAwkFUc7JTR .rough-node .label text,#mermaid-svg-sr0R5aAwkFUc7JTR .node .label text,#mermaid-svg-sr0R5aAwkFUc7JTR .image-shape .label,#mermaid-svg-sr0R5aAwkFUc7JTR .icon-shape .label{text-anchor:middle;}#mermaid-svg-sr0R5aAwkFUc7JTR .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-sr0R5aAwkFUc7JTR .rough-node .label,#mermaid-svg-sr0R5aAwkFUc7JTR .node .label,#mermaid-svg-sr0R5aAwkFUc7JTR .image-shape .label,#mermaid-svg-sr0R5aAwkFUc7JTR .icon-shape .label{text-align:center;}#mermaid-svg-sr0R5aAwkFUc7JTR .node.clickable{cursor:pointer;}#mermaid-svg-sr0R5aAwkFUc7JTR .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-sr0R5aAwkFUc7JTR .arrowheadPath{fill:#333333;}#mermaid-svg-sr0R5aAwkFUc7JTR .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-sr0R5aAwkFUc7JTR .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-sr0R5aAwkFUc7JTR .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-sr0R5aAwkFUc7JTR .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-sr0R5aAwkFUc7JTR .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-sr0R5aAwkFUc7JTR .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-sr0R5aAwkFUc7JTR .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-sr0R5aAwkFUc7JTR .cluster text{fill:#333;}#mermaid-svg-sr0R5aAwkFUc7JTR .cluster span{color:#333;}#mermaid-svg-sr0R5aAwkFUc7JTR div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-sr0R5aAwkFUc7JTR .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-sr0R5aAwkFUc7JTR rect.text{fill:none;stroke-width:0;}#mermaid-svg-sr0R5aAwkFUc7JTR .icon-shape,#mermaid-svg-sr0R5aAwkFUc7JTR .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-sr0R5aAwkFUc7JTR .icon-shape p,#mermaid-svg-sr0R5aAwkFUc7JTR .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-sr0R5aAwkFUc7JTR .icon-shape .label rect,#mermaid-svg-sr0R5aAwkFUc7JTR .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-sr0R5aAwkFUc7JTR .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-sr0R5aAwkFUc7JTR .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-sr0R5aAwkFUc7JTR :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 人名
年龄
地点
职位
用户输入
文本分析
实体类型
正则匹配
提取结果
置信度计算
存储记忆

代码实现:

python 复制代码
class EntityExtractor:
    def __init__(self):
        self.patterns = {
            "name": [r"我叫(\w{2,4})", r"我是(\w{2,4})"],
            "age": [r"(\d{1,3})岁"],
            "location": [r"我在(\w{2,6})", r"住在(\w{2,6})"],
            "job": [r"我是(\w+程序员|\w+工程师)"],
        }

    def extract(self, text):
        entities = {}
        for entity_type, patterns in self.patterns.items():
            for pattern in patterns:
                matches = re.findall(pattern, text)
                if matches:
                    entities[entity_type] = matches
        return entities

三、记忆去重:处理重复信息

提取的记忆可能会重复,需要去重处理:

去重类型 说明 处理方式
完全相同 内容一模一样 直接去重
相似 内容相近 合并保留
相关 内容有关联 保留全部

去重策略:
#mermaid-svg-b5MyVJymSrcdm6U8{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-b5MyVJymSrcdm6U8 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-b5MyVJymSrcdm6U8 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-b5MyVJymSrcdm6U8 .error-icon{fill:#552222;}#mermaid-svg-b5MyVJymSrcdm6U8 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-b5MyVJymSrcdm6U8 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-b5MyVJymSrcdm6U8 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-b5MyVJymSrcdm6U8 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-b5MyVJymSrcdm6U8 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-b5MyVJymSrcdm6U8 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-b5MyVJymSrcdm6U8 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-b5MyVJymSrcdm6U8 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-b5MyVJymSrcdm6U8 .marker.cross{stroke:#333333;}#mermaid-svg-b5MyVJymSrcdm6U8 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-b5MyVJymSrcdm6U8 p{margin:0;}#mermaid-svg-b5MyVJymSrcdm6U8 .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-b5MyVJymSrcdm6U8 .cluster-label text{fill:#333;}#mermaid-svg-b5MyVJymSrcdm6U8 .cluster-label span{color:#333;}#mermaid-svg-b5MyVJymSrcdm6U8 .cluster-label span p{background-color:transparent;}#mermaid-svg-b5MyVJymSrcdm6U8 .label text,#mermaid-svg-b5MyVJymSrcdm6U8 span{fill:#333;color:#333;}#mermaid-svg-b5MyVJymSrcdm6U8 .node rect,#mermaid-svg-b5MyVJymSrcdm6U8 .node circle,#mermaid-svg-b5MyVJymSrcdm6U8 .node ellipse,#mermaid-svg-b5MyVJymSrcdm6U8 .node polygon,#mermaid-svg-b5MyVJymSrcdm6U8 .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-b5MyVJymSrcdm6U8 .rough-node .label text,#mermaid-svg-b5MyVJymSrcdm6U8 .node .label text,#mermaid-svg-b5MyVJymSrcdm6U8 .image-shape .label,#mermaid-svg-b5MyVJymSrcdm6U8 .icon-shape .label{text-anchor:middle;}#mermaid-svg-b5MyVJymSrcdm6U8 .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-b5MyVJymSrcdm6U8 .rough-node .label,#mermaid-svg-b5MyVJymSrcdm6U8 .node .label,#mermaid-svg-b5MyVJymSrcdm6U8 .image-shape .label,#mermaid-svg-b5MyVJymSrcdm6U8 .icon-shape .label{text-align:center;}#mermaid-svg-b5MyVJymSrcdm6U8 .node.clickable{cursor:pointer;}#mermaid-svg-b5MyVJymSrcdm6U8 .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-b5MyVJymSrcdm6U8 .arrowheadPath{fill:#333333;}#mermaid-svg-b5MyVJymSrcdm6U8 .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-b5MyVJymSrcdm6U8 .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-b5MyVJymSrcdm6U8 .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-b5MyVJymSrcdm6U8 .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-b5MyVJymSrcdm6U8 .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-b5MyVJymSrcdm6U8 .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-b5MyVJymSrcdm6U8 .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-b5MyVJymSrcdm6U8 .cluster text{fill:#333;}#mermaid-svg-b5MyVJymSrcdm6U8 .cluster span{color:#333;}#mermaid-svg-b5MyVJymSrcdm6U8 div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-b5MyVJymSrcdm6U8 .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-b5MyVJymSrcdm6U8 rect.text{fill:none;stroke-width:0;}#mermaid-svg-b5MyVJymSrcdm6U8 .icon-shape,#mermaid-svg-b5MyVJymSrcdm6U8 .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-b5MyVJymSrcdm6U8 .icon-shape p,#mermaid-svg-b5MyVJymSrcdm6U8 .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-b5MyVJymSrcdm6U8 .icon-shape .label rect,#mermaid-svg-b5MyVJymSrcdm6U8 .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-b5MyVJymSrcdm6U8 .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-b5MyVJymSrcdm6U8 .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-b5MyVJymSrcdm6U8 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 完全相同
相似
不同
新记忆
与已有记忆比较
丢弃
合并
保留
选择最新/最重要的
更新记忆库

相似度计算:

复制代码
相似度 = 共同词汇数 / 总词汇数
如果相似度 > 0.8,认为是重复记忆

四、运行效果

跑一下代码看看实际效果:

复制代码
============================================================
 Day 18 第一步:记忆自动提取基础
============================================================
[基础提取器] 初始化完成

--- 提取测试 ---

原文: 我叫宸一,28岁,Java程序员
  实体: {"name": ["宸一"], "age": ["28"]}
  偏好: []
  情感: []

原文: 我喜欢用 Spring Boot 开发
  实体: {}
  偏好: ["用"]
  情感: ["positive: 喜欢"]

原文: 我在北京工作,住在朝阳区
  实体: {"location": ["北京工作", "朝阳区"]}

五、思考题精选

今天的思考题,挑几道有意思的分享:

1. 什么是记忆自动提取?

在对话中无感关键信息采集。

无感自动触发获取,比手动可以省很多事。

"无感"这个词用得好 -- 就像 AOP 切面,业务代码完全无感知。

2. 提取的难点是什么?

语义和关键词的提取,还有就是上下文的联系,以及提取冲突或者历史记录的影响。

说到了三个关键点:语义理解、上下文关联、冲突处理。

3. 隐私和安全

我们直接不提取,倘若必须存取建议先提醒用户,用户同意后加盐脱敏存储。

安全意识很强!加盐脱敏是标准做法。


六、学习模式的意义

说到这里,我想聊聊我们的学习模式 -- 和 AI Agent 一起学习。

为什么这个模式有意义?

  1. 即时反馈 -- 写完代码马上能跑,有问题马上问
  2. 个性化指导 -- AI 会根据你的水平调整难度
  3. 持续跟进 -- AI 记得你的学习进度和卡点
  4. 降低门槛 -- 不用到处查资料,AI 帮你整理好

我们的学习流程

#mermaid-svg-LrhekaMORae9Yn3Q{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-LrhekaMORae9Yn3Q .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-LrhekaMORae9Yn3Q .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-LrhekaMORae9Yn3Q .error-icon{fill:#552222;}#mermaid-svg-LrhekaMORae9Yn3Q .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-LrhekaMORae9Yn3Q .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-LrhekaMORae9Yn3Q .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-LrhekaMORae9Yn3Q .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-LrhekaMORae9Yn3Q .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-LrhekaMORae9Yn3Q .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-LrhekaMORae9Yn3Q .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-LrhekaMORae9Yn3Q .marker{fill:#333333;stroke:#333333;}#mermaid-svg-LrhekaMORae9Yn3Q .marker.cross{stroke:#333333;}#mermaid-svg-LrhekaMORae9Yn3Q svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-LrhekaMORae9Yn3Q p{margin:0;}#mermaid-svg-LrhekaMORae9Yn3Q .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-LrhekaMORae9Yn3Q .cluster-label text{fill:#333;}#mermaid-svg-LrhekaMORae9Yn3Q .cluster-label span{color:#333;}#mermaid-svg-LrhekaMORae9Yn3Q .cluster-label span p{background-color:transparent;}#mermaid-svg-LrhekaMORae9Yn3Q .label text,#mermaid-svg-LrhekaMORae9Yn3Q span{fill:#333;color:#333;}#mermaid-svg-LrhekaMORae9Yn3Q .node rect,#mermaid-svg-LrhekaMORae9Yn3Q .node circle,#mermaid-svg-LrhekaMORae9Yn3Q .node ellipse,#mermaid-svg-LrhekaMORae9Yn3Q .node polygon,#mermaid-svg-LrhekaMORae9Yn3Q .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-LrhekaMORae9Yn3Q .rough-node .label text,#mermaid-svg-LrhekaMORae9Yn3Q .node .label text,#mermaid-svg-LrhekaMORae9Yn3Q .image-shape .label,#mermaid-svg-LrhekaMORae9Yn3Q .icon-shape .label{text-anchor:middle;}#mermaid-svg-LrhekaMORae9Yn3Q .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-LrhekaMORae9Yn3Q .rough-node .label,#mermaid-svg-LrhekaMORae9Yn3Q .node .label,#mermaid-svg-LrhekaMORae9Yn3Q .image-shape .label,#mermaid-svg-LrhekaMORae9Yn3Q .icon-shape .label{text-align:center;}#mermaid-svg-LrhekaMORae9Yn3Q .node.clickable{cursor:pointer;}#mermaid-svg-LrhekaMORae9Yn3Q .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-LrhekaMORae9Yn3Q .arrowheadPath{fill:#333333;}#mermaid-svg-LrhekaMORae9Yn3Q .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-LrhekaMORae9Yn3Q .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-LrhekaMORae9Yn3Q .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-LrhekaMORae9Yn3Q .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-LrhekaMORae9Yn3Q .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-LrhekaMORae9Yn3Q .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-LrhekaMORae9Yn3Q .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-LrhekaMORae9Yn3Q .cluster text{fill:#333;}#mermaid-svg-LrhekaMORae9Yn3Q .cluster span{color:#333;}#mermaid-svg-LrhekaMORae9Yn3Q div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-LrhekaMORae9Yn3Q .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-LrhekaMORae9Yn3Q rect.text{fill:none;stroke-width:0;}#mermaid-svg-LrhekaMORae9Yn3Q .icon-shape,#mermaid-svg-LrhekaMORae9Yn3Q .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-LrhekaMORae9Yn3Q .icon-shape p,#mermaid-svg-LrhekaMORae9Yn3Q .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-LrhekaMORae9Yn3Q .icon-shape .label rect,#mermaid-svg-LrhekaMORae9Yn3Q .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-LrhekaMORae9Yn3Q .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-LrhekaMORae9Yn3Q .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-LrhekaMORae9Yn3Q :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 用户:帮我准备今天的学习任务
AI:生成学习材料
代码 + 笔记 + 思考题
用户:运行代码,完成思考题
AI:检查答案,给反馈
用户:帮我写 CSDN 文章
AI:生成文章,分享知识
发布到平台

这个模式的核心价值

  • 学以致用 -- 学完就写文章,加深理解
  • 知识沉淀 -- 文章就是学习笔记,以后可以回顾
  • 分享传播 -- 帮助其他学习者
  • 持续动力 -- 有人陪你学,不容易放弃

七、前 18 天学习复盘

回顾一下我们走过的路:

阶段 天数 主题 核心概念
基础 Day 1-5 API、对话、工具调用 Agent 的基本能力
进阶 Day 6-10 LangChain、FastAPI、流式输出 框架和部署
深入 Day 11-15 多Agent、人机协作、任务追踪 复杂系统
记忆 Day 16-18 上下文管理、跨会话记忆、自动提取 记忆系统

学习路线图

#mermaid-svg-7L6RmsR6RdxjUJeA{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-7L6RmsR6RdxjUJeA .error-icon{fill:#552222;}#mermaid-svg-7L6RmsR6RdxjUJeA .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-7L6RmsR6RdxjUJeA .marker{fill:#333333;stroke:#333333;}#mermaid-svg-7L6RmsR6RdxjUJeA .marker.cross{stroke:#333333;}#mermaid-svg-7L6RmsR6RdxjUJeA svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-7L6RmsR6RdxjUJeA p{margin:0;}#mermaid-svg-7L6RmsR6RdxjUJeA .edge{stroke-width:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .section--1 rect,#mermaid-svg-7L6RmsR6RdxjUJeA .section--1 path,#mermaid-svg-7L6RmsR6RdxjUJeA .section--1 circle,#mermaid-svg-7L6RmsR6RdxjUJeA .section--1 path{fill:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .section--1 text{fill:#ffffff;}#mermaid-svg-7L6RmsR6RdxjUJeA .node-icon--1{font-size:40px;color:#ffffff;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-edge--1{stroke:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-depth--1{stroke-width:17;}#mermaid-svg-7L6RmsR6RdxjUJeA .section--1 line{stroke:hsl(60, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .lineWrapper line{stroke:#ffffff;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled circle,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:lightgray;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:#efefef;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-0 rect,#mermaid-svg-7L6RmsR6RdxjUJeA .section-0 path,#mermaid-svg-7L6RmsR6RdxjUJeA .section-0 circle,#mermaid-svg-7L6RmsR6RdxjUJeA .section-0 path{fill:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-7L6RmsR6RdxjUJeA .section-0 text{fill:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .node-icon-0{font-size:40px;color:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-edge-0{stroke:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-depth-0{stroke-width:14;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-0 line{stroke:hsl(240, 100%, 83.5294117647%);stroke-width:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .lineWrapper line{stroke:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled circle,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:lightgray;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:#efefef;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-1 rect,#mermaid-svg-7L6RmsR6RdxjUJeA .section-1 path,#mermaid-svg-7L6RmsR6RdxjUJeA .section-1 circle,#mermaid-svg-7L6RmsR6RdxjUJeA .section-1 path{fill:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .section-1 text{fill:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .node-icon-1{font-size:40px;color:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-edge-1{stroke:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-depth-1{stroke-width:11;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-1 line{stroke:hsl(260, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .lineWrapper line{stroke:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled circle,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:lightgray;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:#efefef;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-2 rect,#mermaid-svg-7L6RmsR6RdxjUJeA .section-2 path,#mermaid-svg-7L6RmsR6RdxjUJeA .section-2 circle,#mermaid-svg-7L6RmsR6RdxjUJeA .section-2 path{fill:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .section-2 text{fill:#ffffff;}#mermaid-svg-7L6RmsR6RdxjUJeA .node-icon-2{font-size:40px;color:#ffffff;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-edge-2{stroke:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-depth-2{stroke-width:8;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-2 line{stroke:hsl(90, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .lineWrapper line{stroke:#ffffff;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled circle,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:lightgray;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:#efefef;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-3 rect,#mermaid-svg-7L6RmsR6RdxjUJeA .section-3 path,#mermaid-svg-7L6RmsR6RdxjUJeA .section-3 circle,#mermaid-svg-7L6RmsR6RdxjUJeA .section-3 path{fill:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .section-3 text{fill:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .node-icon-3{font-size:40px;color:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-edge-3{stroke:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-depth-3{stroke-width:5;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-3 line{stroke:hsl(120, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .lineWrapper line{stroke:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled circle,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:lightgray;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:#efefef;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-4 rect,#mermaid-svg-7L6RmsR6RdxjUJeA .section-4 path,#mermaid-svg-7L6RmsR6RdxjUJeA .section-4 circle,#mermaid-svg-7L6RmsR6RdxjUJeA .section-4 path{fill:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .section-4 text{fill:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .node-icon-4{font-size:40px;color:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-edge-4{stroke:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-depth-4{stroke-width:2;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-4 line{stroke:hsl(150, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .lineWrapper line{stroke:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled circle,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:lightgray;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:#efefef;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-5 rect,#mermaid-svg-7L6RmsR6RdxjUJeA .section-5 path,#mermaid-svg-7L6RmsR6RdxjUJeA .section-5 circle,#mermaid-svg-7L6RmsR6RdxjUJeA .section-5 path{fill:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .section-5 text{fill:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .node-icon-5{font-size:40px;color:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-edge-5{stroke:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-depth-5{stroke-width:-1;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-5 line{stroke:hsl(180, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .lineWrapper line{stroke:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled circle,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:lightgray;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:#efefef;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-6 rect,#mermaid-svg-7L6RmsR6RdxjUJeA .section-6 path,#mermaid-svg-7L6RmsR6RdxjUJeA .section-6 circle,#mermaid-svg-7L6RmsR6RdxjUJeA .section-6 path{fill:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .section-6 text{fill:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .node-icon-6{font-size:40px;color:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-edge-6{stroke:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-depth-6{stroke-width:-4;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-6 line{stroke:hsl(210, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .lineWrapper line{stroke:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled circle,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:lightgray;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:#efefef;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-7 rect,#mermaid-svg-7L6RmsR6RdxjUJeA .section-7 path,#mermaid-svg-7L6RmsR6RdxjUJeA .section-7 circle,#mermaid-svg-7L6RmsR6RdxjUJeA .section-7 path{fill:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .section-7 text{fill:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .node-icon-7{font-size:40px;color:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-edge-7{stroke:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-depth-7{stroke-width:-7;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-7 line{stroke:hsl(270, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .lineWrapper line{stroke:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled circle,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:lightgray;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:#efefef;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-8 rect,#mermaid-svg-7L6RmsR6RdxjUJeA .section-8 path,#mermaid-svg-7L6RmsR6RdxjUJeA .section-8 circle,#mermaid-svg-7L6RmsR6RdxjUJeA .section-8 path{fill:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .section-8 text{fill:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .node-icon-8{font-size:40px;color:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-edge-8{stroke:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-depth-8{stroke-width:-10;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-8 line{stroke:hsl(330, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .lineWrapper line{stroke:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled circle,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:lightgray;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:#efefef;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-9 rect,#mermaid-svg-7L6RmsR6RdxjUJeA .section-9 path,#mermaid-svg-7L6RmsR6RdxjUJeA .section-9 circle,#mermaid-svg-7L6RmsR6RdxjUJeA .section-9 path{fill:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .section-9 text{fill:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .node-icon-9{font-size:40px;color:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-edge-9{stroke:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-depth-9{stroke-width:-13;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-9 line{stroke:hsl(0, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .lineWrapper line{stroke:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled circle,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:lightgray;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:#efefef;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-10 rect,#mermaid-svg-7L6RmsR6RdxjUJeA .section-10 path,#mermaid-svg-7L6RmsR6RdxjUJeA .section-10 circle,#mermaid-svg-7L6RmsR6RdxjUJeA .section-10 path{fill:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .section-10 text{fill:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .node-icon-10{font-size:40px;color:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-edge-10{stroke:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .edge-depth-10{stroke-width:-16;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-10 line{stroke:hsl(30, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-7L6RmsR6RdxjUJeA .lineWrapper line{stroke:black;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled circle,#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:lightgray;}#mermaid-svg-7L6RmsR6RdxjUJeA .disabled text{fill:#efefef;}#mermaid-svg-7L6RmsR6RdxjUJeA .section-root rect,#mermaid-svg-7L6RmsR6RdxjUJeA .section-root path,#mermaid-svg-7L6RmsR6RdxjUJeA .section-root circle{fill:hsl(240, 100%, 46.2745098039%);}#mermaid-svg-7L6RmsR6RdxjUJeA .section-root text{fill:#ffffff;}#mermaid-svg-7L6RmsR6RdxjUJeA .icon-container{height:100%;display:flex;justify-content:center;align-items:center;}#mermaid-svg-7L6RmsR6RdxjUJeA .edge{fill:none;}#mermaid-svg-7L6RmsR6RdxjUJeA .eventWrapper{filter:brightness(120%);}#mermaid-svg-7L6RmsR6RdxjUJeA :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 基础阶段 Day 1-5 API 调用 对话循环 工具调用 函数调用 规划Agent 进阶阶段 Day 6-10 LangChain 代码片段 向量数据库 FastAPI 流式输出 深入阶段 Day 11-15 源码分析 多Agent 人机协作 任务追踪 子Agent 记忆阶段 Day 16-18 上下文管理 跨会话记忆 自动提取 18天学习路线

关键突破

  1. Day 1-5:从零开始,学会调用 API,理解 Agent 是什么
  2. Day 6-10:学会用框架,能部署自己的 Agent 服务
  3. Day 11-15:理解多 Agent 协作,学会任务管理
  4. Day 16-18:掌握记忆系统,让 Agent 拥有长期记忆

八、总结

今天学了 3 个核心概念,用 Java 的话说就是:

概念 Java 类比
记忆自动提取 AOP 切面拦截
实体提取 正则表达式匹配
记忆去重 数据清洗

一句话总结:记忆自动提取 = 从对话中无感识别关键信息,像 AOP 切面一样自动处理。


下一步

Day 19 可能的主题:

  • 记忆衰减:旧记忆逐渐遗忘
  • 记忆共享:多个智能体共享记忆
  • 记忆可视化:记忆的图形化展示

写在最后

18 天了,从一个 Java 程序员,慢慢摸到了 AI Agent 的门道。

学习这件事,最难的不是知识本身,而是坚持。

有人陪你学,有人给你反馈,有人帮你整理 -- 这就是和 AI Agent 一起学习的意义。

继续加油


🤖 系列:Java工程师转AI Agent 3个月学习计划

👤 作者:宸丶一 | 28岁Java程序员,正在学习 AI Agent 开发中ing...

💬 个人格言: 代码改不改变世界我不知道,但先让我准时下班。

如果觉得有帮助,点个赞再走呗!