sessionId reach the same running instance of your agent, so anything it holds in memory between calls is still there. A session is not stored conversation memory: that is your agent’s to keep.
Use a session
Send your own key, 1 to 256 characters, on every call of a conversation:sessionId out and Onecortex generates one. It comes back in the response body, in done, and in the X-Onecortex-Session-Id header, so you can send it next time. Your value is echoed back exactly as you sent it.
Use anything stable for the conversation: a chat ID, a ticket number, a user ID. Onecortex never passes your value to the runtime as it is. It derives an internal identifier from the agent and your key, so the same key used with two agents reaches two separate instances, and your IDs never appear in any infrastructure.
What a session keeps
Your agent’s process, and everything in its memory: a LangGraph in memory checkpointer, a Strands agent’s message list, a cache you built, a variable at module level. LangGraph’sthread_id is set from the session, so a graph compiled with a checkpointer remembers the conversation per session with no code. See LangGraph.
When it starts fresh
A session’s instance stops, and the next call with the samesessionId starts a new one with empty memory:
- after 15 minutes with no calls;
- after 1 hour, however busy;
- when a new version goes live, or you roll back.
Memory that lasts
Keep it outside the instance, keyed by your session ID:- LangGraph: compile with a checkpointer backed by your own database.
- Any agent: send the history in
messageson each call, from where your app keeps it, and read it in your agent. See the invoke API. - Your own store: read and write it in your agent, with its credentials as secrets.