Qdrant is returning text and instead of object

I’m encountering an issue with the When using the “Retrieve Documents (As Tool for AI Agent)” mode, the node returns the response as a JSON-encoded string within the text field, rather than as a structured JSON object.

For example, my Qdrant point is structured as follows:
{


  "pageContent": "Post num1",
  "metadata": {
    "text": "coucou",
    "color": "Red"
  }
}

However, the response from the node appears as a text inside the property text:

{
  "type": "text",
  "text": "{\"pageContent\":\"Post num1\",\"metadata\":{\"text\":\"coucou\",\"color\":\"Red\"}}"
}

This format makes it challenging to access individual fields within the AI agent.

In contrast, when using the “Get Many” mode, the node returns a properly structured JSON object, which is much easier to work with.

I expected the node to return the retrieved documents as structured JSON objects, similar to the output in the “Get Many” mode, facilitating easier data access within the AI agent.

My workflow:

Information on your n8n setup

  • n8n version: 1.92.2
    Qdrant cloud v1.14.0
  • **Running n8n via Docker
  • Operating system: Windows

Hey @CyrilCs Welcome to the community!

This behaviour is expected as the response is going to the agent as context ie. you can’t really extract anything from the response from tools to use as variables or otherwise.

If you just want to retrieve the qdrant vector store document, you can just use the qdrant store node as you’ve done and then pipe that into the agent or another LLM node.

It would help if you’re able to explain what you’re trying to achieve?

Hi @Jim_Le , thanks a lot for your reply!

The output from the datastore is indeed quite rich — it includes things like name, picture URL, a list of items (each with its own image, description, and URL). My goal was to have the AI extract specific pieces of that data and output it in a precise format.

I tested it a bit and noticed that while the AI recognizes the data structure, but it becomes tricky when I need something very specific — like extracting the second item in the list. It doesn’t always handle that well.

That’s why I was hoping the response could be passed as structured JSON rather than an encoded string — to make it easier for the agent to navigate and work with the data.

Cyril