You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: RAGFlowConfig.rerankId uses Integer type but RAGFlow API expects String (model ID) #2740
In agentscope-extensions-rag-ragflow 2.0.2, the RAGFlowConfig class defines rerankId as Integer, but RAGFlow's /api/v1/retrieval API expects rerank_id to be a String (the rerank model ID, e.g. "BAAI/bge-reranker-v2-m3@BAAI" or a UUID hex string like "b2a62730759d11ef987d0242ac120004").
This makes it impossible to use the rerank feature via the Java SDK, because there is no way to pass a valid RAGFlow rerank model ID.
To Reproduce
Configure a rerank model in RAGFlow (e.g. BAAI/bge-reranker-v2-m3 via SiliconFlow).
Try to set the rerank model ID in RAGFlowConfig:
RAGFlowConfigconfig = RAGFlowConfig.builder()
.baseUrl("http://localhost:9380")
.apiKey("ragflow-xxx")
.datasetIds(List.of("abc123"))
.rerankId(???) // <-- expects Integer, but RAGFlow needs a String model ID
.build();
There is no valid Integer value that corresponds to a RAGFlow rerank model.
Expected behavior
rerankId should be of type String to match RAGFlow's API contract.
Root cause analysis
SDK code (RAGFlowConfig.java:76):
private final Integer rerankId;
Builder:
public Builder rerankId(Integer rerankId) { ... }
RAGFlow server (api/db/db_models.py):
In Tenant model:
rerank_id = CharField(max_length=128, null=False, help_text="default rerank model ID")
In Dialog model:
rerank_id = CharField(max_length=128, null=False, help_text="default rerank model ID")
RAGFlow uses string-based model identifiers (e.g. "BAAI/bge-reranker-v2-m3@BAAI"), not integer IDs.
Request body (RAGFlowClient.java:167-169):
if (config.getRerankId() != null) {
requestBody.put("rerank_id", config.getRerankId());
}
This sends an Integer in the JSON body where RAGFlow expects a String.
Fix
Change rerankId from Integer to String in:
RAGFlowConfig field declaration
RAGFlowConfig.getRerankId() return type
RAGFlowConfig.Builder.rerankId() parameter type
Environment
After checking the full test surface, this needs a wider API-compatibility decision than the small focused change I expected, so I'm stepping back and leaving it unclaimed rather than rushing a breaking change.
Activity
nightcityblade commentedon Aug 17, 2026
Hi, I'd like to work on this. I'll submit a PR shortly.
nightcityblade commentedon Aug 17, 2026
After checking the full test surface, this needs a wider API-compatibility decision than the small focused change I expected, so I'm stepping back and leaving it unclaimed rather than rushing a breaking change.
fix(ragflow): type rerankId as String to match the RAGFlow API
fix(ragflow): type rerankId as String to match the RAGFlow API (agent…