feat(sdk): support headless tools#2192
Open
Christian Bromann (christian-bromann) wants to merge 17 commits intomainfrom
Open
feat(sdk): support headless tools#2192Christian Bromann (christian-bromann) wants to merge 17 commits intomainfrom
Christian Bromann (christian-bromann) wants to merge 17 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 8b44f26 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@langchain/langgraph-checkpoint
@langchain/langgraph-checkpoint-mongodb
@langchain/langgraph-checkpoint-postgres
@langchain/langgraph-checkpoint-redis
@langchain/langgraph-checkpoint-sqlite
@langchain/langgraph-checkpoint-validation
create-langgraph
@langchain/langgraph-api
@langchain/langgraph-cli
@langchain/langgraph
@langchain/langgraph-cua
@langchain/langgraph-supervisor
@langchain/langgraph-swarm
@langchain/langgraph-ui
@langchain/langgraph-sdk
@langchain/angular
@langchain/react
@langchain/svelte
@langchain/vue
commit: |
eda9b47 to
87af3e9
Compare
Member
Author
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.

This enables browser tools on the SDK side.
Most AI agents run entirely server-side, which means they can't touch the device in front of the user: no GPS, no clipboard, no camera, no local storage. Headless tools solve this by splitting tool execution across the boundary. The agent (on the server) decides when to call a tool and what arguments to pass — but the actual execution happens in the browser, where those APIs live. The result is sent back and the agent continues as if the tool had run locally.
The mechanism uses LangGraph's existing interrupt/resume primitive, so no new server infrastructure is needed. When the agent calls a headless tool, the graph pauses and emits an interrupt with the tool call details.
useStreampicks this up, runs the registered implementation in the browser context, and resumes the graph with the result — automatically, with no manual interrupt handling required by the app developer.Tools are defined without an implementation on the server using
tool()fromlangchain/tools. The client wires up the implementation separately via.implement():The hook handles interrupt detection, execution, error propagation, and resume internally.
To demonstrate the pattern end-to-end, this PR ships two examples:
put,get,list,search,forget) persist context across sessions with data that never leaves the device.<canvas>element directly via sixteen drawing tools (shapes, paths, gradients, transforms, filters). All rendering happens client-side with no image round-trips to the server.Related
tool()headless tool primitive in LangChainJS: langchain-ai/langchainjs#10430