Skip to main content
This quickstart walks you through building a complete RAG (Retrieval-Augmented Generation) pipeline in Graphor. You’ll create a pipeline that retrieves relevant information from your documents and generates natural language responses.

Prerequisites

Before starting, ensure you have:
  • A Graphor project with ingested and parsed documents
  • At least one source with status “Processed”
If you haven’t ingested documents yet, see the Quickstart or Data Ingestion guide first.

Pipeline Overview

You’ll build this pipeline:
Dataset → Chunking → Retrieval → LLM → Response

                 Question/Testset
NodePurpose
DatasetSelects which documents to include
ChunkingSplits documents into searchable chunks
RetrievalFinds relevant chunks based on queries
Question/TestsetProvides queries to test the pipeline
LLMGenerates natural language responses
ResponseOutputs the final result

Step 1: Create a New Flow

  1. Navigate to Flows in the left sidebar
  2. Click New Flow
  3. Enter a name (e.g., “my-first-rag”)
  4. Click Create
You’ll see the Flow Builder canvas with available nodes in the left sidebar.

Step 2: Add the Dataset Node

The Dataset node is the starting point — it defines which documents your pipeline will use.
  1. Drag the Dataset node from the sidebar onto the canvas
  2. Double-click the node to open its configuration
  3. Select the documents you want to include:
    • Check individual files, or
    • Select all files using the header checkbox
  4. Close the configuration panel
Dataset configuration
Start with a few documents for faster testing. You can add more later.

Step 3: Add the Chunking Node

The Chunking node splits your documents into smaller pieces that can be efficiently searched.
  1. Drag the Chunking node onto the canvas
  2. Connect DatasetChunking by dragging from Dataset’s output (right) to Chunking’s input (left)
  3. Double-click Chunking to configure:
SettingRecommended ValueDescription
Embedding Modeltext-embedding-3-smallConverts text to vectors for search
Elements to RemoveHeader, Footer, Page numberRemoves noise from chunks
SplitterSmart chunkingPreserves semantic meaning
Chunk Size5000Maximum characters per chunk
  1. Click Update Results to process the chunks
  2. Review the chunking results to verify quality
Chunking configuration

Step 4: Add the Retrieval Node

The Retrieval node searches your chunks to find information relevant to user queries.
  1. Drag the Retrieval node onto the canvas
  2. Connect ChunkingRetrieval
  3. Double-click Retrieval to configure:
SettingRecommended ValueDescription
Search TypeSimilaritySemantic search using embeddings
Top K5Number of chunks to retrieve
Score Threshold0.5Minimum relevance score (0-1)
Retrieval configuration

Step 5: Add a Question Node for Testing

Before adding the LLM, let’s test that retrieval works correctly using a Question node.
  1. Drag the Questions node onto the canvas
  2. Connect QuestionsRetrieval (Questions provides input to Retrieval)
  3. Double-click Questions to configure:
    • Enter a test question related to your documents
    • Example: “What is the main topic of this document?”
  4. Click Update Results on the Retrieval node
  5. Review the retrieved chunks — do they contain relevant information?
If the retrieved chunks aren’t relevant, try:
  • Adjusting the Score Threshold (lower = more results)
  • Increasing Top K (more chunks retrieved)
  • Using a different Search Type

Step 6: Add the LLM Node

The LLM node takes the retrieved chunks and generates a natural language response.
  1. Drag the LLM node onto the canvas
  2. Connect RetrievalLLM
  3. Double-click LLM to configure:
SettingRecommended ValueDescription
ModelGPT-4o or GPT-4 MiniThe language model to use
System PromptSee example belowInstructions for the LLM
Example System Prompt:
You are a helpful assistant that answers questions based on the provided context.
Always base your answers on the information given in the context.
If the context doesn't contain enough information to answer, say "I don't have enough information to answer this question."
Be concise and accurate.
  1. Click Update Results to see the generated response
LLM configuration

Step 7: Add the Response Node

The Response node provides the final output of your pipeline.
  1. Drag the Response node onto the canvas
  2. Connect LLMResponse
  3. Click Update Results on the Response node
Your complete pipeline is now built!

Testing with Testsets

For more comprehensive testing, use a Testset instead of (or in addition to) single Questions.

Creating a Testset

  1. Navigate to Testsets in the left sidebar
  2. Click New Testset
  3. Add multiple test questions:
    • Questions that cover different topics in your documents
    • Questions with varying complexity
    • Edge cases (questions that might not have answers)
  4. Optionally add expected answers for evaluation
  5. Save the testset

Using a Testset in Your Flow

  1. Drag the Testset node onto the canvas
  2. Connect TestsetRetrieval (same as Questions)
  3. Double-click Testset and select your created testset
  4. Click Update Results to run all questions through the pipeline
  5. Review results for each question
Testset selection
You can have both Question and Testset nodes connected to the same Retrieval node for flexible testing.

Deploying Your Pipeline

Once your pipeline is working well:
  1. Click Deploy new revision in the top-right corner
  2. Add a Tool description (important for MCP integration):
    This tool answers questions about [your document topics].
    Use it when users ask about [specific topics covered].
    
  3. Enable Display this revision immediately
  4. Click Create
Your pipeline is now deployed and accessible via:
  • REST API — For custom application integration
  • MCP Server — For AI assistant integration (Claude, Cursor)
Click Connect to flow to see your endpoint URLs and integration instructions.

Quick Reference: Node Settings

NodeKey Settings
DatasetSelect files to include
ChunkingEmbedding model, Splitter type, Chunk size
RetrievalSearch type, Top K, Score threshold
QuestionTest queries for quick testing
TestsetMultiple queries for comprehensive testing
LLMModel selection, System prompt
ResponseOutput format

Troubleshooting

  • Ensure you’re dragging from output (right) to input (left)
  • Check that the connection is allowed (see node compatibility)
  • Verify previous nodes are properly configured
  • Lower the Score Threshold
  • Increase Top K
  • Try Hybrid search type
  • Check if documents are properly parsed
  • Improve the System Prompt with clearer instructions
  • Increase Top K to provide more context
  • Try a different LLM model
  • Check that retrieval is returning relevant chunks
  • Reduce the number of selected documents
  • Lower Top K value
  • Use a faster embedding model
  • Use GPT-4 Mini instead of GPT-4o

Next Steps