Overview
The Update Reranking Configuration endpoint allows you to modify the configuration of reranking nodes within your flows. Reranking nodes use sophisticated Large Language Model scoring to intelligently reorder retrieved documents by relevance, and updating their configuration is essential for optimizing result quality, processing efficiency, and system performance.- Method:
PATCH
- URL:
https://{flow_name}.flows.graphorlm.com/reranking/{node_id}
- Authentication: Required (API Token)
Authentication
All requests must include a valid API token in the Authorization header:Learn how to generate API tokens in the API Tokens guide.
Request Format
Headers
Header | Value | Required |
---|---|---|
Authorization | Bearer YOUR_API_TOKEN | Yes |
Content-Type | application/json | Yes |
URL Parameters
Parameter | Type | Required | Description |
---|---|---|---|
flow_name | string | Yes | The name of the flow containing the reranking node |
node_id | string | Yes | The unique identifier of the reranking node to update |
Request Body
The request body should be a JSON object with the following structure:Field | Type | Required | Description |
---|---|---|---|
config | object | Yes | The new configuration for the reranking node |
Config Object Structure
Field | Type | Required | Description |
---|---|---|---|
topK | integer | No | Maximum number of documents to return after reranking (null for unlimited) |
Example Request
Response Format
Success Response (200 OK)
Response Structure
Field | Type | Description |
---|---|---|
success | boolean | Whether the update was successful |
message | string | Descriptive message about the update result |
node_id | string | The ID of the updated reranking node |
Code Examples
JavaScript/Node.js
Python
cURL
PHP
Error Responses
Common Error Codes
Status Code | Description | Example Response |
---|---|---|
400 | Bad Request - Invalid configuration parameters | {"detail": "topK must be a positive integer or null"} |
401 | Unauthorized - Invalid or missing API token | {"detail": "Invalid authentication credentials"} |
404 | Not Found - Flow or node not found | {"detail": "Reranking node not found"} |
422 | Unprocessable Entity - Validation error | {"detail": "Invalid topK value"} |
500 | Internal Server Error - Server error | {"detail": "Failed to update reranking node"} |
Error Response Format
Example Error Responses
Invalid Configuration
Node Not Found
Invalid Top K Value
Configuration Guidelines
Top K Selection Strategy
High Precision (1-5)
- Best for: Critical decisions, high-stakes applications
- Characteristics: Maximum relevance, minimal noise
- Trade-offs: May miss some relevant results
- Use cases: Medical diagnosis, legal research, financial advice
Balanced Performance (6-15)
- Best for: General applications, typical Q&A systems
- Characteristics: Good balance of quality and coverage
- Trade-offs: Optimal for most use cases
- Use cases: Customer support, knowledge bases, general search
Comprehensive Coverage (16-30)
- Best for: Research, exploratory analysis
- Characteristics: Broader result set, better recall
- Trade-offs: May include less relevant results
- Use cases: Academic research, market analysis, comprehensive reviews
Unlimited Processing
- Best for: Complete analysis, no result limits
- Characteristics: Process all retrieved documents
- Trade-offs: Higher resource usage and processing time
- Use cases: Research projects, complete document analysis
Performance Considerations
Resource Optimization
- Lower Top K: Reduces LLM processing resource usage
- Higher Top K: Increases quality but requires more resources
- Unlimited: Maximum resource usage for complete analysis
Processing Time
- Lower Top K: Faster processing, quicker responses
- Higher Top K: Slower processing, more comprehensive results
- Unlimited: Longest processing time
Quality vs Efficiency
- Quality Priority: Use higher Top K values (15-25)
- Efficiency Priority: Use lower Top K values (5-10)
- Balanced Approach: Use moderate Top K values (10-15)
Update Behavior
Immediate Effects
- Configuration changes are applied instantly
- Node status changes to
updated: false
indicating reprocessing needed - Previous results remain available until reprocessing
Reprocessing Requirements
After configuration updates, you should:- Re-run the flow to apply new reranking settings
- Monitor quality impact to validate configuration changes
- Adjust based on results to optimize for your specific use case
Best Practices for Updates
- Test incrementally with different Top K values
- Monitor quality metrics before and after changes
- Consider resource implications of higher Top K values
- Document configuration rationale for future reference
Integration Examples
Automated Quality Optimizer
Configuration Validator and Recommender
Best Practices
Configuration Management
- Start Conservative: Begin with lower Top K values (5-10) and adjust based on quality needs
- Test Systematically: Use A/B testing to compare different Top K values
- Monitor Impact: Track both quality improvements and resource implications
- Document Rationale: Keep records of configuration decisions and their outcomes
Performance Optimization
- Balance Quality vs Resources: Higher Top K improves quality but increases resource usage
- Consider Use Case: Critical applications need fewer, higher-quality results
- Monitor Processing Time: Higher Top K values increase processing time
- Plan for Scale: Consider resource implications when scaling to high query volumes
Quality Assurance
- Measure Impact: Compare result quality before and after reranking
- User Feedback: Collect feedback on result relevance and usefulness
- Regular Review: Periodically assess if Top K settings remain optimal
- Context Matters: Adjust Top K based on query complexity and domain
Resource Management
- Set Limits: Establish resource usage limits for processing
- Monitor Usage: Track resource consumption across different Top K settings
- Optimize Strategically: Use higher Top K only where quality impact justifies resource usage
- Consider Alternatives: Evaluate if similar quality can be achieved with lower Top K
Troubleshooting
Invalid Configuration Parameters
Invalid Configuration Parameters
Solution: Verify that:
topK
is a positive integer or null- Value is reasonable for your use case (typically 1-50)
- Configuration follows the correct JSON structure
Poor Quality After Update
Poor Quality After Update
Solution: If reranking quality decreased:
- Increase
topK
to include more diverse results - Check if retrieval input quality is sufficient
- Monitor reranking scores and positions
- Consider if the change was too aggressive
Slow Processing After Update
Slow Processing After Update
Solution: If processing is too slow:
- Reduce
topK
to process fewer documents - Check LLM service performance
- Monitor system resource usage
- Consider if unlimited processing is necessary
Configuration Not Taking Effect
Configuration Not Taking Effect
Solution: After updating configuration:
- Re-run the flow to apply new settings
- Check that the node status shows
updated: false
- Verify configuration was saved correctly
- Allow time for reprocessing to complete
High Resource Usage
High Resource Usage
Solution: For resource optimization:
- Review
topK
settings across all reranking nodes - Monitor processing resource metrics
- Consider reducing
topK
for less critical applications - Implement resource usage alerts and limits