Skip to content

Commit 8f965ae

Browse files
committed
feat: Add a comprehensive token efficiency report detailing ACFS agent tool strategies for context management.
1 parent 74994e1 commit 8f965ae

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

docs/TOKEN_EFFICIENCY_REPORT.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Token Efficiency of ACFS Agent Tools
2+
3+
This report evaluates the token efficiency and context management strategies of the ACFS (Agentic Coding Flywheel Setup) toolchain.
4+
5+
## Executive Summary
6+
7+
The ACFS architecture utilizes a **defense-in-depth strategy for token efficiency**:
8+
9+
1. **Offload**: Move state and reasoning out of the context window (Agents, Beads).
10+
2. **Retrieve**: Fetch only what is needed, when it is needed (CASS, Meta Skill).
11+
3. **Compress**: Optimize the format of data injected into the context (Toon, S2P, MDWB).
12+
4. **Refine**: Iterate on plans cheaply before committing to expensive code generation (APR, Brenner).
13+
14+
## 1. Offload: "Offline Compute, Online Context"
15+
16+
| Tool | Strategy | Efficiency Impact | Mechanism |
17+
| ------------------------------ | ----------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
18+
| **MCP Agent Mail** | Archival Storage | ⭐⭐⭐⭐⭐ (Very High) | Messages stored in SQLite, not session history. Agents pull specific threads/inbox items on demand. |
19+
| **Beads (br/bv)** | Graph Triage | ⭐⭐⭐⭐⭐ (Very High) | `bv` computes PageRank/critical paths locally. LLM receives a <500 token JSON summary instead of 100+ raw issues. |
20+
| **Repo Updater (ru)** | Automated Commits | ⭐⭐⭐⭐ (High) | `ru agent-sweep` handles commit generation and message writing, offloading this repetitive "housekeeping" from the main agent's context. |
21+
| **Coding Agent Usage Tracker** | Visibility | ⭐⭐⭐ (Indirect) | `caut` provides visibility into token usage, allowing developers to identify and optimize inefficient workflows. |
22+
23+
## 2. Retrieve: "Just-in-Time Knowledge"
24+
25+
| Tool | Strategy | Efficiency Impact | Mechanism |
26+
| -------------------- | ------------------ | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
27+
| **CASS** | Semantic Search | ⭐⭐⭐⭐ (High) | Indexes past sessions. Agents search/retrieve specific snippets (`--limit N`) rather than loading full logs. |
28+
| **Meta Skill (ms)** | Hybrid RAG | ⭐⭐⭐⭐⭐ (Very High) | Manages skills/docs via RAG. Uses Thompson sampling to surface the most effective tools/docs, keeping the system prompt lean. |
29+
| **Cass Memory (cm)** | Procedural Memory | ⭐⭐⭐⭐⭐ (Very High) | Distills lessons into rules. Injects only ~5 relevant rules per task, preventing repetitive debugging loops. |
30+
| **Brenner Bot** | Research Synthesis | ⭐⭐⭐⭐⭐ (Very High) | Manages a "Primary Source Corpus" of citations. Agents query this corpus rather than holding entire papers in context. |
31+
32+
## 3. Compress: "High-Density Context"
33+
34+
| Tool | Strategy | Efficiency Impact | Mechanism |
35+
| -------------------------- | ------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------- |
36+
| **Toon Rust (tru)** | Token Optimization | ⭐⭐⭐ (Medium) | Converts specialized data structures into "Token-Optimized Notation" (TON), reducing token count compared to raw JSON/XML. |
37+
| **Source to Prompt (s2p)** | Context Packing | ⭐⭐⭐⭐ (High) | selecting/packing code files with real-time token counting, ensuring "budget-aware" context construction. |
38+
| **Markdown Web Browser** | Content Reduction | ⭐⭐⭐⭐ (High) | Converts heavy HTML/JS websites into clean, token-efficient Markdown, stripping ads/boilerplate. |
39+
| **JeffreysPrompts (jfp)** | Prompt Optimization | ⭐⭐⭐⭐ (High) | Provides "battle-tested" prompts that are optimized for specific models, reducing trial-and-error token waste. |
40+
41+
## Conclusion
42+
43+
ACFS treats the **Context Window as a Scarcity**. By combining offline storage (SQLite), local compute (Graph algorithms, RAG), and optimized formats (Markdown/TON), it enables agents to tackle complex, long-running projects that would otherwise be impossible or prohibitively expensive.

0 commit comments

Comments
 (0)