howtos/How to add few-shot prompt to an agent with memory and tool usage? #28664
Replies: 1 comment 4 replies
-
Hey there, @BEbillionaireUSD! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this together! To combine an agent with bonded tools and memory using
This setup allows the agent to use tools and maintain a conversational context with memory, while also allowing you to modify the state with a custom function. The use of To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Components
ToolMessage
Specifically, I'm wondering how to combine an agent with bonded tools and memory
with few-shot prompt like the example in https://python.langchain.com/docs/how_to/tools_few_shot/:
That means, I would like to either edit
state_modifie
when callingcreate_react_agent
Or add memory to a chain
chain = {"query": RunnablePassthrough()} | few_shot_prompt | llm_with_tools
Beta Was this translation helpful? Give feedback.
All reactions