Skip to content

[Bug]:Chat re-runs URL ingestion with stale URL on follow-up #1820

Description

@NishadA05

OpenRAG Version

0.5

Deployment Method

Local development (make dev)

Operating System

macOS

Python Version

3.13

Affected Area

Retrieval (search, OpenSearch, hybrid search)

Bug Description

When using OpenRAG chat for URL ingestion, the agent incorrectly re-runs the URL ingestion tool on follow-up questions and may reuse a stale or unrelated URL instead of the most recent user-provided URL. After a user asks OpenRAG to ingest a URL and the ingestion tool completes, asking a follow-up question such as “what URL did you just ingest?” should result in a direct answer based on the previous tool result. Instead, OpenRAG calls the URL ingestion tool again, even though the user did not request another ingestion. In some cases, the repeated tool call uses a different URL from prior context rather than the URL from the latest request. This suggests a tool-routing or conversation-state issue where a read-only follow-up question triggers a state-changing ingestion action with stale arguments.

Steps to Reproduce

  1. Start OpenRAG and open the chat interface.
  2. Send a prompt asking OpenRAG to ingest a URL, for example:
    ingest this url: <URL_1>
  3. Wait for opensearch_url_ingestion_flow to complete.
  4. Confirm that OpenRAG reports the URL ingestion completed.
  5. Send a follow-up question that asks about the previous ingestion, without asking it to ingest anything new:
    what url did you just ingest
  6. Observe that OpenRAG calls opensearch_url_ingestion_flow again.
  7. Observe that the repeated tool call may use a stale or unrelated URL from prior conversation context instead of the most recent URL.

Expected Behavior

OpenRAG should answer with the most recently ingested URL and should not call the URL ingestion tool again.

Actual Behavior

OpenRAG re-runs the URL ingestion tool and may report or ingest a different URL than the one most recently provided.

Relevant Logs

Screenshots

Image

Additional Context

No response

Checklist

  • I have searched existing issues to ensure this bug hasn't been reported before.
  • I have provided all the requested information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🔴 Something isn't working.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions