npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-vertex-ai-rag

v0.1.10

Published

Custom n8n nodes for Google Vertex AI RAG (Retrieval Augmented Generation) with separated credentials for embedding and vector search

Readme

n8n-nodes-vertex-ai-rag

Custom n8n nodes for Google Vertex AI RAG (Retrieval Augmented Generation) with isolated credentials.

Features

  • Query Embedding Generator: Generate embeddings from text queries using Vertex AI
  • Vertex Vector Search: Search for similar documents in Vertex AI Vector Search
  • Isolated Credentials: Separate service accounts for embedding and vector search operations
  • Flexible Configuration: Configure project, location, models, and search parameters per node

Installation

Community Nodes (Recommended)

  1. Go to Settings > Community Nodes in n8n
  2. Select Install
  3. Enter n8n-nodes-vertex-ai-rag
  4. Agree to the risks and install

Manual Installation

npm install n8n-nodes-vertex-ai-rag

Setup

Prerequisites

  1. Google Cloud Project with Vertex AI enabled
  2. Two Service Accounts (recommended for security):
    • Embedding SA: For generating embeddings
    • Vector Search SA: For searching indexed documents
  3. Service Account JSON keys

IAM Permissions

Embedding Service Account:

gcloud projects add-iam-policy-binding PROJECT_ID \
  --member="serviceAccount:embedding-sa@PROJECT_ID.iam.gserviceaccount.com" \
  --role="roles/aiplatform.user"

Vector Search Service Account:

gcloud projects add-iam-policy-binding PROJECT_ID \
  --member="serviceAccount:vector-search-sa@PROJECT_ID.iam.gserviceaccount.com" \
  --role="roles/aiplatform.indexEndpointUser"

Usage

1. Configure Credentials

Vertex AI Embedding API

  • Go to Settings > Credentials
  • Add Vertex AI Embedding API credential
  • Fill in:
    • Service Account Email
    • Private Key (from JSON key file)

Vertex AI Vector Search API

  • Add Vertex AI Vector Search API credential
  • Fill in:
    • Service Account Email
    • Private Key (from JSON key file)

2. Workflow Example

Webhook (receive user query)
  ↓
Query Embedding Generator (convert text to vector)
  ↓
Vertex Vector Search (find similar documents)
  ↓
AI Agent (generate answer with context)
  ↓
Respond to Webhook

3. Node Configuration

Query Embedding Generator

  • Project ID: Your GCP project ID
  • Location: Region (e.g., us-central1)
  • Query Text: Text to convert to embedding (e.g., {{ $json.body.chatInput }})
  • Embedding Model: Choose model (default: textembedding-gecko@003)

Vertex Vector Search

  • Project ID: Your GCP project ID
  • Location: Region (e.g., us-central1)
  • Index Endpoint ID: Your Vector Search index endpoint ID
  • Deployed Index ID: Your deployed index ID
  • Query Embedding: Vector from previous node (e.g., {{ $json.embedding }})
  • Number of Results: How many similar documents to return (default: 5)

Options:

  • Text Metadata Field: Metadata field containing document text (default: text)
  • Source Metadata Field: Metadata field containing document source (default: source)
  • Context Separator: Separator between documents (default: \n\n---\n\n)

Output Format

Query Embedding Generator Output

{
  "queryText": "How to reset password?",
  "embedding": [0.123, -0.456, 0.789, ...],
  "embeddingDimension": 768
}

Vertex Vector Search Output

{
  "context": "[Document 1]\nSource: manual.pdf\n\nTo reset password...\n\n---\n\n[Document 2]...",
  "documents": [
    {
      "rank": 1,
      "text": "To reset password, go to settings...",
      "source": "manual.pdf",
      "distance": 0.15,
      "id": "doc_123"
    }
  ],
  "documentsCount": 2
}

Security Best Practices

  • ✅ Use separate service accounts for each operation
  • ✅ Grant minimal required permissions (principle of least privilege)
  • ✅ Never hardcode credentials in workflows
  • ✅ Store credentials securely in n8n's credential manager
  • ✅ Rotate service account keys regularly

Troubleshooting

Authentication Errors

  • Verify service account has correct IAM roles
  • Check private key format (should include \n for line breaks)
  • Ensure service account is enabled

Vector Search Not Found

  • Verify index endpoint ID is correct
  • Confirm deployed index ID matches your deployment
  • Check that index is deployed and online

Embedding Dimension Mismatch

  • Ensure the embedding model matches the one used during indexing
  • Common dimensions: 768 (gecko@003), 768 (gecko@002)

Development

# Clone repository
git clone https://github.com/yourusername/n8n-nodes-vertex-ai-rag.git
cd n8n-nodes-vertex-ai-rag

# Install dependencies
npm install

# Build
npm run build

# Link for local development
npm link
cd ~/.n8n/custom
npm link n8n-nodes-vertex-ai-rag

License

MIT

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Support