It is confusing that create_agent requires all tools to be defined upfront.
I was surprised to see that the State has to be defined in the middleware. Maybe the docs for LangChain v1 could explain why that is the case in greater details, and how to leverage this.
The types and objects we use there (runtime, request, handler) were quite a headache. Sometimes I was wondering where I had to get the state from, etc… Somehow I think the concept of State is less important in v1 than in v0.x, but it creates a bit of complexity.
This is the first project I do in plain v1 from scratch, so this might be the normal learning curve.
It is confusing that create_agent requires all tools to be defined upfront.
We might relax this requirement in the future. It hasn’t come up in the past as a feature that folks need.
I was surprised to see that the State has to be defined in the middleware. Maybe the docs for LangChain v1 could explain why that is the case in greater details, and how to leverage this
It doesn’t have to be, you can define provide state as a parameter to create_agent.
The types and objects we use there (runtime, request, handler) were quite a headache. Sometimes I was wondering where I had to get the state from, etc… Somehow I think the concept of State is less important in v1 than in v0.x, but it creates a bit of complexity.
The request and handler were introduced to raise the ceiling of what can be done in the hook (e.g., retries, rate limiting, fallbacks, short-circuiting, caches, running requests in parallel with different models). All of this functionality is enabled by request and handler. So the ceiling in terms of what you can do is very high here!
What would you suggest we improve or which parts did you not like in this API?
Apart from allowing tools declaration/discovery mid-run, I think most of what can be improved is related to the docs and examples. If you can nail those, then the API is pretty well designed. I simply wanted to share how it felt (for me) right now - it doesn’t necessarily mean you made incorrect choices. Thanks for answering.
The only one I can think of is using a real Claude Skill approach where you basically have only one tool (command line) and this command line tool calls your other tools. This is really not something I advize you to do (since mistakes are likely), but until langchain moves… I don’t know.