Agent context not working

my agent stores the session in json and im created a function to sort out the stored session based on current user input i used rapidfuzz to select most relevant and similar session and provided it as context but when i see the debug log the context always goes empty my function to sort the stored data / session must be not working thats why but im trying to find the issue but i want to ask if anybody has a better and simpler way to do it ? if you have any idea or better way tell me also keep in mind dont use llm for sorting the session

Hi @Prajwal
Thank you for reaching out and using Phidata! I’ve tagged the relevant engineers to assist you with your query. We aim to respond within 48 hours.
If this is urgent, please feel free to let us know, and we’ll do our best to prioritize it.
Thanks for your patience!

Hey @Prajwal that is a very neat use case!
Phidata agents come with inbuilt memory. Please read more here: Memory - Phidata. Currently we are limited to OpenAI for creating memories.

Since I have no idea about the working of your custom function, I cannot provide any help to debug. Something I can share though is that getting similar strings to another string can be tricky. Make sure you are only getting the similarity score based on the user message. It might also help to tokenize the the message and remove stop words.

1 Like