Skip to main content

OIC AI Agents: Manage Conversations, Context, and User Isolation

Calculating read time…

A useful enterprise AI assistant must retain the right conversation without treating old information as current or allowing one user to inherit another user's context. These are separate engineering problems: conversation continuity does not guarantee fresh business data, and a conversation identifier is not an authorization policy.

This lab uses a fictional Procurement Exception Assistant that looks up purchase-order status. It demonstrates how to continue a conversation across separate runs, retrieve fresh business data, observe overlapping requests, and test cross-user conversation reuse. 

The practical outcome

A follow-up such as “Has that order changed status?” should resolve the order from conversation history, query the business system again, and report the newly returned status. A different conversation should not inherit the first conversation's history. A trusted application or API layer must check ownership before forwarding a continuation request.

Running example

SituationExpected behavior
First requestLook up PO-1042 and report its current status, revision, and update time.
Follow-up requestResolve “that order” from the same conversation and retrieve its current status again.
New conversationDo not assume that the previous order or history is available.
Second authenticated userDo not allow access to the first user's conversation merely because its identifier was supplied.

Scope boundary: This module focuses on continuing conversations, context correctness, data freshness, concurrency, retention, and isolation. It does not build a complete production application API or general-purpose authentication service.

01. In This Post

  1. What You Will Build
  2. Before You Begin
  3. Concepts That Affect This Build
    1. 4.1 — Agent Execution vs. Conversation
    2. 4.2 — Conversation Continuation
    3. 4.3 — Context and Data Freshness
    4. 4.4 — Conversation Ownership and Identity
    5. 4.5 — Concurrency and Waiting
    6. 4.6 — Retention and Recovery
    7. 4.7 — Minimal Runtime Testing Harness
  4. Build and Configure
  5. Test and Prove It
  6. Troubleshooting and Recovery
  7. Enterprise Considerations
  8. Completion Checklist and What Comes Next
  9. Five Useful FAQs
  10. Verified References
  11. Finally — Summary

02. What You Will Build

The prototype combines one Project AI Agent, one read-only order-status integration registered as an agentic AI tool, and a synthetic business-data table. A small Python client sends repeatable requests to the agent's configured runtime endpoint.

  • Continuity: the next run can resolve a follow-up from earlier history by reusing the same conversation ID.
  • Freshness: the agent calls the read-only tool again instead of treating an earlier status as authoritative.
  • Concurrency: overlapping requests for one conversation are observed and their actual outcomes recorded.
  • Isolation: two real test identities are used to check whether the invocation boundary prevents unauthorized conversation reuse.

Oracle documents that a conversation ID can associate multiple requests and span multiple agent instance IDs. The same guide documents an error if another run is started for the same conversation ID while the conversation is in progress or waiting for a tool. See Run an AI Agent with Knowledge of Previous Runs.

Important implementation boundary: a conversation ID links context; Oracle's published conversation guidance does not establish that the ID itself enforces application-user ownership. Treat ownership as a separate control that must be implemented and tested at a trusted application or API boundary.

03. Before You Begin

Only prerequisites that affect this lab are listed here.

  • An Oracle Integration 3 Project AI Agent that you can run and observe. The documentation reference is release 26.10; actual availability and endpoint configuration in your instance must be confirmed.
  • A registered, active, read-only tool that queries synthetic procurement data. The tutorial database table below is one possible source; an equivalent approved source is acceptable.
  • The exact agent invocation URL and supported authentication method for that endpoint. Do not guess either value from a copied example.
  • Two genuinely different authorized test identities, Alice and Bob, for the cross-user test. Two command-line profile names using one shared credential do not establish identity isolation.
  • Python 3 and the `requests` package for the optional runtime harness. The native Test Agent and Observe views remain useful for investigation.

Prerequisite tool contract: Oracle's AI-agent build guide describes creating an integration for use as an agentic AI tool. The tool should be configured and independently tested before using this conversation lab. See Steps to Build an AI Agent.

CORE: read-only lookup, conversation identifiers, context rules, and test evidence. JUST-IN-TIME PREREQUISITE: the approved runtime endpoint and two independently authenticated test identities. DEFERRED: a full production API, token lifecycle, durable ownership registry, and deployment-grade authentication architecture.

04. Concepts That Affect This Build

4.1 — Agent Execution vs. Conversation

An execution is one run; a conversation is context that can be shared across runs. Treat an agent run as one processing attempt with its own observable record. The conversation ID is the identifier Oracle documents for associating multiple requests so the agent can use earlier prompts, data, and decisions.

Kid-friendly analogy

Imagine a student working on the same school project over three afternoons. Each afternoon is a separate work session, but all three use the same project notebook. A different project gets a different notebook.

In the agent: each run is an execution; the conversation ID links runs whose earlier prompts, data, and decisions should remain available as context.

The execution record helps investigate one run, while the conversation ID identifies shared conversational context. One conversation can span multiple instance IDs; it is not simply another name for one complete execution.

For example, the first request might return PO-1042 as `IN_TRANSIT`. A second run can ask, “Has that order changed?” The agent needs the earlier conversation to resolve “that order,” but it needs a new business lookup to determine the current status.

Where to inspect: open the project's Design tab, select AI Agents, and choose Actions → Run. In the Test Agent page, select a test run and inspect the Activity area for its conversation ID. Under Observe → AI Agents, inspect agent-instance records and statuses. Oracle's guide describes copying the conversation ID from the Instance ID column in the Agent instances page; check the actual displayed column label in your tenant.

Checkpoint: capture the identifier for the first run and record its status. Do not assume that a second run creates a new conversation if you explicitly reuse an existing ID.

4.2 — Conversation Continuation

Conversation continuation means deliberately associating a later request with the intended earlier conversation. Oracle documents that a conversation ID is generated automatically by default; you can specify an ID to associate requests and their prior prompts, data, and decisions. In an integration's AI Agent action, the documented Conversation Id parameter is optional and can be mapped when continuity is required.

Kid-friendly analogy

Giving the librarian a reference number can connect a follow-up to an earlier discussion. A different number may point to a different discussion—or no useful history.

In the agent: pass the correct conversation ID for a legitimate follow-up and use a new one when context should be independent.

The decision is not “always reuse the ID” or “always generate a new ID.” Reuse it for a legitimate follow-up within the same conversation. Use a new one for another task, another user, or a context boundary where earlier content must not carry forward.

DecisionConversation ID behaviorReason
Follow-up on PO-1042Reuse the same ID.The order reference should remain understandable.
Start a distinct discussionUse a new ID.Earlier context is not needed or should not be inherited.
Another user's sessionAllocate a separate, owner-bound ID.Conversation selection must not cross an authorization boundary.

For the native Test Agent, Oracle documents entering a chosen conversation ID through the conversation-ID dialog before running the prompt. For an integration action, map Conversation Id when context must span runs. See Run an AI Agent with Knowledge of Previous Runs and Invoke an AI Agent from an Integration.

A wrong ID can omit useful history or associate a request with the wrong history. This is more serious than a conversational-quality defect when the history contains customer, employee, financial, or procurement data.

4.3 — Context and Data Freshness

Conversation context explains what the user means; the authoritative business source establishes the current business value. A previous tool response can remain in the history after the underlying order changes. Its presence does not refresh or validate it.

Kid-friendly analogy

Remembering the morning timetable helps you understand a conversation, but only the updated timetable tells you what happens after the teacher changes it at lunchtime.

In the agent: use history to resolve a follow-up, but call the authoritative business tool again for a current order status.

For this lab, every request for the current status must call `LookupProcurementOrderStatus`. A follow-up should carry forward the order identifier only when it can be resolved unambiguously from the current conversation. The tool result includes status, revision, and timestamp so the new answer can be distinguished from the earlier result.

Choose the right source: use conversation history to resolve “that order.” Use a live tool for a mutable fact such as “is it delivered now?” Use document retrieval for contextual knowledge meant to be searched, but do not substitute a static document for a live order record when current status is required.

A prompt instruction is a behavior guideline, not a data-freshness enforcement mechanism. Verify actual tool-call arguments and the returned revision in the activity stream, not just the final natural-language answer.

Checkpoint: the initial run might report revision 1. After updating the source record to revision 2, the follow-up should show evidence of a new lookup and use revision 2. This result must be demonstrated in the actual run.

4.4 — Conversation Ownership and Identity

Authenticated identity and conversation content are separate. Authentication establishes who calls the application or endpoint. Conversation history holds prior prompts, data, and decisions. A submitted conversation ID selects context; Oracle's published conversation guidance does not document that the ID itself proves caller ownership.

Kid-friendly analogy

Knowing a school locker number is not the same as proving you are the student allowed to open it. The school checks identity before granting access.

In the agent: authenticate the caller and verify conversation ownership in a trusted server-side layer before forwarding a continuation to OIC.

The published conversation guide establishes that multiple runs can be linked with one ID. It does not define an application-user ownership registry or guarantee that a submitted ID is rejected because another user originally used it. 

The safe application pattern is to maintain a server-side association between a stable authenticated user subject and each conversation ID. On every continuation request, validate the caller's identity, target agent, and conversation owner before invoking OIC.

Safety check — never treat an ID as an access policy

A UUID or hard-to-guess identifier can reduce accidental collisions, but it does not enforce authorization. If a caller can supply an arbitrary conversation ID and the trusted service does not check ownership, private context may be exposed. Verify this with two separately authenticated test identities; do not infer isolation from a single-user demonstration.

A recommended ownership key combines the authenticated subject, target agent, conversation ID, and relevant application or tenant scope. Enforce the mapping before the OIC call. Keep tool-level authorization in the underlying integration or business system: conversation ownership is not a substitute for permission to read or modify an order.

Checkpoint: Alice's synthetic order must not become accessible to Bob through an ID alone. The result remains unknown until the configured endpoint and its authorization boundary have been tested. A shared technical credential does not constitute two-user testing.

4.5 — Concurrency and Waiting

Concurrency occurs when two requests attempt to use the same conversation before an earlier operation completes. Oracle's conversation guide explicitly describes an error when another run starts for the same conversation ID while the conversation is In Progress or Waiting for tool to process.

Kid-friendly analogy

Two teammates writing in the same notebook at once can conflict. Waiting for one entry to finish is different from discovering that the notebook is damaged.

In the agent: coordinate requests sharing a conversation ID and distinguish an active or waiting run from an actual error.

  • In Progress: the run is still active. Inspect the execution record and activity before deciding what to do next.
  • Waiting for tool to process: the agent is waiting for an asynchronous tool response. This status alone is not proof of failure.
  • Errored: investigate the actual failure and determine whether any business action completed before retrying. This lab is read-only, but production agents may not be.

For asynchronous tools, a callback can return the result to the agent. Oracle documents the conversation ID and tool-flow/instance identifier needed by its callback pattern. See Use Case: Send a Callback to an AI Agent for an Asynchronous Tool.

Do not assume that every invocation method queues, retries, or merges competing requests. Oracle documents the same-ID restriction for the stated active and waiting conditions; this is not a universal retry or queueing contract.

Checkpoint: launch two requests close together with one test conversation ID. Capture both HTTP results and the observed agent status. If the first run completes before the second reaches the runtime, report the overlap test as inconclusive.

4.6 — Retention and Recovery

Conversation continuity depends on retained conversation data. Oracle's AI-agent guide says agent data is retained according to the Oracle Integration service-instance retention period. A new conversation ID starts an independent context; it is not a documented command to delete the old conversation.

Kid-friendly analogy

A school may keep project notebooks for a fixed period under its rules. Starting a new notebook does not automatically destroy the old one, and an unavailable notebook cannot be relied on to remember yesterday's details.

In the agent: plan around documented retention, inspect interrupted executions, and reset context with a new ID rather than assuming history is always recoverable.

Oracle's instance documentation states that Standard and Enterprise instances retain production-tracing data for 32 days by default and Healthcare instances for 184 days. It says only Enterprise instances can change this period; debug tracing data is retained for 24 hours and audit tracing data for 8 days.

Those figures describe the documented instance data-retention settings and tracing categories; do not infer a separate per-conversation TTL or exact agent-history purge instant from them alone. If a regulatory deadline depends on exact AI-agent-history deletion timing, confirm the applicable service behavior for your instance and preserve evidence of the policy.

Recovery sequence: after a client timeout, inspect the agent execution status and activity before resending. If it is still active or waiting for a callback, do not start another run for the same ID just to see what happens. If a request failed, determine whether a new context is appropriate and whether a business operation might already have completed.

For this read-only prototype, repeating a failed status lookup should not change an order. That assumption does not apply to production agents that create invoices, approve payments, or update ERP transactions. Such actions need transaction controls and duplicate-prevention mechanisms beyond conversation recovery.

4.7 — Minimal Runtime Testing Harness

A runtime harness is a repeatable client for sending controlled inputs to the actual agent endpoint. It can keep the prompt, caller profile, and conversation ID explicit so continuity, concurrency, and isolation can be assessed separately.

Kid-friendly analogy

Repeat the same experiment while changing one condition at a time, and write down each result. That helps identify which change caused a different outcome.

In the agent: keep request body, caller identity, conversation ID, and observed evidence explicit.

The harness sends a prompt and conversation ID to an authorized endpoint and optionally starts two concurrent requests. It does not implement browser login, a full OAuth authorization-code flow, durable ownership storage, application session management, or production error contracts.

The endpoint contract is environment-dependent. Confirm the exact runtime URL and authentication scheme accepted by the endpoint. Oracle's known-issues page documents a `conversationId` query-parameter workaround specifically for agents created before 26.04. Do not blindly reconstruct that legacy URL or add the query parameter to every 26.10 invocation. See Agentic AI Issues.

Checkpoint: confirm that a sequential request returns an observable HTTP result, then correlate it with the agent record and tool activity. An HTTP response alone does not prove a current business result or correct ownership enforcement.

05. Build and Configure — Step by Step

Step 1 — Create the Synthetic Order Data

CORE: use a mutable but controlled business source so a freshness test can prove that the follow-up retrieved a new data version. The following table is tutorial-defined, not a mandatory Oracle Integration artifact name.

CREATE TABLE order_status_lab (
    order_id     VARCHAR2(30) PRIMARY KEY,
    status       VARCHAR2(30) NOT NULL,
    last_updated TIMESTAMP WITH TIME ZONE NOT NULL,
    revision     NUMBER(10) NOT NULL
);

INSERT INTO order_status_lab
    (order_id, status, last_updated, revision)
VALUES
    ('PO-1042', 'IN_TRANSIT',
     TO_TIMESTAMP_TZ(
         '2026-10-23 08:00:00 +05:30',
         'YYYY-MM-DD HH24:MI:SS TZH:TZM'
     ), 1);

INSERT INTO order_status_lab
    (order_id, status, last_updated, revision)
VALUES
    ('PO-A-7319', 'PENDING',
     TO_TIMESTAMP_TZ(
         '2026-10-23 08:10:00 +05:30',
         'YYYY-MM-DD HH24:MI:SS TZH:TZM'
     ), 1);

COMMIT;

These timestamps and order IDs are synthetic; they are not observations from a real procurement system. The revision number makes a data change easy to see even if two statuses sound similar.

Verify the starter records with a direct database query:

SELECT order_id, status, revision, last_updated
FROM order_status_lab
WHERE order_id IN ('PO-1042', 'PO-A-7319')
ORDER BY order_id;

Expected result: two rows, each at revision 1. Execution status: Not executed.

Step 2 — Define the Read-Only Order-Status Tool

Create an integration that accepts one order identifier, queries the synthetic source, and returns deterministic JSON. The agent must not write to this table.

Integration contract — tutorial-defined request

{
  "orderId": "PO-1042"
}

Successful response

{
  "found": true,
  "orderId": "PO-1042",
  "status": "IN_TRANSIT",
  "revision": 1,
  "lastUpdated": "2026-10-23T08:00:00+05:30"
}

Order-not-found response

{
  "found": false,
  "orderId": "PO-9999",
  "errorCode": "ORDER_NOT_FOUND"
}

Map the success response to actual database values. The ISO-8601 timestamp above is the required output shape for this tutorial contract; map or normalize the database timestamp explicitly instead of assuming the adapter emits precisely this text. For an unknown order, return a clear not-found result and ensure the agent does not invent a status.

Tool metadata: use a clear name such as `LookupProcurementOrderStatus` and a description such as:

Read-only lookup of the current procurement order status.
Accepts an exact orderId and returns found, status, revision,
and lastUpdated from the authoritative order-status source.
Use for current-status questions. Do not update order records.

The tool description helps the model decide when to use the tool. It does not replace input validation, endpoint security, or read-only enforcement in the integration and database query. Test the integration independently before evaluating the agent.

Checkpoint: submit the request directly to the integration and verify its returned order, status, revision, and timestamp. Then test `PO-9999` and verify the not-found result. Execution status: Not executed.

Step 3 — Configure the Agent's Context and Freshness Rules

Use the Project AI Agent for the Procurement Exception Assistant, or create an equivalent agent if the earlier artifact is not available. Associate the read-only order-status tool and configure the role and guidelines.

Tutorial role and guidelines

You are the Procurement Exception Assistant.

For a request about the current status of a procurement order:

1. Identify the exact orderId in the current request.
2. If the user says "that order" or "it", resolve orderId from
   this conversation only when the reference is unambiguous.
3. Call LookupProcurementOrderStatus for every request that asks
   for current order status, including follow-ups.
4. Use the current request's tool result as the source for status,
   revision, and lastUpdated.
5. If found is false, say the order was not found.
6. If the tool fails or no current result is available, say that
   the status could not be verified. Do not guess.
7. Conversation history may resolve references; it is not an
   authoritative source for current business status.
8. If no unambiguous order can be identified, ask the user for
   the orderId instead of inventing one.
9. This assistant performs read-only status lookups. Never claim
   to have updated an order.

These are tutorial-defined instructions, not Oracle defaults. History resolves meaning; a fresh tool response establishes status. If a run merely repeats an earlier answer, the conversation may be continuous, but the freshness requirement has not been shown.

The instruction “always call the tool” is not a security boundary and cannot guarantee model behavior. Backend authorization and validation must remain enforceable without trusting the prompt. Check actual tool selection and arguments as well as answer text.

Checkpoint: activate the agent and confirm its resource list includes the read-only lookup tool. Verify the supported pattern/model configuration available in your project; this lab does not assume a specific provider or pattern.

Step 4 — Establish the Conversation-ID Rules

Use distinct identifiers for Alice's main conversation, Alice's new conversation, and Bob's independent conversation. A UUID is a convenient sample value, not an authorization mechanism.

# Run in PowerShell. Generate fresh identifiers for this lab.
$env:OIC_CONV_ALICE = [guid]::NewGuid().ToString()
$env:OIC_CONV_ALICE_NEW = [guid]::NewGuid().ToString()
$env:OIC_CONV_BOB = [guid]::NewGuid().ToString()

For a native UI test, open Design → AI Agents → Actions → Run, enter a prompt, and note the conversation ID shown in Activity. To continue, open the conversation-ID dialog and specify that same ID; use a different ID for an independent conversation. The client below allows controlled repeats without manual prompt entry.

Oracle's AI Agent integration action documents Conversation Id as optional and permits it to associate requests across several instance IDs. Carry the identifier consistently in the application that owns the session. Never treat an untrusted client-supplied ID as evidence of authorization.

Checkpoint: record which identifier belongs to each test conversation. Execution status: Not executed.

Step 5 — Add the Bounded Python Runtime Harness

The script sends one prompt and conversation ID, prints the HTTP status and response body, and can launch two requests concurrently when explicitly requested. It does not assume a response JSON schema or declare that continuity succeeded based on HTTP status alone.

Create `conversation_lab.py` and install the dependency:

python -m pip install requests
import argparse
import getpass
import os
from concurrent.futures import ThreadPoolExecutor, as_completed

import requests
from requests.auth import HTTPBasicAuth


def resolve_auth(profile):
    """Resolve one test caller's configured endpoint credentials."""
    prefix = f"OIC_{profile.upper()}_"
    mode = os.getenv("OIC_AUTH_MODE", "basic").lower()

    if mode == "basic":
        username = os.getenv(prefix + "USERNAME") or input(
            f"Username for {profile}: "
        )
        password = os.getenv(prefix + "PASSWORD") or getpass.getpass(
            f"Password for {profile}: "
        )
        return HTTPBasicAuth(username, password), {}

    if mode == "bearer":
        token = os.getenv(prefix + "TOKEN")
        if not token:
            raise ValueError(
                f"Set {prefix}TOKEN using the approved token source."
            )
        return None, {"Authorization": f"Bearer {token}"}

    raise ValueError("OIC_AUTH_MODE must be basic or bearer.")


def send_request(label, url, auth, extra_headers, conversation_id,
                 prompt, timeout_seconds):
    headers = {
        "Accept": "application/json",
        "Content-Type": "application/json",
    }
    headers.update(extra_headers)
    body = {"prompt": prompt, "conversationId": conversation_id}

    try:
        response = requests.post(
            url,
            json=body,
            headers=headers,
            auth=auth,
            timeout=timeout_seconds,
        )
        print(f"\n[{label}] HTTP {response.status_code}")
        print(f"conversationId={conversation_id}")
        print(response.text[:4000])
        return response.status_code
    except requests.RequestException as exc:
        print(f"\n[{label}] Request transport error: {exc}")
        return None


def main():
    parser = argparse.ArgumentParser(
        description="Bounded OIC Project AI Agent conversation lab."
    )
    parser.add_argument("--profile", required=True,
                        choices=("alice", "bob"))
    parser.add_argument("--conversation-id", required=True)
    parser.add_argument("--prompt", required=True)
    parser.add_argument("--concurrent", type=int, default=1,
                        choices=(1, 2))
    args = parser.parse_args()

    url = os.environ.get("OIC_AGENT_URL")
    if not url:
        raise ValueError(
            "Set OIC_AGENT_URL to the exact authorized agent endpoint."
        )

    # Requests uses this for connection/read waits; it is not a hard
    # end-to-end wall-clock deadline for the entire operation.
    timeout_seconds = float(
        os.getenv("OIC_HTTP_TIMEOUT_SECONDS", "120")
    )
    auth, extra_headers = resolve_auth(args.profile)

    if args.concurrent == 1:
        send_request(
            args.profile, url, auth, extra_headers,
            args.conversation_id, args.prompt, timeout_seconds
        )
        return

    # A race probe, not a guarantee that the service will observe
    # both requests as simultaneously active.
    with ThreadPoolExecutor(max_workers=2) as pool:
        futures = [
            pool.submit(
                send_request,
                f"{args.profile}-parallel-{index + 1}",
                url, auth, extra_headers,
                args.conversation_id, args.prompt, timeout_seconds
            )
            for index in range(2)
        ]
        for future in as_completed(futures):
            future.result()


if __name__ == "__main__":
    main()

Configure the URL and authentication through your approved local development setup. For Basic authentication, the script prompts for the password if it is not present in the process environment. For Bearer authentication, it reads a token from the selected caller's environment variable. Use only a scheme accepted by your endpoint; this client code does not imply that every AI-agent endpoint accepts both modes.

For example, set the URL to your actual approved endpoint in PowerShell:

$env:OIC_AGENT_URL = "https://your-authorized-host/your-agent-endpoint"
$env:OIC_AUTH_MODE = "basic"
$env:OIC_ALICE_USERNAME = "authorized_lab_user_a"
$env:OIC_BOB_USERNAME = "authorized_lab_user_b"

The URL is intentionally a placeholder, not a universal endpoint. Use the endpoint metadata and inbound security configuration for the target instance. For agents created before 26.04, inspect Oracle's known-issues workaround for `conversationId` before testing.

The harness defaults to a 120-second Requests timeout setting as a local client network-wait parameter. In Python Requests, this is a connect/read timeout—not a strict 120-second total wall-clock deadline for the complete request. It is not an Oracle service limit or agent maximum-iteration setting.

Checkpoint: run one request, then locate its agent record and inspect status and tool activity. HTTP 200 alone does not prove that the business result is current or that ownership was enforced.

Step 6 — Run the Initial Request and Its Follow-up

Start Alice's conversation by asking for the current status of PO-1042. The request explicitly reuses a conversation ID so a later harness request can continue it.

python conversation_lab.py --profile alice --conversation-id $env:OIC_CONV_ALICE --prompt "Look up the current status of PO-1042. Include the status, revision, and last-updated time from the tool result."

Inspect the HTTP output, agent execution record, and activity stream. Record the actual conversation ID and tool-returned fields. The synthetic starter row indicates `IN_TRANSIT`, revision `1`; this is fixture data, not a result observed from a tenant.

Now issue a follow-up using the same ID:

python conversation_lab.py --profile alice --conversation-id $env:OIC_CONV_ALICE --prompt "Has that order changed? Check its current status again and report the revision and last-updated time."

The follow-up meets the goal only if the conversation supplies the order reference and the current status is grounded in a new tool response. Inspect whether the tool was called again with `PO-1042`. If the agent repeats the prior message without a new lookup, continuity may exist, but freshness has not been demonstrated.

Checkpoint: document tool arguments, new tool response, conversation association, and final answer separately. Execution status: Not executed.

Step 7 — Change the Business Data and Test Freshness

After the first request finishes, change the synthetic source record directly in the database. The following update sets revision to 2 rather than incrementing it, so repeating this freshness test produces the same expected revision value.

UPDATE order_status_lab
SET status = 'DELIVERED',
    revision = 2,
    last_updated = SYSTIMESTAMP
WHERE order_id = 'PO-1042';

COMMIT;

Verify that the committed row now reports `DELIVERED` at revision `2`. Then repeat the follow-up prompt using Alice's original conversation ID.

Expected evidence: a new tool request for `PO-1042`, a returned record showing revision `2`, and an answer based on that result rather than the earlier `IN_TRANSIT` response. The agent may acknowledge the earlier answer as historical context while reporting the newly retrieved value as current.

Checkpoint: compare the database row, tool JSON, and final response. If the row changed but the tool output did not, check the committed transaction, query and response mappings, source connection, and any caching behavior before rewriting the agent prompt.

Step 8 — Create an Independent Conversation

Use Alice's second conversation ID. This tests context separation, not whether the order still exists in the business source.

python conversation_lab.py --profile alice --conversation-id $env:OIC_CONV_ALICE_NEW --prompt "Which order were we discussing earlier?"

Because the new conversation has no previous order reference, the configured agent should ask which order the user means rather than inventing one. If it calls the tool, inspect the argument; no order ID should be guessed.

Checkpoint: confirm the new ID differs from the first and that no earlier conversational order reference was carried into this context. Business records remain independently queryable; separate conversation history does not partition the database.

Step 9 — Run a Controlled Same-ID Overlap Probe

The harness can send two requests concurrently with one conversation ID. This is a race probe, not a guarantee that the service will observe both requests as overlapping. Agent duration and scheduling affect the outcome.

python conversation_lab.py --profile alice --conversation-id $env:OIC_CONV_ALICE --prompt "Look up the current status of PO-1042." --concurrent 2

Record both HTTP status codes and bodies. Inspect Observe to establish whether one request was still `In Progress` or `Waiting for tool to process` when the other reached the service.

If the first run finished before the second reached the service, the result does not prove active-overlap behavior. Use a safe test environment and a controlled, bounded delay only if it fits the supported lab design. Do not overload production merely to force a conflict.

Checkpoint: distinguish a documented same-ID conflict from a client timeout, endpoint authentication failure, or underlying tool failure. Do not claim automatic queue or retry behavior unless it is established for the invocation path in use.

Step 10 — Test Two Authorized Identities

Use two genuinely different authorized identities at the same configured endpoint. Alice uses a synthetic order unique to the test; Bob then attempts to reuse Alice's conversation ID. Ensure the test is authorized and contains only synthetic data.

First, have Alice look up the test order:

python conversation_lab.py --profile alice --conversation-id $env:OIC_CONV_ALICE --prompt "Look up the current status of PO-A-7319."

After Alice's request completes, submit a separate request as Bob but deliberately supply Alice's conversation ID:

python conversation_lab.py --profile bob --conversation-id $env:OIC_CONV_ALICE --prompt "Which order was discussed earlier in this conversation?"

This reuse attempt is intentional and must remain limited to synthetic data and authorized testers. If Bob can retrieve Alice's order reference or other prior context, record that as evidence that the tested invocation boundary did not prevent reuse. Do not conclude that the identifier has built-in ownership enforcement merely because both users authenticated.

Test Bob's independent conversation as well:

python conversation_lab.py --profile bob --conversation-id $env:OIC_CONV_BOB --prompt "Which order were we discussing earlier?"

For Bob's independent conversation, the assistant should not identify Alice's previous order from Bob's history. The tool should not be called with Alice's order ID unless Bob independently provides it or it is available from Bob's own authorized context.

Important test-validity condition: confirm from endpoint/audit evidence that Alice and Bob reached the service as different authenticated principals. If a proxy substitutes one shared service identity, this is not a valid per-user isolation test. A raw endpoint experiment is diagnostic, not a production isolation implementation.

Checkpoint: record authenticated principal, exact conversation ID, whether the request was accepted or rejected, resulting tool activity, and whether prior context became visible. Execution status: Not executed.

06. Test and Prove It

A natural-language answer alone does not complete this lab. Use the HTTP result, Observe records, tool arguments, tool result, and database row as separate evidence sources. None of the cases below is represented as an executed test.

CaseExpected behaviorEvidence to inspectExecution
Initial requestCurrent status is retrieved.Database row, exact tool argument, returned revision and timestamp, final response.Not executed
Follow-up, same IDEarlier order is resolved and a new lookup occurs.Conversation association, tool-call arguments, fresh tool response.Not executed
Unknown orderNot found is reported without inventing status.Integration's not-found payload and agent answer.Not executed
Changed source recordNew lookup returns revision 2 and current status.Committed database update, later tool output, final answer.Not executed
New conversationNo unsupported earlier order reference is assumed.Different ID and no guessed order ID in any tool call.Not executed
Active same-ID overlapObserve actual concurrent-request behavior.Both HTTP responses, timestamps, agent status, activity stream.Not executed
Alice-to-Bob reuseProtected application blocks unauthorized context reuse.Authenticated principal, ownership decision, response and tool activity if invocation proceeded.Not executed
Endpoint or tool failureFailure is identified without a fabricated success claim.HTTP response, agent status, tool result/error, execution timeline.Not executed

Evidence discipline: a response saying “DELIVERED” does not prove the integration returned that value. A successful HTTP response does not establish isolation. Correlate assertions with the actual request, execution, tool result, and authoritative data.

To inspect runtime status and tool activity, see Get the Activity Stream for an AI Agent. Oracle documents using the conversation ID to obtain the activity stream and current status. Capture the output from your actual tenant during testing.

07. Troubleshooting and Recovery

SymptomLikely causeTargeted check
Follow-up cannot identify the earlier order.New/wrong conversation ID, unavailable history, or ambiguous reference.Compare IDs in requests and activity records. Reuse the intended ID or ask for an order ID if ambiguous.
Answer repeats an obsolete status.Tool selection, prompt, integration mapping, source query, or committed data update.Compare the database row, new tool call, and returned revision. Fix the failing layer instead of relying on a stronger prompt.
Same-ID request rejected while another run is active.Same-conversation concurrency restriction.Inspect the active run or waiting-tool status before retrying; do not assume it was queued.
Agent remains Waiting for tool to process.An asynchronous tool has not returned its result.Inspect the integration execution and callback requirements. Do not label it a failure without checking progress.
Bob sees Alice's conversation.Caller-to-conversation ownership was not enforced at the tested boundary.Stop tests involving real data. Correct the trusted ownership check and retest using synthetic data and two genuine principals.
404 but an execution record appears.Incorrect invocation path/URL.Validate the exact endpoint before resending. Oracle documents that an incorrect URL can create conversation and instance records although the agent does not start.
Client timeout leaves an uncertain outcome.Client-side network timeout or execution still in progress.Inspect execution and tool activity first. Determine whether work completed before resending; apply idempotency and reconciliation if business writes are possible.

The 404 behavior is documented in Oracle's Agentic AI Issues page. Do not assume that an HTTP error means no records were created.

08. Enterprise Considerations

Conversation ownership and least privilege

Bind each conversation to the authenticated user's stable subject in a trusted application layer. Check ownership on every continuation and keep authorization in the actual integration and business system. Do not trust a client-provided ID or the model's statement about who is calling.

Freshness, history, and observability

Use history for conversational continuity and the authoritative source for mutable facts. Preserve evidence correlating each execution to conversation ID, tool request, tool result, and final answer. Consider privacy implications when retaining prompts and business data.

Retention and recovery

Oracle's AI-agent guide links agent data retention to the instance retention period. The Edit the Data Retention Period page describes defaults and edition-specific settings for production tracing data. Verify exact conversation-history purge behavior if compliance obligations depend on it.

Retries, side effects, and interrupted execution

This prototype is read-only. For invoice creation, purchase-order updates, or approvals, an uncertain retry must not automatically duplicate a transaction. Use business-level authorization, validation, idempotency, and reconciliation in the actual workflow or target system. Conversation state is not a transaction ledger.

Production API design, login/session management, durable ownership storage, and full authorization-flow tests are deferred to Module 12.

09. Completion Checklist and What Comes Next

Mark an item complete only after collecting its evidence.

  • The lookup integration returns a deterministic current record and a meaningful not-found result.
  • Sequential runs use the intended conversation ID and the follow-up resolves the earlier order reference.
  • The freshness test proves the revised source record was retrieved by the follow-up.
  • A separate conversation is verified not to rely on the earlier conversation's order reference.
  • The concurrency experiment records both outcomes and identifies an inconclusive overlap test explicitly.
  • Two different authenticated identities are used for the isolation test; the result is documented rather than assumed.
  • Retention policy and recovery procedure are documented for the target instance.

What comes next: Module 12 can turn these findings into a protected application API. That module should persist ownership mappings, bind each continuation to the authenticated caller, define token and session lifecycle, and test authorization and failure behavior through the actual entry point.

Until runtime tests are performed, this is a documented and testable design—not a proven tenant deployment. Preserve that distinction in project notes and technical evidence.

10. Five Useful FAQs

1. Is a conversation ID the same as an agent execution or instance ID?

No. A conversation ID associates requests with shared conversational context and can span multiple instance IDs. An execution record helps inspect one run. Correlate these identifiers in the Test Agent Activity area and the project Observe view.

2. If an agent remembers a previous result, is it still current?

No. Remembered data can become stale. For current status, query the authoritative source again and verify actual tool arguments and result in runtime evidence.

3. Does Oracle automatically guarantee that only the owner can reuse a conversation ID?

The cited conversation guide does not establish per-application-user ownership enforcement. Do not use the ID as an authorization token. Bind it to an authenticated subject in a trusted layer and test with separate identities.

4. Can two requests safely run at the same time using one conversation ID?

Do not assume so. Oracle documents an error if a new run starts while the same conversation is In Progress or Waiting for tool to process. Capture actual behavior for the invocation method; do not assume requests are queued or merged.

5. Does a new conversation delete old history, and how long is it retained?

A new ID separates conversation context; it is not a documented deletion operation. Oracle ties AI-agent data retention to instance retention, while the retention page distinguishes production tracing, debug, and audit data. Confirm exact conversation-history purge behavior if a compliance deadline depends on it.

11. Additional References

  1. Using Agentic AI in Oracle Integration 3 — guide index.
    Oracle Integration 3 AI Agents documentation
    Guide entry point and release context.
  2. Run an AI Agent with Knowledge of Previous Runs.
    Conversation ID documentation
    Conversation continuity, how to find/specify the ID, same-ID active/waiting restrictions, and retention reference.
  3. Invoke an AI Agent from an Integration.
    AI Agent integration action
    Invocation action and optional Conversation Id parameter.
  4. Get the Activity Stream for an AI Agent.
    Activity stream documentation
    Obtaining status/activity by conversation ID through an AI Agent action in an integration.
  5. Use Case: Send a Callback to an AI Agent for an Asynchronous Tool.
    Asynchronous callback example
    Waiting state and callback identifiers.
  6. Agentic AI Issues.
    Known issues
    Legacy conversation-ID workaround and incorrect invocation URL behavior.
  7. Edit the Data Retention Period.
    Instance data retention
    Defaults and edition-specific settings, including the distinction between production tracing, debug tracing, and audit tracing.
  8. Steps to Build an AI Agent.
    Build an AI Agent
    Agent-tool integration prerequisites.

12. Finally — Summary

Conversation management is more than asking an assistant to remember a previous message. An engineer must associate follow-up runs with the correct conversation, ground current business facts in fresh tool results, and distinguish an active or waiting execution from a failure.

This lab provides a repeatable test path: a read-only procurement lookup, mutable synthetic data, repeated requests with the same and different conversation IDs, a bounded concurrency probe, and two separately authenticated test identities. The activity stream and authoritative data provide evidence; a fluent answer alone does not.

The key engineering lesson is that conversation continuity, data freshness, and user authorization are separate controls. Conversation IDs provide continuity, tools provide current business evidence, and a trusted authorization layer governs who may continue a conversation. Verify Oracle behavior wherever ownership or precise retention guarantees are not documented.

Once runtime checks have been executed and recorded, the next module can extend this prototype into a production-style API that persists ownership, authenticates callers, enforces authorization, and handles retries and session recovery without relying on model instructions alone.

Comments