Sydney Runkle’s Post

Day 2 of my harness engineering series: dynamic configuration Your agent's model, tools, and system prompt don't have to be fixed at creation time: middleware lets you reshape them at every step based on user or conversation context. One example: LangChain's built-in LLMToolSelectorMiddleware runs a fast secondary model to filter your tool registry before the main call. Only the relevant tools make it into context. This reduces context bloat and can improve model performance.

  • text

Leonardo B. de Avila, Pablo Botton da Costa, Raphael Martins Freitas uma ideia para melhorar a seleção da ferramenta, primeiro reduz o contexto para um número menor de ferramentas e depois passa pelo processo de decidir a ferramenta!

This is awesome! I'm a huge fan of Langchain's middleware, and how it let's you control the agent's behaviour. Especially the ToDoList middleware for my simple planning agents (which almost feels playful when using and makes watching the agent even more fun!) 🥰

Like
Reply

This is cool. I already filter tools with a nano agent in the loop attaching to model on the runtime. This feels super easy with the middleware abstraction, gonna try this soon!

Like
Reply

This is great! Sydney Runkle I want to ask if this approach wont break prompt caching

Pls re-do claude-code but with langchain

Going to have to test drive this 🧐

Like
Reply
See more comments

To view or add a comment, sign in

Explore content categories