Accumulating a pydantic response model

I have an agent based on the structured_agent.py example. Given a single message containing most of the information it successfully fills in the data structure - a UserProfile.

I want to be able call the agent with more messages later which might include additional information to be added to the profile.

I could just call the agent - get the new fields filled in and then merge the objects. But I seems neater to somehow give the agent the partially completed record - it can then add and update any new information.

how best to provide this partial record? context, a function, additional messages ?

Follow up question - how best to hook another agent or tool into the flow after a message response has been generated - i.e I want to process the response the same way Memory does but also want to update a structured database record.

Hi @avowkind
Thanks for reaching out and for using Agno! I’ve looped in the right engineers to help with your question. We usually respond within 24 hours, but if this is urgent, just let us know, and we’ll do our best to prioritize it.
Appreciate your patience—we’ll get back to you soon! :smile:

Hi @avowkind

You can provide context yes, but if you use history/memory then it should remember that previous information and then you can just ask it to always provide you the updated context. See here

If you want to use a 2nd agent, in this case workflow would make sense, or you can simply feed the response to a 2nd agent as a prompt and have it process it for whatever other uses you have. See here.
If you mean you want to have the same agent update your DB, then you can use the SQLTool?