Templates / Evaluate RAG response accuracy with OpenAI: document groundedness metric

Evaluate RAG response accuracy with OpenAI: document groundedness metric

Ready for 3.0

by Jimleuk ✓ · 1,850 views · created 2025-05-27 · Engineering, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 21 nodes and runs manually, when you click “Execute workflow” (plus 2 other triggers). Along the way it connects Embeddings OpenAI, OpenAI Chat Model and Evaluation. It also calls bitcoin.org over HTTP.

How it runs

Trigger: Manually, when you click “Execute workflow” (plus 2 other triggers).

  1. Get Datasheet (HTTP Request): calls bitcoin.org
  2. Remap Input (Edit Fields (Set)): sets 1 field: chatInput
  3. AI Agent: runs an AI agent, with model: OpenAI Chat Model; 1 tool (Simple Vector Store)
  4. Simple Vector Store: stores documents in the Simple vector store, with embeddings: Embeddings OpenAI; document loader: Default Data Loader
  5. Evaluation: check if evaluating
  6. Get Documents (Edit Fields (Set)): sets 2 fields: output, documents
  7. Document Grounding (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI Chat Model; output parser: Structured Output Parser
  8. Set Outputs (Evaluation): uses Evaluation
  9. Set Metrics (Evaluation): set metrics

Services it uses

Embeddings OpenAIOpenAI Chat ModelEvaluation

HTTP calls to: bitcoin.org

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (15)

From the author

This n8n template demonstrates how to calculate the evaluation metric "RAG document groundedness" which in this scenario, measures the ability to provide or reference information included only in retrieved vector store documents. The scoring approach is…

Excerpt from Jimleuk's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.