Best way to get semantic recall messages in agent.generate() output
Where can I see what messages have been fetched and added to the agent context by semantic recall when I call agent.generate()?? The steps array's first object request body input doesn't have any messages from semantic recall (other than the system and user messages)
6 Replies
also, does tool call filter exclude tool call messages from semantic recall too?
📝 Created GitHub issue: https://github.com/mastra-ai/mastra/issues/9635
GitHub
[DISCORD:1434550517509521549] Best way to get semantic recall messa...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1434550517509521549 Where can I see what messages have been fetched and added to the agent context by sema...
Hi @Meghdip Karmakar ! Do you mean programmatically?
yep, in the return value of agent.generate
You can access all the messages that were sent to the LLM like this:
There is, however, no way to know which messages were brought into the context via the semantic recall mechanism, you can only get all the messages that were sent.
I think you can manually query the embeddings with the input prompt though, kind of like what we're doing in studio where we show you the result of the semantic recall search on the right side of the agent's chat
hmm, this shows all the messages that were ever passed as input to the llm in all the steps
getting the first step's request body input only shows the user messages, no semantic recall messages were being passed (at least from what's shown in the request body)
the history mostly has tool call messages and tool result output, so it should include some past messages if semantic recall was working correctly. Does tool call filter perhaps also exclude the semantic recall output as well?