Basic Tutorial
Example 4: A Basic RAG

Example 4: A Basic RAG


eg3f

This workflow includes:

  • Retrieve steps: abcd
  • Then, d and e are merged into f
  • f and e generate g

🟢 Execution:

  1. The first layer runs: abcd
  2. Once both d and e are ready, the edge runs to update f
  3. Generate g

🟡 Demo:

1. Create a File block → upload your file → Create a load edge.

eg3f

2. Run the edge to load the file.

eg3f

3. You can see the output here:

eg3f
  • Click * to create root node.
  • Click + to generate the Embedding View.
  • Click Loop Mood Button Icon enables concurrent processing of each element inside a structured block.

4. Create Convert to Text edge.

eg3f

5. Generate the text.

eg3f

6. Create a Chunking Edge.

eg3f
  • Auto
    • Easiest and fastest option.
    • Automatically splits content by line breaks.
    • No additional configuration needed.
    • Best for pre-formatted content like lists or short paragraph.
  • By length
    • Splits content strictly by character count without using any semantic rules.
    • Configurable:
      • Chunk Size: Max characters per chunk.
      • Overlap: Repeated characters between chunks.
      • Handle Half Word: Prevents breaking words in half .(set to True if using English or similar languages)
    • Ideal when uniform chunk length is needed.
  • By character
    • Uses custom user-defined delimiters to split content.
    • Configurable:
      • Delimiters: Choose one or more. (e.g., comma, period, space)
    • Suitable for data with predictable formatting, like CSV or semicolon-separated values.

7. Run the Chunking Edge and create Retrieve Edge.

eg3f

8. Create a Text Block to describe your question and connect to the Retrieve edge.

eg3f

9. Modify your Retrieve Edge:

eg3f
  • Query: The text or structured query from user or workflow
  • Data source with Vector indexing: The indexed structured content (chunks with embedding vectors)
  • Settings:
    • Result Number: Number of top results to return (default: 5)
    • Threshold: Minimum similarity score (0–1). Default is 0.7. Results below this value will be filtered out.

10. Run the Retrieve Edge.

eg3f

11. Generate the Answer.

eg3f