Files
myWiki/concepts/ramsey-context-cache.md

35 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Ramsey Context Cache拉姆齐上下文缓存"
created: 2026-05-11
updated: 2026-05-11
type: concept
tags: [agent-architecture, caching, context-design]
sources: [[ramsey-context-construction]]
---
# Ramsey Context Cache拉姆齐上下文缓存
## 定义
拉姆齐上下文缓存是基于 [[ramsey-context-graph|拉姆齐上下文图]] 的三层缓存架构,利用 [[ramsey-theory|拉姆齐理论]] 的存在性保证实现 O(1) 上下文命中。
## 三层机制
| 层级 | 职责 | 触发条件 |
|------|------|----------|
| **缓存池维护** | 动态计算节点间的红/蓝边 | 节点增删事件 |
| **必然团监控器** | 追踪最大蓝色团大小,确保 ≥ t_target | 周期性 / 团大小跌破阈值 |
| **上下文命中** | 从预计算蓝色团直接输出上下文骨架 | 每次请求 |
## 安全边界
- R(3,3) = 6维持 6 个原子 → 保证存在可用 3-节点团
- R(4,4) = 18维持 18 个原子 → 保证存在可用 4-节点团
- 缓存大小维持在略大于 R(t_target, m_max) 的水平
## 相关概念
- [[ramsey-context-graph|拉姆齐上下文图]]
- [[context-blue-clique|上下文蓝色团]]
- [[prompt-caching|Prompt Caching]]