Skip to content

docs(deepagents): document tool exclusion as a context compression technique#4960

Open
Faizan Ali (Engr-FaizanAli) wants to merge 1 commit into
langchain-ai:mainfrom
Engr-FaizanAli:docs/tool-exclusion-context-compression
Open

docs(deepagents): document tool exclusion as a context compression technique#4960
Faizan Ali (Engr-FaizanAli) wants to merge 1 commit into
langchain-ai:mainfrom
Engr-FaizanAli:docs/tool-exclusion-context-compression

Conversation

@Engr-FaizanAli

Copy link
Copy Markdown

Overview

Documents HarnessProfile(excluded_tools=...) as a third context-compression technique alongside offloading and summarization, since it does the same job (reducing what's sent to the model per turn) but wasn't cross-referenced from that section.

The "Context compression" section on the context-engineering page only listed offloading and summarization as built-in mechanisms for reducing context/token usage, even though HarnessProfile's excluded_tools does the same job (removing tool schemas from every request) and was previously only documented as a "tool visibility" feature in the Tool prompts section with no cross-reference here.

Adds a third "Tool exclusion" card and subsection alongside Offloading and Summarization, showing the register_harness_profile usage and noting it's a static reduction (decided ahead of time) rather than a dynamic, threshold-triggered one like the other two.

Type of change

Type: Update existing documentation

Related issues/PRs

Checklist

  • I have read the contributing guidelines, including the language policy
  • I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • I have updated navigation in src/docs.json if needed

Additional notes

No docs.json changes needed — this adds a subsection/anchor to an existing page, not a new page. Verified with uv run python scripts/check_cross_refs.py — no new unresolved references introduced (the one pre-existing failure, in an unrelated JS provider page, is untouched by this change).

The code example mirrors a pattern verified in real use: excluding 4 unused built-in tools (write_file, edit_file, execute, write_todos) from a read-only search agent measured a ~20-30% reduction in total tokens on a real multi-turn task, with no change in agent behavior since those tools were never being called.

…chnique

The "Context compression" section on the context-engineering page only
listed offloading and summarization as built-in mechanisms for reducing
context/token usage, even though HarnessProfile's excluded_tools does the
same job (removing tool schemas from every request) and was previously
only documented as a "tool visibility" feature in the Tool prompts
section with no cross-reference here.

Adds a third "Tool exclusion" card and subsection alongside Offloading
and Summarization, showing the register_harness_profile usage and noting
it's a static reduction (decided ahead of time) rather than a dynamic,
threshold-triggered one like the other two.

Related to langchain-ai/deepagents#616.
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for opening a docs PR, Faizan Ali (@Engr-FaizanAli)! When it's ready for review, please add the relevant reviewers:

  • @npentrel or @lnhsingh (Deep Agents)

@github-actions github-actions Bot added deepagents For docs changes to Deep Agents oss external User is not a member of langchain-ai labels Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepagents For docs changes to Deep Agents external User is not a member of langchain-ai oss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant