class BasicChatState(TypedDict):
user_query: Optional[str]
messages: Annotated[list, add_messages]
instructions: Optional[str]
In an earlier node (rag_node), I add some text to state["instructions"].
Now, in the agent_node, I want to access this instructions value from the state and pass it along with the system prompt (so the agent system prompt is dynamically extended with the instructions).
@heisenberg-7 @pawel-twardziak
Thank you both for your help! I was able to find a different approach to get the desired result. Here’s the solution I came up with: