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
I had searched in the feature and found no similar feature requirement.
Feature Description (功能描述)
Feature Description
The /rag answer endpoint currently returns final answer fields only. For
retrieval debugging, users need an optional trace/debug response that includes
intermediate graph-recall information such as extracted keywords, matched vertex
IDs, generated Gremlin, graph recall results, and related graph debug fields.
The trace should be opt-in so the default response remains compact and backward
compatible. Vector recall and rerank traces can be handled as follow-up work
after the graph trace contract is stable.
Current verification
/rag has an explicit TODO saying more response information is needed for users to understand query logic in hugegraph-llm/src/hugegraph_llm/api/rag_api.py:79.
/rag currently returns only query and requested answer fields in hugegraph-llm/src/hugegraph_llm/api/rag_api.py:80.
/rag/graph already returns graph-recall intermediate fields including query, keywords, match_vids, graph_result_flag, gremlin, graph_result, and vertex_degree_list in hugegraph-llm/src/hugegraph_llm/api/rag_api.py:131.
RAGRequest does not currently define an include_trace or similar option.
Suggested scope
Add an opt-in request field, for example include_trace: bool = False.
Extend the graph-related RAG flow return contract or add a structured side channel so /rag can include graph trace data without parsing logs.
Reuse existing /rag/graph field names where possible.
Keep vector recall and rerank trace fields out of the required first version unless the implementation already exposes them cleanly.
Avoid leaking secrets or full prompt contents by default.
Keep the default /rag response compatible for existing users.
Search before asking
Feature Description (功能描述)
Feature Description
The
/raganswer endpoint currently returns final answer fields only. Forretrieval debugging, users need an optional trace/debug response that includes
intermediate graph-recall information such as extracted keywords, matched vertex
IDs, generated Gremlin, graph recall results, and related graph debug fields.
The trace should be opt-in so the default response remains compact and backward
compatible. Vector recall and rerank traces can be handled as follow-up work
after the graph trace contract is stable.
Current verification
/raghas an explicit TODO saying more response information is needed for users to understand query logic inhugegraph-llm/src/hugegraph_llm/api/rag_api.py:79./ragcurrently returns onlyqueryand requested answer fields inhugegraph-llm/src/hugegraph_llm/api/rag_api.py:80./rag/graphalready returns graph-recall intermediate fields includingquery,keywords,match_vids,graph_result_flag,gremlin,graph_result, andvertex_degree_listinhugegraph-llm/src/hugegraph_llm/api/rag_api.py:131.RAGRequestdoes not currently define aninclude_traceor similar option.Suggested scope
include_trace: bool = False./ragcan include graph trace data without parsing logs./rag/graphfield names where possible./ragresponse compatible for existing users.Mermaid reference
flowchart LR Request[/POST /rag include_trace/] Request --> RAG[RAG answer flow] RAG --> Answer[Answer fields] RAG --> Trace{include_trace?} Trace -->|false| Compact[Current response shape] Trace -->|true| Debug[trace: keywords, match_vids, gremlin, graph_result] Answer --> Compact Answer --> DebugAcceptance criteria
/ragwithoutinclude_tracekeeps the current response shape./ragwithinclude_trace=truereturns a structuredtraceobject.graph_onlyorgraph_vector_answeris used.Suggested tests
/ragresponse compatibility.include_trace=true.Are you willing to submit a PR?
Code of Conduct