PGVector Node: Vector similarity with templated data & clarifying the "Prompt" parameter

Describe the problem/error/question

I have a vector database and I want to retrieve similar vector based on the data that I have. I have 2 question regarding the vector data retrieval, the first one is about the data that I have. Currently my data like a template because it is talking about certain topic, below is the example of my data:

1. first data:
Institutional Motivation:
The adaptation appears intended to bridge traditional licensed financial services with blockchain-native infrastructure to support diversified asset management and digital identity verification for retail and SME clients.

Adaptation Objective:
Integrating decentralized digital identity frameworks into regulated financial service and investment workflows.

Institutional Reasoning:
The partnership formalizes an operational shift toward embedding blockchain-native utility—specifically identity and tokenization—into an established licensed financial group. This suggests an institutional effort to modernize service delivery and asset accessibility by aligning regulatory compliant infrastructure with decentralized service protocols.

Operational Capability:
Ability to leverage decentralized identity systems for service access, facilitate stablecoin-based settlement, and manage the tokenization of real-world assets within a regulated framework.

Operational Transformation:
Formalization of a partnership to architect and deploy shared Web3 infrastructure, including digital identity verification, stablecoin settlement, and tokenization services, across the Inveo ecosystem.

2. second data:
Institutional Motivation:
This adaptation appears intended to bridge traditional retail brokerage user interfaces with on-chain, non-custodial execution infrastructure, suggesting an operational shift toward supporting decentralized financial workflows for broader asset classes.

Adaptation Objective:
Integrating decentralized perpetuals exchange infrastructure into self-custodial wallet environments.

Institutional Reasoning:
The investment suggests that eToro is operationally integrating decentralized on-chain perpetuals trading into its existing retail user-experience layer. By combining the Zengo self-custody infrastructure with the Extended derivatives engine, the institution is shifting toward an operational model where non-custodial on-chain execution serves as the backend for multi-asset trading.

Operational Capability:
The institution is developing the capability to offer users the ability to trade perpetual futures on crypto, equities, forex, and commodities using self-custodial wallet infrastructure.

Operational Transformation:
eToro has initiated a technical partnership between the Zengo self-custody wallet and the Extended perpetuals protocol to facilitate cross-asset trading within a self-custodial framework.

3. third data:
Institutional Motivation:
Appears intended to extend existing regional operational footprints—following previous economic zone and exchange-related activities—into planned urban utility infrastructure.

Adaptation Objective:
Integration of blockchain and cryptocurrency infrastructure into the foundational urban planning of a planned digital-first city.

Institutional Reasoning:
This partnership represents a move by a technology provider to embed its operational infrastructure directly into the foundational development of a new city, transitioning from existing regional economic zone activities toward integrated urban digital infrastructure.

Operational Capability:
Ability to architect and deploy blockchain-based systems at a municipal urban scale.

Operational Transformation:
The establishment of a formal agreement to provide technical support and infrastructural development services for a city-scale digital environment.

notice that the data is consist of Institutional Motivation, Adaptation Objective and so on and the start of the sentence is almost the same. My question does this kind of data could be use when finding vector similarity? because right now the data that I got is from 0 - 0.2 when 0.2 isn’t really related to the data that I want to search.

The second question is regarding the node itself, on the PGVector node there’s a prompt box, does this prompt behave like system prompt or like a user prompt? the difference between system and user prompt is that system prompt about the instruction whiile user prompt usually consist of the data that I want to search, in a sense should I place instruction there or should I place the data that I want to search there?
Note: currently I put parameter path there and it is referring to the data that I want to search.

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

Hi @ezraluandre
Taking the second question first since it’s the clearer one:
The “Prompt” field in Get Many mode is neither a system prompt nor a user prompt. It’s the search query. n8n embeds whatever you put there and runs the similarity search against your stored vectors, so {{ $json.text }} pointing at the text you want to match is correct. There’s no instruction vs data split here like with an LLM.
For the first question, templated data works, but that shared scaffolding is likely why your scores are compressed. Every record opens with the same labels (“Institutional Motivation:”, “Adaptation Objective:”, and so on) and near-identical stock phrasing, so much of each embedding is boilerplate common to all records. The distinctive part (Inveo vs eToro vs a planned city) gets diluted and everything lands close together, so nothing scores strongly. Two things to try:

  1. Strip the section labels and stock openings before embedding, and embed only the substantive content so the distinctive text drives the vector. Embedding each section as its own record instead of the whole block also helps.
  2. Confirm the exact same embedding model is connected when you insert and when you query. A model mismatch is the usual reason scores come back uniformly low, since the query vector and stored vectors no longer share the same space.
    The raw cosine score isn’t an absolute relevance scale, the ranking is what matters, but 0 to 0.2 across the board points at one of those two issues rather than the data being unusable.

look at the data first, because that’s the more likely cause.

Yes, this format will work with vector search, but the repeated template is probably working against you. Every document starts with the same section headings and very similar opening sentences, so a lot of each embedding ends up representing the shared structure instead of the unique information. That tends to compress the similarity scores, making the best match less distinct from the rest.

Try embedding a cleaner version that keeps the actual content but removes the repeated labels and boilerplate. Another thing worth checking is that you’re using the exact same embedding model when storing and querying vectors, if those don’t match, retrieval quality drops off quickly.

For your second question, the Prompt field isn’t a system prompt or a user prompt in the LLM sense. It’s simply the text that n8n converts into an embedding for the similarity search. So if you’re passing a parameter that contains the text you want to search for, you’re using it correctly. Any instructions about how to retrieve or use the results belong in your AI Agent or workflow, not in the PGVector node.