File size: 5,457 Bytes
d9dd82c 76501a1 d9dd82c 49ff316 d9dd82c 76501a1 d9dd82c 76501a1 d9dd82c 76501a1 d9dd82c 49ff316 76501a1 d9dd82c 76501a1 d9dd82c 76501a1 d9dd82c 76501a1 d9dd82c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | ---
language:
- zh
- en
license: gpl-3.0
tags:
- agent
- kv-cache
- compression
- memory-management
- deepseek
- harness
- plugin
- autonomous-agent
---
# AgentFrame v3 ยท ๅ
ๆ (Xianming) โ ็ฌฌไธไปฃ้ข่ง็
**่ = DeepSeek ยท ๆ = ๅทฅๅ
ทๆง่ก ยท ่ฎฐๅฟ = ๅๅฑ่ชไธป็ฎก็ ยท ๅฃณ = DeepSeek Harness**
> v3 ๆ ธๅฟๅ็บง: **ๆดๅ DeepSeek Harness** โ AgentFrame ็่ฎฐๅฟ็ณป็ปๆไธบ
> DeepSeek ๅฎๆน Agent ๆกๆถ็ๅ็ผฉๅ็ซฏๆไปถ (`dsh-compaction-agentframe`)
>
> ็ถๆ: ้ข่ง็ (Preview) ยท ่ฟญไปฃไธญ
---
## v3 ๆฐ็นๆง: DeepSeek Harness ๆดๅ
DeepSeek Harness (`github.com/deepseek-ai/deepseek-harness`) ๅผๆบๅ๏ผ
AgentFrame ไฝไธบ **compaction ๅ็ซฏๆไปถ**ๆฅๅ
ฅ๏ผๅฎ็ฐ"ไธๅ็ๆไปถ"๏ผ
```
DeepSeek Harness (dsh) AgentFrame (ๅ
ๆ)
โโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
โ ctx.compaction (seam) โ โ ๆฟๆข โ โ compaction-agentframe โ
โ compaction-basic (้ป่ฎค) โ โ ่ฏญไน่ฝจ: MemoryDirectorโ
โ LLM ๆ่ฆๅ็ผฉ โ โ ็ฉ็่ฝจ: MLA+INT4 โ
โ surface/ไบไปถ/ๆไน
ๅ โ ไฟๆๅฅ็บฆ โ 28.4x KV ๅ็ผฉ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ
```
### ๆฅๅ
ฅๆนๅผ (ไธ่ก้
็ฝฎ)
```yaml
# profile ็ cordis.patch.yml
- id: compaction-agentframe
name: '@deepseek-ai/dsh-compaction-agentframe'
config:
semantic: true # ่ฏญไนๅ็ผฉ (MemoryDirector ๆ่ทฏ)
retainRatio: 0.2 # ไฟ็ 20% ๅ
ณ้ฎไฟกๆฏ
physical: true # ็ฉ็ๅ็ผฉ่ฎฐ่ดฆ (7776B/token)
```
### ๆไปถ้ช่ฏ็ปๆ (smoke test)
```
ctx.compaction = registered (ๅผๆๆณจๅๅฐ Cordis)
compactIfNeeded / compactNow / compactRegion ๅ
จๅฎ็ฐ
่ฏญไนๅ็ผฉ: ้ฒ่"ไปๅคฉๅคฉๆฐไธ้" โ ๅ้ค
่ฏญไนๅ็ผฉ: ๅ
ณ้ฎไปฃ็ "socket / ConnectionError" โ ไฟ็
```
---
## ๆถๆ (ไธไปฃๆผ่ฟ)
| ็ๆฌ | ๆ ธๅฟ | ็ช็ ด |
|------|------|------|
| **v1** | ๅๅฑๆตๆฐด็บฟ (่ฎค็ฅ/่ทฏ็ฑ/ๅญๅจ/็ฉ็) | ๆกๆถๅ |
| **v2** | MemoryDirector ่ชไธป่ฎฐๅฟ | ๆจกๅ่ชๅทฑๅณๅฎ่ฎฐไปไนๅฟไปไน |
| **v3 ๅ
ๆ** | **DeepSeek Harness ๆดๅ** | ๆไธบๅฎๆน Agent ๆกๆถ็ๅ็ผฉๆไปถ |
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DeepSeek Harness (ๅฃณ) โ
โ Agent loop / Session log / Tools / Sandbox โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ AgentFrame (่ฎฐๅฟ) โ โ
โ โ โโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโ โ โ
โ โ โ่ฏญไน่ฝจ โโโ็ฉ็่ฝจ โโโ ๆฃ็ดข/้ๅฟ โ โ โ
โ โ โDirectorโ โMLA+INT4 โ โ Auraๆฒ็บฟ โ โ โ
โ โ โโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
## ๆ ธๅฟ่ฝๅ (v1+v2 ไฟ็)
| ่ฝๅ | ่ฏดๆ | ้ช่ฏ |
|------|------|------|
| **KV ๅ็ผฉ** | ๅธๆถๅผ MLA + INT4 = **28.4x** | L40S ๅฎๆต |
| **่ฏญไน่ธ้ฆ** | MemoryDirector 3.2x (67โ21 tokens) | API ๅฎๆต |
| **ๆปๅ็ผฉ** | ~113x (27MB โ 235KB) | |
| **Top-K ไฟๆค** | ๅ
ณ้ฎๅ 16bit + ๅ
ถไฝ 4bit = 0/100 ็ฟป่ฝฌ | |
| **Aura ้ๅฟ** | S(t)=Iยท2^(-t/ฯ) ๆๆฐ้ๅฟ | |
| **3-Agent ้ช่ฏ** | ่ฎจ่ฎบๅฎค + ๅนป่งๆฃๆต + ๅฅๆฉ | |
## ๅฟซ้ๅผๅง
### AgentFrame ๆฌไฝ (Python)
```bash
pip install -e agentframe/
export AGENTFRAME_API_KEY="sk-xxx"
python3 -m agentframe.cli demo
python3 -m agentframe.cli ingest "็ฅ่ฏ" --tags kv
python3 -m agentframe.cli ask "้ฎ้ข"
```
### dsh ๆไปถ (TypeScript)
```bash
# ๅจ deepseek-harness ไปๅบๅ
cd packages/compaction/compaction-agentframe
pnpm install
npx tsc -b tsconfig.json # ็ผ่ฏ
npx tsx tests/smoke.ts # ้ช่ฏ
```
### Python ๅบๆนๅผ
```python
from agentframe.config import AgentFrameConfig
from agentframe.core.engine import ContextEngine
eng = ContextEngine(AgentFrameConfig.from_env())
r = eng.ask_autopilot("ๆ็ๆๅกๅจ IP ๆฏ 98.142.241.130")
print(r.meta["memory_decision"]) # ่ชไธป่ฎฐๅฟๅณ็ญ
```
## ๅๅธๅ
ๅฎน
```
AgentFrame-v3-preview/
โโโ agentframe/ # AgentFrame ๆฌไฝ (Python, v3.0.0-preview)
โ โโโ core/ # ๅๅฑๆ ธๅฟ + MemoryDirector
โ โโโ llm/ embed/ api/ cli.py
โ โโโ README.md
โโโ dsh-plugin/ # DeepSeek Harness ๆดๅๆไปถ
โโโ compaction-agentframe/
โโโ src/index.ts # ๅ็ผฉๅผๆ (็ปงๆฟ CompactionEngine)
โโโ lib/ # ็ผ่ฏไบง็ฉ
โโโ tests/smoke.ts # ้ช่ฏๆต่ฏ
โโโ README.md
```
## License
GPL-3.0 ยฉ Cloud LTE Studio
*AgentFrame v3 ๅ
ๆ ยท ่ๆๅฃณไธไฝ ยท ไธไธๆๆฐธไธไธขๅคฑ*
|