Closed gbaian10 closed 3 months ago
Metadata was designed for tracing (instrumentation) rather than control flow.
Configurable parameters are meant for actual configuration of the graph / runnable execution.
We log primitive values as metadata since that's useful for observability.
But I do see how that's non-obvious just by looking at the config
Because I observed before that the metadata has the Configurable I entered, and its contents are very clean.
It was easy for me to find all the values I passed in, until I discovered that it seemed to only save the contents of the basic type.
In short, metadata should be an attribute used for langchain internal program tracking.
If the user passes some data to Node and want to use it in Node, should it always be through Configurable?
The input would either be in the configuration or the state. Typically configuration is things like IDs, selecting the model type, etc., whereas state is things like messages, documents, database connection, etc.
Thank you for your answer, I will close this issue.
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Description
When I use
config["metadata"] seems to only save basic types of content?
Is this normal output? What is the principle of saving metadata? When should I use
metadata
orconfigurable
?configurable
contains a lot of information, whilemetadata
is much cleaner. I encountered this problem when trying to usemetadata
to get some of my own data.When I use metadata to input, all values can be obtained normally.
System Info
langgraph == 0.1.5 langchain == 0.2.6 python version == 3.10.12