Skip to content

Clocktower-and-Associates/LEAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LEAN: Layered Efficiency for Agentic Navigation

A design pattern for token-efficient agent-facing systems.

Every token an agent carries costs money and displaces reasoning capacity. LEAN is a recursive architectural pattern: expose the minimum by default, make depth available on demand, and apply this at every layer of the interaction.


The Core Idea

Most systems are built for humans. They front-load everything: every tool registered at startup, every field in every response, every element on every page. When the consumer is an agent with a metered, finite context window, this is waste.

LEAN replaces "send everything, let the agent filter" with "send the minimum, let the agent expand."

The Five Principles

  1. Default Minimal. The first response is the smallest useful representation, not the smallest possible one.
  2. Depth on Demand. Every minimal representation has a path to full detail. One request away, never forced.
  3. Reversible Depth. Agents can expand and contract. Release context when the task is done.
  4. Layer Independence. Working in detail at one layer doesn't force breadth at another.
  5. State Consistency. Expanding or contracting at any layer never corrupts state at other layers.

The Four Layers

Layer Controls LEAN Approach
Tool Availability What tools are loaded Start with a minimal tool set, activate more at runtime
Content Resolution How much detail the agent sees Orientation first, drill into full detail on demand
Element Resolution How the agent finds specific targets Semantic search returns matches, not catalogs
Response Resolution What comes back after an action Structural diffs, not full state re-sends

Each layer reduces token consumption independently. The savings multiply because they apply to different parts of every interaction. An agent using LEAN across all four layers can consume 5-10x fewer tokens than an equivalent agent using a traditional tool server.

Measured Impact

Early benchmarks from Charlotte (reference implementation):

  • Layer 1 alone: ~48% reduction in tool definition overhead
  • Over a 100-page, 550-call session: ~1.9 million tokens saved
  • Layers 2-4: Structurally similar savings, formal benchmarks in progress

See the full spec, Appendix A, for methodology and validation data.


Where LEAN Applies

LEAN is not specific to any protocol, framework, or integration pattern:

  • MCP servers — Tool profiles, tiered content responses, semantic search, structural diffs
  • ACP manifests — Capability groups in agents.json so agents load tool subsets, not the full catalog
  • ASM content — Site manifests that describe structure at the orientation level, letting agents drill into specifics
  • Any agent-facing system — Anywhere a context window is a finite, metered resource

Where LEAN Doesn't Apply

LEAN optimizes for long sessions, varied complexity, and tasks where most content doesn't need deep inspection. It adds latency (two round trips instead of one) for tasks where the agent always needs full detail. For exhaustive extraction, full-page audits, or five-call sessions, the overhead may not be worth it. The spec addresses these tradeoffs directly.


The Spec Family

LEAN is part of a three-spec family for the agentic web:

Spec Full Name Scope Deliverable
ASM Agent Site Manifest Site-level site block in agents.json
ACP Agent Context Protocol Service-level services block in agents.json
LEAN Layered Efficiency for Agentic Navigation Design philosophy Guides authoring of both

ASM and ACP define what to publish. LEAN defines how to write it efficiently.


Quick Start

If you're building an MCP server:

  1. Group your tools by task type.
  2. Default to the smallest useful group.
  3. Add a meta-tool that activates/deactivates groups at runtime.
  4. You've implemented Layer 1 and captured the highest-leverage savings.

If you're writing an ACP manifest:

  1. Organize tools into capability groups.
  2. Write descriptions at minimum viable length. Be literal, not marketing.
  3. Include output schemas so agents don't guess.
  4. Read Section 4 of the ACP spec for agent-optimized writing guidelines.

If you're writing an ASM manifest:

  1. Describe site structure at the orientation level: sections, capabilities, navigation.
  2. Let agents drill into specific pages rather than front-loading every page's detail.
  3. Use data-asm-* attributes to increase semantic density at the content layer.

Repository Structure

spec/
  LEAN-Spec-v0.3.md                    # The specification
examples/
  mcp-startup-profiles/README.md       # Layer 1 — Charlotte's tiered tool profiles
  content-resolution-levels/README.md  # Layer 2 — Charlotte's detail level system
README.md
LICENSE

Reference Implementation

Charlotte is the reference implementation of LEAN across all four layers. Charlotte is an open-source MCP server for browser automation that implements tiered tool profiles, three-level content resolution, semantic element search, and structural diffing.

Contributing

LEAN is a living specification. Implementation experience, benchmark data, and feedback are welcome.

  • Open an issue to report problems or suggest improvements.
  • If you build a system that follows LEAN principles, we want to hear about it.
  • Benchmark data from real-world agent workflows is especially valuable.

Author

Wesley Shoffner, Clocktower & Associates

License

MIT

About

Layered Efficiency for Agentic Navigation — a design pattern for building token-efficient, agent-facing systems with recursive progressive disclosure

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors