docs(deepagents): document tool exclusion as a context compression technique#4960
Open
Faizan Ali (Engr-FaizanAli) wants to merge 1 commit into
Conversation
…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.
Contributor
|
Thanks for opening a docs PR, Faizan Ali (@Engr-FaizanAli)! When it's ready for review, please add the relevant reviewers:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'sexcluded_toolsdoes 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_profileusage 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
docs devsrc/docs.jsonif neededAdditional notes
No
docs.jsonchanges needed — this adds a subsection/anchor to an existing page, not a new page. Verified withuv 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.