10.3 上下文窗口管理
10.3.1 滑动窗口 (Sliding Window)
history = [...]
# 仅保留最近的 N 轮
if len(history) > 20:
history = history[-20:]10.3.2 递归摘要 (Recursive Summarization)
10.3.3 关键信息提取 (Context Distillation)
10.3.4 RAG-based Long-term Memory
10.3.5 上下文管理的黄金法则
最后更新于
