LangChain Adds Controls That Tie AI Agent Tools to Their Instructions
The Deep Agents update also lets apps preload selected skills and refresh ongoing conversations. Keeping cached prompts intact depends on the model and the operation.
Loading page…
The Deep Agents update also lets apps preload selected skills and refresh ongoing conversations. Keeping cached prompts intact depends on the model and the operation.
Listen to this story
LangChain’s latest deepagents package gives developers more control over when an agent can access tools and which skills enter an ongoing conversation. Binding tools to a skill makes them available only after the agent reads that skill; applications can instead preload chosen skills or rescan a library between runs. The controls help keep context focused and libraries current, but cache behavior has limits: preserving the prompt cache for mid-conversation tools depends on model support, while a refresh that finds new skills can invalidate it.
Developers bind tools by listing them in a skill’s metadata.include_tools and passing them to SkillsMiddleware.
A custom function can map a skill label to tools and check the current user’s permissions before exposing them.
Applications select pinned skills through pinned_skills; Deep Agents does not interpret user commands to choose them.
Giving an AI agent instructions for a tool did not ensure it would read them before using it. LangChain’s October 7 Deep Agents update ties those steps together. It also lets applications preload selected instructions and refresh skill libraries during ongoing conversations. LangChain says all three capabilities are available in the latest deepagents package.
A skill is a folder containing instructions, scripts and reference material for a particular task. Deep Agents initially shows the model each skill’s name and description, rather than its full contents. The agent reads the instructions when needed, then retrieves supporting files as the task requires them, keeping less material in the model’s working context.
Previously, skills and tools were disclosed separately. An agent could discover and call a tool without reading the skill explaining it, or read a skill and still need to search for its tools. Binding them makes the instructions and the tool’s schema—the description of how to call it—load together.
Developers list the tools under metadata.include_tools in the skill file and pass them to SkillsMiddleware, the component managing skills, rather than directly to the agent. For more control, a developer-supplied function can turn a label into a group of tools and check the current user’s permissions before returning them.
LangChain says newer Anthropic and OpenAI models can accept those tools mid-conversation without changing the cached prompt prefix, the earlier input saved for reuse. Other models still receive the tools through an updated request tool list. The cache-preserving behavior therefore depends on model support.
Pinning handles a different case: the user already knows which skill they want. An application can pass selected names through pinned_skills, putting their instructions and bound tools into the conversation before the next model call. In LangChain’s meeting-preparation example, that lets work begin on the first call instead of requiring another call to read the skill.
Deep Agents does not parse the user’s message itself; the application chooses how a command or interface selects skills. Each pinned skill is inserted once as a tagged message, leaving earlier messages unchanged and preserving the prompt cache.
Skill libraries previously loaded at the start of a conversation thread and stayed in its state for later turns. Applications can now set skills_metadata to None to make the next run rescan the library, picking up added, edited or deleted skills without starting a new thread.
The application decides when that refresh happens and can expose it through a user command. There is a cache tradeoff: a reload that discovers new skills changes the system prompt and invalidates its cache. Unlike tool binding on supported models, keeping the library current can require rebuilding cached input.
Loading discussion...
Join the conversation
Explain when explicit control would be worth the extra step.
Be the first to share a perspective or an experience.
Reader comments
Newest comments first. Replies stay oldest first.