Skip to content

[Bug]: RAGFlowConfig.rerankId uses Integer type but RAGFlow API expects String (model ID) #2740

Closed

Description

@qlprimer

Describe the bug

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

  1. Configure a rerank model in RAGFlow (e.g. BAAI/bge-reranker-v2-m3 via SiliconFlow).
  2. Try to set the rerank model ID in RAGFlowConfig:
    RAGFlowConfig config = RAGFlowConfig.builder()
        .baseUrl("http://localhost:9380")
        .apiKey("ragflow-xxx")
        .datasetIds(List.of("abc123"))
        .rerankId(???)  // <-- expects Integer, but RAGFlow needs a String model ID
        .build();
  3. 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:
  1. RAGFlowConfig field declaration
  2. RAGFlowConfig.getRerankId() return type
  3. RAGFlowConfig.Builder.rerankId() parameter type
    Environment
  • AgentScope version: 2.0.2
  • Module: agentscope-extensions-rag-ragflow
  • RAGFlow version: latest (v0.x)

Activity

  1. added
    bug
    on Aug 17, 2026
  2. nightcityblade commented on Aug 17, 2026

    @nightcityblade

    Hi, I'd like to work on this. I'll submit a PR shortly.

  3. nightcityblade commented on Aug 17, 2026

    @nightcityblade

    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.

  4. added
    area/ext/rag
    on Aug 17, 2026
  5. added a commit that references this issue on Aug 19, 2026
    12a0aa6
  6. moved this from Backlog to In progress in AgentScope Javaon Aug 19, 2026
  7. moved this from In progress to Done in AgentScope Javaon Aug 20, 2026
  8. added a commit that references this issue on Aug 20, 2026
    643905e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ext/ragbug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions