RAG context mode: Chunks doesn't work

Created on 5 February 2025, 17 days ago

Problem/Motivation

My goal is to configure the chatbot to use the "Chunks"-based RAG context mode. Currently using this configuration leads to an error in the bot's response when it tries to return data from the from the RAG-Search resulting in the error from `ai_assistant_api:ai/modules/ai_search/src/Plugin/AiAssistantAction/RagAction.php:323`:

Failed to search: Failed to load original object entity:node/991:de:455667744349909175

This error stems from further up the stacktrace `contrib/search_api/src/Item/Item.php:getOriginalObject()`, where neither `$this->originalObject` is present, nor does this id work in loading one.

Steps to reproduce

Set up a chatbot using the milvus vector-db ( https://www.drupal.org/project/ai_vdb_provider_milvus/ ) and configure it to use chunks in the RAG context mode. Then use the bot and try to persuade it to return data from the RAG-search. See the error in the bot and in the DB-logs.

Proposed resolution

In the case of the chunks-based context, the search-api-id comprised of the node information plus the chunk-id should load the chunk + metadata as expected.

🐛 Bug report
Status

Active

Version

1.0

Component

AI Search

Created by

🇩🇪Germany dotist

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dotist
  • 🇩🇪Germany marcus_johansson

    Just out of interest, could you verify that the node 991 exists in German. Just to make sure that its not a garbage collection issue.

  • 🇩🇪Germany dotist

    @markus_johansson, thanks I checked, and the node does exist in German.

  • I am experiencing the same issue when trying to use an AI assistant to access a Milvus database on Zilliz, using chunks.

    Type ai_assistant_api
    Location /api/deepchat?token=x1wYx02AoCuBiTZo7IO_Lxt3pWTBgyeXsJ8EOrFDWNg
    Referrer /admin/config/search/search-api/index/default_ai_index
    Message Failed to search: Failed to load original object entity:node/3:en:455796844485086408
    Severity Error

Production build 0.71.5 2024