Qdrant data query from two different metadata sets returns empty output

Hello everyone,
I would like to query two websites from two different companies that are stored in the Qdrant Vector Store. The two companies, ‘Martina California LLC’ and ‘Dani California LLC’, are distinguished by ‘metadata.document_name’.

  • When I use the following prompt: ‘Return the website of Dani LLC.’, the website is returned correctly: The website of Dani LLC is http://www.dani-california.com (Dani California LLC).
  • When I use the following prompt: ‘Return the website of Martina LLC.’, the website is returned correctly: The website of Martina LLC is http://www.martina-california.com (Martina California LLC).

In both cases, the Qdrant filter is set correctly:

{
  "must": [
    {
      "should": [
        {
          "key": "metadata.document_name",
          "match": {
            "any": [
              "Dani California LLC"
            ]
          }
        }
      ]
    }
  ]
}
{
  "must": [
    {
      "should": [
        {
          "key": "metadata.document_name",
          "match": {
            "any": [
              "Martina California LLC"
            ]
          }
        }
      ]
    }
  ]
}

If I now use the query ‘Return the website of Dani LLC and Martina LLC.’, the output is:

{ "output": "" }

However, the Qdrant filter is set correctly:

{
  "must": [
    {
      "should": [
        {
          "key": "metadata.document_name",
          "match": {
            "any": [
              "Martina California LLC",
              "Dani California LLC"
            ]
          }
        }
      ]
    }
  ]
}

The query appears to be correct, because when I use the filter directly in the Qdrant console, data from both ‘Dani California LLC’ and ‘Martina California LLC’ is displayed.

Am I making a mistake in my reasoning here, or have I forgotten something fundamental?

Thank you for your help.
Lomi

Please share your workflow

Information on your n8n setup

  • n8n version: 1.112.6
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Win 11

I was able to solve the problem by optimizing the instructions for the AI agent. Gemini gave me the tip :sweat_smile:

Both companies are now searched for in the Vector Store.

Output:

The website for Dani California LLC is http://www.dani-california.com. The website for Martina California LLC is www.martina-california.com.

AI agent instruction:

- You are an experienced assistant with access to a specialized knowledge base via the Vector Store tool.

- ALWAYS use the Vector Store tool to search for relevant information before responding.

- The snippets are clearly formatted with metadata (document_name).

- Important: If the user's request refers to multiple companies or entities (e.g., ‘Dani California LLC’ and ‘Martina California LLC’), you must gather all relevant information for each company and list it clearly and completely in your response.

Example of output for multiple results:
'The website for Dani California LLC is [Dani website].'
'The website for Martina California LLC is [Martina website].'

- If you cannot find information about one of the companies, only provide the information for the companies you did find and do not mention the missing one.

- Important: **Always cite the source in your response by returning the document_name in parentheses.**

Lomi

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.