Skip to main content

AI Agent Runtime : How OIC Gen3 AI Agents Reuse LLM Responses: Tracking, Memory, and Persistence

Calculating read time…

How does an Oracle Integration ReAct agent remember an earlier question after its integration run has finished? Follow one purchase-order conversation from the first question to a follow-up the next day.

The direct answer: Memory_arr_var holds the working message history for the current execution. It can contain user messages, assistant responses, tool requests, tool results, and system instructions. For later executions, the integration saves that history to the conversation store and retrieves it again. A 32-day retention period applies to retained data; it does not keep the variable running for 32 days.

1. What does Memory_arr_var hold?

It holds a sequence of messages, rather than only the latest LLM answer. Each entry has a role and content or related tool-call fields. These messages become the conversation context sent with a model request.

Message role What it contributes
System The agent role and instructions used to guide the conversation.
User The question submitted by the user.
Assistant An LLM reply, or the details of a tool call requested by the LLM.
Tool The result returned by an invoked tool.

The response from one LLM call and the accumulated conversation history are different things. A response contributes selected entries to Memory_arr_var; it does not replace the entire history.

2. One example: check purchase order PO-8421

Assume a procurement agent has a synchronous tool called lookup_order. For this illustrative conversation, the tool returns DISPATCHED. The conversation uses ID PO-CHAT-001.

User: “Check the delivery status of PO-8421.”
Tool result: DISPATCHED
Agent answer: “PO-8421 is dispatched.”
Step What happens What is added to Memory_arr_var
1 The integration looks for saved history for this conversation. Assume this is a new conversation, so no earlier messages are available. The initial system instructions and current user question are added.
2 The first model request includes those messages. The LLM requests an order lookup. An assistant tool-call entry identifying lookup_order, the order number, and the call identifier.
3 The integration invokes the tool and receives DISPATCHED. A tool-result entry containing the returned status, linked to the tool call.
4 The integration calls the LLM again, now including the tool request and result. The LLM can use the returned status to formulate its answer.
5 The LLM answers without requesting another tool. The assistant message: “PO-8421 is dispatched.”

At the end of this exchange, the working history can be understood like this. This is a simplified teaching view, not the exact request format:

System:    Procurement agent instructions
User:      Check the delivery status of PO-8421.
Assistant: Call lookup_order for PO-8421.
Tool:      PO-8421 = DISPATCHED
Assistant: PO-8421 is dispatched.

This answers the first question: the array contains the conversation messages used by the agent, including the LLM’s final answer and the tool exchange. It is broader than an array of LLM responses alone.

3. What happens when the run finishes?

The integration passes the accumulated messages to PersistMemoryToStore. This saves the conversation history outside the working variable, using the conversation’s identity. The identity also includes the project and agent, so the follow-up must address the same agent in the same project.

Once this normal, completed run ends, its variable is no longer an active working variable. A retained execution record may still show captured data for inspection. A later run obtains its conversational context through the conversation-store retrieval path.

Think of a worksheet and a saved document. Memory_arr_var is the worksheet being used during a run. The conversation store is the saved document that another run can open later. Keeping the saved document does not require keeping the original worksheet open.

4. What happens the next day?

The next day, the user asks the same agent, using conversation ID PO-CHAT-001:

User: “Which order did I ask about, and what status did you give me?”
  1. A new integration execution starts with its own working variables.
  2. GetMemoryFromStore retrieves the saved conversation messages.
  3. The retrieved messages are loaded into this execution’s Memory_arr_var.
  4. The integration appends the new user question.
  5. The model request includes the retrieved history and the new question.
  6. The agent can answer: “You asked about PO-8421. I reported that it was dispatched.”
  7. The updated history is saved again for subsequent follow-ups.

The model can identify the order because the integration supplies the earlier messages again. The old execution did not remain running overnight, and the LLM did not permanently learn the order details.

Use this when continuing a conversation: reuse its Conversation ID. A different Conversation ID selects a different conversation. Also, this follow-up asks for the previously reported status. If the user asks for the order’s current status, the agent should perform a fresh lookup.

5. Does 32-day retention keep the variable alive?

No. Oracle states that AI agent data follows the Oracle Integration service instance’s data-retention period. With a 32-day setting, retained conversation data is subject to that policy; the setting does not extend the execution or variable lifetime.

Item Meaning of a 32-day retention setting
Memory_arr_var A working variable belonging to one execution. It is not a variable shared continuously across 32 days of runs.
Saved conversation history Retained service data that later executions can retrieve while it remains available under the retention policy.
Conversation ID The identifier used to associate later requests with the saved conversation. Keeping the ID alone does not preserve deleted history.

In the PO-8421 example, tomorrow’s run can reload yesterday’s history while it is retained. After the relevant history has been purged, the same Conversation ID cannot recover those deleted messages.

Do not assume an exact expiry clock: Oracle’s cited guidance does not specify whether each follow-up resets a conversation-wide 32-day timer. Do not promise “32 days from the latest question” or deletion at an exact minute. The reliable distinction is retained conversation data versus the working variable of an execution.

6. Why is addToMemories false on addLLMResponseToMemory?

The activity name can be misleading if read on its own. The standard flow uses separate activities to record the model response and to add the appropriate messages to working memory.

Activity Purpose in the PO-8421 conversation
addLLMResponseToMemory Tracks the model response with addToTracking=true and addToMemories=false.
addToolRequestToMemory Adds the assistant’s request to call lookup_order to memory.
addToolResponseToMemory Adds the returned DISPATCHED status to memory and tracking.
addmessageTomemory Adds “PO-8421 is dispatched” as an assistant message on the branch without tool calls.

The tool-request activity records tool-call details; it does not also copy every piece of accompanying assistant text. The final answer is added through its own message activity. Seeing text in tracking and including it in future model context are separate operations.

7. Frequently asked questions

Does Memory_arr_var hold the conversation or the LLM response?

It holds the working message history: system instructions, user messages, selected assistant messages and tool-call details, and tool results. An LLM response is one contributor to that history.

Does a 32-day retention period keep the integration running for 32 days?

No. Retention controls retained service data. A normal completed execution ends; a later execution retrieves saved conversation history into its own working variable.

How does a later run know that “the order” means PO-8421?

For the same agent and conversation, saved messages are retrieved and included with the new question. Those messages contain the earlier order number.

Does the activity stream automatically become LLM memory?

No. Tracking records execution information. Memory-writing activities and request construction determine which messages the LLM receives.

Can remembered order status be treated as today’s status?

No. Saved history records what was previously reported. A current-status question requires a fresh lookup.

8. Official Oracle references

Comments