How can I apply metadata filtering (multi-faceted filtering) in the Milvus Vector Store “Tool for AI Agent” mode?

Describe the problem/error/question

I’m using the Milvus Vector Store node in “Retrieve Documents (As Tool for AI Agent)” mode.
My AI Agent produces structured metadata (academicYear, province, scholarshipName, headingTitle, etc.).
Example:

{
  "canonical_question_en": "deadline edisu 2025-2026",
  "metadata": {
    "academicYear": "2025-2026",
    "province": "piemonte",
    "name": "EDISU",
    "headingTitle": "DEADLINES"
  },
  "confidence": {
    "is_confident": true,
    "confidence_level": "high"
  }
}

I want the Milvus Vector Store node to filter documents based on these metadata fields (multi-faceted filtering), e.g.:

  • academicYear = 2025-2026

  • province = piemonte

  • scholarshipName = EDISU

  • headingTitle = DEADLINES

However, in Tool for AI Agent mode the node only performs a semantic search + rerank, and there is no option for expr filtering or metadata-based filtering.
All chunks are returned regardless of metadata.

My question:
Is metadata filtering supported in Tool mode?
If not, what is the recommended way to perform filtering (e.g. Function node after retrieval)?
Or should I switch to Milvus REST API to use expr?


What is the error message (if any)?

There is no error.
The issue is that filtering does not happen, because the node provides no way to pass filtering instructions to Milvus.


Please share your workflow

(High-level description since workflow is large)

  1. AI Agent → Metadata extracted

  2. Milvus Vector Store (Tool Mode)

  3. Rerank

  4. LLM Answer

The missing part is multi-faceted filtering based on metadata.


Share the output returned by the last node

The node returns documents from different years/provinces even though metadata clearly indicates:

academicYear = "2025-2026"
province = "piemonte"
name = "EDISU"
headingTitle = "DEADLINES"

Example:

  • chunks from 2024-2025

  • chunks from different provinces

  • chunks from scholarship names that do not match

  • sections unrelated to the requested heading


Information on your n8n setup

n8n version: (latest)
Database: (PostgreSQL )
Executions process: (main)
Running via: (Docker )
Operating system: (Ubuntu )


Hey! Milvus Vector Store node in Tool mode does not support metadata filtering—it only does semantic search plus reranking. Your best bet is switching to Insert/Retrieve mode where you can manually pass filter expressions, or use the HTTP Request node to call Milvus REST API directly with expr filters. Alternatively, add a Code node after retrieval to filter results by metadata before sending to the LLM. The Tool mode is intentionally simplified and lacks advanced filtering options right now.

Claude can make mistakes. Please double-check responses.