Maintain conversation history in agent sdk

I am developing a multi agent application. Where the triage agent understands the user query and routes it to the appropriate agent.

The main use case is for a chat application whereby a user might request how to do x or needs information on y and the specialist agent then will handle each one.

The trouble I am having is understanding how to maintain the conversation history for a given user in the agents sdk.

For the responses API I know there is the response_id but it’s not clear if there is an equivalent for agents sdk.

Also the context class I have read is not passed to the LLM.

Ideally I want all my agents to have the users past conversation history.

Any pointers are much appreciated!

2 Likes

I understand because I got the same problem and the solution is not explicit. However, when you pass the input to the agent you just do:

result.to_input_list() + [{"role":"user", "content": user_message}]

That’s it