Open
Description
Hi
I'm implementing a web based chatbot using FastApi and OpenAI agents.
The agent is hooked up with an SSE MCP server.
self.agent = Agent(
name="Assistant",
instructions="Use the tools to interact with the API.",
mcp_servers=[self.mcp_server],
)
At present I maintain Agent in global state..so the same agent instance is used across requests.
So far I have not noticed any issues in terms of reusing the same agent instance.
But is this a good idea?
Are there any potential issues I need to be wary of?
I'm in an early stage of exploring this space, so would appreciate any guidance on this.
Thanks
Jaydeep