Replies: 1 comment
-
(tricky part is each tool might want different separator on RAG ---- still locking for a nice solution) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked
Feature request
Idea is to build a new 'RunnableSerializable[PromptValue, PromptValue]' class, taking the original prompt as input, and scan all tool messages. If this tool message is never retrieved and its content size exceeds some threshold, then use RAG to get the most relevant text split, and return the retrieved content of tool messages. Also, we need to add some prefix (like "retrieved_") in the function names of the tool calls in the messages and the tools properties of the prompt, to identify the message which is already being retrieved in order to prevent duplicated RAG (and therefor embedding calls).
Or maybe just retrieve the last incoming tool call.
The chain of the new concept would look like this:
RunnablePassthrough.assign(...) | prompt | ToolCallMessageRetriever() | llm_with_tools | OpenAIToolsAgentOutputParser()
Do you have better ideas or is there already something that was already implemented/planned in langchain / langgraph to do this trick?
Motivation
To solve the issue, that the tool calls can return large texts which the LLM can't handle
Proposal (If applicable)
#25527
Compared to implementation in the PR, this new concept can implement the tool message retriever in one RunnableSerializable class, instead of having them implemented in multiple tools.
Beta Was this translation helpful? Give feedback.
All reactions