Files
nexus/wiki/concepts/Token-Light-Design.md

41 lines
1.3 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: "Token-Light Design"
type: concept
tags: [optimization, memory, cost-efficiency]
sources: [overnight-mini-app-builder]
last_updated: 2026-04-22
---
## Definition
Token-Light Design 是一种 AI Agent 记忆系统的令牌优化策略——保持高频加载文件(如 `AUTONOMOUS.md`)在精简行数以内,避免每次心跳轮询时消耗过多上下文令牌,从而降低 LLM 调用成本。
## Aliases
- Token 优化
- 令牌效率设计
- Lightweight Memory File
## Core Principle
**AUTONOMUS.md 应保持在约 50 行以内**,包含:
- 目标(一行描述)
- 开放待办 backlog简洁列表
已完成的任务**不**存入高频文件,而是:
- 追加到 `memory/tasks-log.md`append-only仅需要时读取
- 或存档到专用文件(按需读取)
## Why It Matters
在 OpenClaw 等框架中:
1. 每次心跳轮询heartbeat poll需要加载 `AUTONOMOUS.md`
2. 文件越大 → 上下文越长 → 令牌越多 → 成本越高
3. 已完成任务长期积累会使文件膨胀
## Key Relationships
- [[Sub-Agent Race Condition]] — 两者共同构成 AUTONOMOUS.md 的最佳实践
- [[Cumulative Memory]] — 对立面:强调累积记忆的丰富性
- [[overnight-mini-app-builder]] — 本概念的来源场景