Smart RAG nodes are intelligent RAG (Retrieval-Augmented Generation) components that combine document processing, chunking, and retrieval operations into a single, optimized unit.

What are Smart RAG Nodes?

Smart RAG nodes automatically handle:
  • Document Processing: Intelligent document ingestion and preparation
  • Chunking: Automated text segmentation with optimal chunk sizes
  • Embedding Generation: Vector embeddings for semantic search
  • Retrieval: Query-based document retrieval with configurable Top K
  • Quality Metrics: Built-in evaluation and performance tracking

Available Endpoints

Smart RAG nodes are managed through two primary endpoints:
EndpointMethodPurposeDocumentation
List Smart RAG NodesGETRetrieve all smart RAG nodes from a flow📄 List Documentation
Update Smart RAG ConfigurationPATCHModify smart RAG node settings🔧 Update Documentation

Base URL Structure

https://{flow_name}.flows.graphorlm.com/smart-rag
  • : Your flow identifier
  • All endpoints require API token authentication
  • Content-Type: application/json for update operations

Node Structure

Smart RAG nodes follow the standard GraphorLM node structure:
{
  "id": "smart-rag-1748287628685",
  "type": "smart-rag",
  "position": {"x": 500, "y": 300},
  "style": {"height": 200, "width": 320},
  "data": {
    "name": "Intelligent Document Processing",
    "config": {
      "topK": 10
    },
    "result": {
      "updated": true,
      "processing": false,
      "waiting": false,
      "has_error": false,
      "total_processed": 1250,
      "total_chunks": 420
    }
  }
}

Configuration

Smart RAG nodes have a simple configuration:
ParameterTypeDefaultDescription
topKinteger | null5Number of top results to retrieve. Set to null for unlimited processing

Configuration Examples

Precision Strategy (Fast, focused results):
{
  "config": {
    "topK": 5
  }
}
Balanced Strategy (Good balance):
{
  "config": {
    "topK": 10
  }
}
Comprehensive Strategy (Thorough coverage):
{
  "config": {
    "topK": 20
  }
}
Unlimited Strategy (Complete analysis):
{
  "config": {
    "topK": null
  }
}

Authentication

All smart RAG endpoints require API token authentication:
Authorization: Bearer YOUR_API_TOKEN
Generate API tokens through the API Tokens guide.

Response Formats

Success Response

{
  "success": true,
  "message": "Operation completed successfully",
  "node_id": "smart-rag-1748287628685"
}

Error Response

{
  "detail": "Descriptive error message"
}

Basic Usage Example

import requests

# Get all Smart RAG nodes
response = requests.get(
    "https://my-flow.flows.graphorlm.com/smart-rag",
    headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
nodes = response.json()

# Update a node configuration
response = requests.patch(
    "https://my-flow.flows.graphorlm.com/smart-rag/smart-rag-123",
    headers={
        "Authorization": "Bearer YOUR_API_TOKEN",
        "Content-Type": "application/json"
    },
    json={"config": {"topK": 10}}
)
result = response.json()

Best Practices

  • Start Simple: Begin with topK: 10 and adjust based on your needs
  • Monitor Performance: Track processing times and resource usage
  • Test Incrementally: Make small configuration changes and measure impact
  • Enable Metrics: Use built-in metrics to evaluate retrieval quality

Next Steps