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-rag

v1.0.0

Published

Advanced RAG (Retrieval-Augmented Generation) knowledge base nodes for n8n

Readme

n8n-nodes-rag

Advanced RAG (Retrieval-Augmented Generation) knowledge base nodes for n8n.

Features

This package provides two powerful nodes for building RAG applications:

🗄️ RAG Knowledge Base Node

  • Text Processing: Clean and preprocess text data with customizable options
  • Intelligent Chunking: Multiple strategies (fixed size, sentence-based, paragraph-based)
  • Vector Embeddings: Support for OpenAI, Hugging Face, and custom embedding providers
  • Flexible Storage: Plugin interface for various vector databases (Qdrant, Milvus)
  • Operations: Store, delete, and count documents

🔍 RAG Retrieval Node

  • Multiple Search Types: Vector search, full-text search, and hybrid search
  • Configurable Results: Customizable limits, score thresholds, and filtering
  • Metadata Support: Include or exclude metadata in search results
  • AI-Ready Output: Formatted results perfect for AI agent workflows

Installation

npm install n8n-nodes-rag

Supported Vector Databases

  • Qdrant: Cloud and self-hosted vector database
  • Milvus: Open-source vector database
  • Extensible: Easy to add new vector store adapters

Supported Embedding Providers

  • OpenAI: text-embedding-ada-002 and other models
  • Hugging Face: Wide range of open-source models
  • Custom API: Bring your own embedding service

Quick Start

1. Setup Vector Database

Start with Qdrant (easiest option):

docker run -p 6333:6333 qdrant/qdrant

2. Create Knowledge Base

  1. Add RAG Knowledge Base node to your workflow
  2. Connect your text data source
  3. Configure chunking strategy and embedding provider
  4. Set vector database connection details
  5. Execute to process and store your documents

3. Retrieve Information

  1. Add RAG Retrieval node to your workflow
  2. Configure the same vector database settings
  3. Set your search query and parameters
  4. Choose search type (vector, full-text, or hybrid)
  5. Execute to get relevant results

Configuration Examples

Basic Text Processing

{
  "operation": "store",
  "chunkingStrategy": "sentence",
  "chunkSize": 1000,
  "overlap": 200,
  "generateEmbeddings": true,
  "embeddingProvider": "openai"
}

Vector Search

{
  "searchType": "vector",
  "limit": 10,
  "threshold": 0.7,
  "includeMetadata": true
}

Hybrid Search

{
  "searchType": "hybrid",
  "limit": 10,
  "alpha": 0.5,
  "threshold": 0.6
}

Use Cases

📚 Document Q&A Systems

Build intelligent document search and question-answering systems.

🤖 AI Agent Knowledge Base

Provide contextual information to AI agents and chatbots.

🔍 Semantic Search

Create powerful semantic search experiences for your applications.

📊 Content Analytics

Analyze and categorize large collections of text documents.

Architecture

Text Processing Pipeline

  1. Input Validation: Ensure text data is properly formatted
  2. Text Cleaning: Remove extra whitespace, normalize line breaks
  3. Chunking: Split text using configurable strategies
  4. Embedding Generation: Create vector representations
  5. Storage: Save to vector database with metadata

Search Pipeline

  1. Query Processing: Generate embeddings for search queries
  2. Vector Search: Find semantically similar content
  3. Full-text Search: Keyword-based matching
  4. Hybrid Search: Combine vector and full-text results
  5. Result Ranking: Score and filter results

Advanced Features

Custom Metadata Filtering

Filter search results based on document metadata:

{
  "source": "documentation",
  "category": "technical",
  "date": { "$gte": "2024-01-01" }
}

Chunking Strategies

  • Fixed Size: Split by character count with overlap
  • Sentence: Respect sentence boundaries
  • Paragraph: Maintain paragraph structure
  • Semantic: AI-powered semantic chunking (future)

Vector Store Adapters

Easily extend support for additional vector databases by implementing the VectorStoreAdapter interface.

API Reference

RAG Knowledge Base Node Parameters

| Parameter | Type | Description | |-----------|------|-------------| | operation | string | Operation to perform (store/delete/count) | | inputField | string | Field containing text data | | chunkingStrategy | string | How to split text (fixed/sentence/paragraph) | | chunkSize | number | Maximum chunk size in characters | | overlap | number | Character overlap between chunks | | generateEmbeddings | boolean | Whether to create vector embeddings | | embeddingProvider | string | Embedding service (openai/huggingface/custom) |

RAG Retrieval Node Parameters

| Parameter | Type | Description | |-----------|------|-------------| | query | string | Search query text | | searchType | string | Search method (vector/fulltext/hybrid) | | limit | number | Maximum results to return | | threshold | number | Minimum similarity score | | includeMetadata | boolean | Include document metadata | | metadataFilter | string | JSON filter for metadata |

Troubleshooting

Common Issues

Empty results from vector search

  • Check that embeddings were generated during storage
  • Verify embedding provider settings match between store and search
  • Adjust similarity threshold (try lower values like 0.5)

API rate limits

  • Use batch processing for large documents
  • Implement delays between API calls
  • Consider using local embedding models

Vector database connection errors

  • Verify endpoint URL and API key
  • Check network connectivity
  • Ensure collection/index exists

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

MIT License - see LICENSE for details.

Support


Built with ❤️ for the n8n community