[Feature] Add optional trace output to the RAG answer API for retrieval debugging
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- python
- Ambito
- ai, api, backend-api-design
Direzione di ricerca
Iniziare da hugegraph-llm/src/hugegraph_llm/api/rag_api.py, nel TODO di /rag e nella risposta attuale, quindi confrontare il relativo flusso con /rag/graph e il modello RAGRequest. Verificare come vengono restituiti i dati di graph recall e i test proposti per API, contract, flow e sensitive-config. Il lavoro è completo quando la risposta predefinita rimane compatibile e include_trace=true restituisce un graph trace strutturato per le modalità graph specificate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Search before asking
- 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
/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
- 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
/ragcan include graph trace data without parsing logs. - Reuse existing
/rag/graphfield 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
/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 --> Debug
Acceptance criteria
/ragwithoutinclude_tracekeeps the current response shape./ragwithinclude_trace=truereturns a structuredtraceobject.- Trace includes graph recall fields when
graph_onlyorgraph_vector_answeris used. - Vector recall and rerank trace fields are optional follow-up fields, not required for the first version.
- Missing unavailable trace sections are omitted or returned as empty structured values consistently.
Suggested tests
- API contract test for default
/ragresponse compatibility. - API test for
include_trace=true. - Flow-level test showing trace data is populated from graph recall.
- Test that sensitive config values are not included in trace.
Are you willing to submit a PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
- Lingua principale
- Python
- Stelle
- 144
- Fork
- 91
- Merge medio
- 7h 27m
- PR unite (30g)
- 7
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/hugegraph-ai
-
[Proposal] Ontogeny — a self-improving operational ontology platform built on HugeGraphForse di nuovo libera @simon824 l’ha presa 29 giorni fa e non c’è nessuna pull request aperta. Aperta
apache/hugegraph-ai#376 · 4 commenti · 2 reazioni · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] load_into_graph drops the whole vertex when one property value mismatches its declared type, then edges fail with a cryptic "Invalid vertex id"Forse di nuovo libera @KHARSHAVARDHAN-eng l’ha presa 41 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 48/100
apache/hugegraph-ai#373 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature] Add bounded chunk-level concurrency to graph extractionForse già presa @nw9663644-eng l’ha presa 109 giorni fa. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
apache/hugegraph-ai#344 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
apache/hugegraph-ai#310 · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
question
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
apache/hugegraph-ai#300 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/hugegraph-ai
Issue simili
-
parse names a key after a top-level multi() threshold Bitcoin Core v31.1 refuses as not validAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
btclib-org/btclib-wallet#587 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Judgment-Pack/judgment-pack-spec#275 ·
I maintainer di solito rispondono entro 1 giorno
-
ai-generated
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue priority: low size: XS
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
yeongseon/azure-functions-doctor-python#651 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Changaco/python-libarchive-c#146 ·