SiliconFlow

Interact with SiliconFlow AI models

Actions3

Overview

This node interacts with SiliconFlow AI models to perform a reranking operation. Specifically, the "Rerank" resource with the "Create" operation takes a search query and a list of documents, then uses a selected AI model to reorder these documents based on their relevance to the query. This is useful in scenarios such as improving search results, prioritizing content, or filtering information by relevance.

For example, if you have a set of product descriptions or articles and want to rank them according to how well they match a user's search query, this node can help by returning the most relevant documents at the top.

Properties

Name Meaning
Model The AI reranker model to use. Options include: Qwen3-Reranker-8B, Qwen3-Reranker-4B, Qwen3-Reranker-0.6B, BAAI/bge-reranker-v2-m3, Pro/BAAI/bge-reranker-v2-m3 (professional version), netease-youdao/bce-reranker-base_v1.
Query The search query string for which documents will be reranked.
Documents The documents to rerank, provided either one per line or comma-separated.
Additional Fields A collection of optional parameters:
- Top N Number of most relevant documents to return (minimum 1).
- Return Documents Boolean flag indicating whether to include the full document text in the response.
- Max Chunks Per Doc Maximum number of chunks for long documents (applicable only for BGE/YoudAo models).
- Overlap Tokens Number of token overlaps between chunks (max 80, applicable only for BGE/YoudAo models).

Output

The output JSON contains:

  • results: An array of reranked results, each representing a document scored and ordered by relevance.
  • query: The original search query string.
  • documentsCount: The total number of input documents processed.
  • usage: Token usage statistics returned by the API.
  • _rawResponse: The full raw response from the SiliconFlow API for debugging or extended processing.

If the "Return Documents" option is enabled, the response includes the text of the documents alongside their ranking.

Dependencies

  • Requires an active SiliconFlow API key credential configured in n8n.
  • The node makes HTTP POST requests to the SiliconFlow API endpoint /rerank.
  • The base URL and API key are obtained from the configured credentials.
  • Uses the Axios library internally for HTTP requests.

Troubleshooting

  • No documents provided: If the "Documents" field is empty or contains no valid entries, the node throws an error stating that at least one document must be provided. Ensure your input documents are correctly formatted and not empty.
  • Invalid API credentials: Authentication failures will occur if the API key or base URL is incorrect or missing. Verify your SiliconFlow API credentials in n8n settings.
  • Model compatibility: Some additional fields like "Max Chunks Per Doc" and "Overlap Tokens" apply only to specific models (BGE/YoudAo). Using them with incompatible models may lead to unexpected behavior.
  • API errors: Network issues or API limits might cause request failures. Check the error messages returned and ensure network connectivity and quota availability.
  • Input formatting: Documents can be separated by newlines or commas. Improper formatting might result in empty or malformed document arrays.

Links and References

Discussion