Reranking nodes use Large Language Models to improve the quality and relevance of retrieved documents in your RAG pipeline by intelligently reordering results.

What are Reranking Nodes?

Reranking nodes are processing components that use LLMs (like GPT-4) to evaluate and reorder documents retrieved by your system. They analyze documents with deep semantic understanding to improve result relevance.

Key Features

  • LLM-Powered: Use advanced language models for intelligent document scoring
  • Quality Enhancement: Improve result precision and user satisfaction
  • Flexible Configuration: Adjust the number of results to return (Top K)
  • Performance Control: Balance quality improvements with processing speed

Available Endpoints

EndpointMethodPurpose
List Reranking NodesGETGet reranking node configurations
Update Reranking ConfigurationPATCHModify reranking settings

Configuration

Top K Parameter

The main configuration option is topK - the maximum number of documents to return after reranking:
  • Small values (3-5): Fast processing, highest precision
  • Medium values (8-15): Balanced performance and quality
  • Large values (20-30): More comprehensive results, slower processing
  • null: Process all documents (highest resource usage)

Example Configuration

{
  "config": {
    "topK": 10
  }
}

Node Structure

{
  "id": "reranking-1748287628687",
  "type": "reranking",
  "data": {
    "name": "LLM Reranking",
    "config": {
      "topK": 10
    },
    "result": {
      "updated": true,
      "processing": false,
      "total_reranked": 847
    }
  }
}

Common Use Cases

Customer Support

  • Top K: 5-8
  • Goal: Provide precise answers to customer queries
  • Benefits: Faster resolution, better satisfaction
  • Top K: 10-15
  • Goal: Help users find information efficiently
  • Benefits: Better search experience

Research Applications

  • Top K: 20-30 or null
  • Goal: Comprehensive results for analysis
  • Benefits: Thorough coverage, better insights

Authentication

All endpoints require API token authentication:
Authorization: Bearer YOUR_API_TOKEN

URL Structure

https://{flow_name}.flows.graphorlm.com/reranking[/{node_id}]

Basic Usage Example

// List all reranking nodes
const response = await fetch('https://my-flow.flows.graphorlm.com/reranking', {
  headers: { 'Authorization': 'Bearer YOUR_API_TOKEN' }
});
const nodes = await response.json();

// Update a reranking node
await fetch('https://my-flow.flows.graphorlm.com/reranking/node-id', {
  method: 'PATCH',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    config: { topK: 15 }
  })
});

Best Practices

  1. Start Small: Begin with lower Top K values and increase as needed
  2. Monitor Performance: Track processing time and resource usage
  3. Test Changes: Compare results before and after configuration changes
  4. Match Use Case: Choose Top K based on your specific requirements

Error Handling

Common errors and solutions:
  • “topK must be a positive integer or null”: Check parameter type
  • “Reranking node not found”: Verify node ID
  • “Failed to update reranking node”: Check system status and retry

Next Steps