| --- |
| 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 ๅ
ๆ ยท ่ๆๅฃณไธไฝ ยท ไธไธๆๆฐธไธไธขๅคฑ* |
|
|