replace_source retires a source's facts when one LLM call fails
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python, typescript
Direzione di ricerca
The issue identifies Insert.text, _apply_facts, and _ops.replace_source as the relevant entry points; inspect how extraction partial failures are represented and handled in both SDKs. Reproduce the supplied Kuzu scenario and trace how failed calls affect retirement. Done when a failed LLM call during replacement does not silently retire facts, with the behavior covered in both SDKs.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
insert.text(..., source_id=..., replace_source=True) retires every relation the earlier versions of the source stated and the new text "no longer yields". When one LLM call fails on a chunk (a timeout, a rate limit, a provider error), extraction carries on with an extraction_partial_failure warning, and the relations that call would have returned count as no longer stated. They are retired with fact_retired_by_source.
So a transient provider error during a re-ingest silently removes valid facts from the current graph. Both SDKs do this.
Reproduce
On main (5a277c9), embedded Kuzu:
import asyncio, tempfile
from selfgraph import KuzuStore, SelfGraph
REPLY = {
"entities": [{"type": "Person", "name": "Ann"}, {"type": "Company", "name": "Acme"}],
"relations": [{"from_name": "Ann", "type": "WORKS_AT", "to_name": "Acme"}],
}
class LLM:
fail = False
async def generate(self, *, system, user, output):
kind = next(iter(output.model_fields))
if self.fail and kind == "relations":
raise TimeoutError("provider timed out")
return {kind: REPLY.get(kind, [])}
async def main():
with tempfile.TemporaryDirectory() as tmp:
llm = LLM()
async with SelfGraph(store=KuzuStore(f"{tmp}/g.kuzu"), llm=llm) as g:
await g.insert.text("Ann works at Acme.", source_id="doc", replace_source=True)
llm.fail = True
r = await g.insert.text("Ann works at Acme. She likes it.", source_id="doc", replace_source=True)
print([w.code for w in r.warnings], r.source_diff)
print([(x.type, x.is_current) for x in (await g.relations.list(include_invalidated=True)).items])
asyncio.run(main())
['extraction_partial_failure', 'fact_retired_by_source'] kept=[] added=[] retired=['relation:a4b698967fceb2c72cc81f83']
[('WORKS_AT', False)]
The TypeScript SDK gives the same warnings and source_diff for the same client.
Cause
Insert.text passes the extraction to _apply_facts with replace_source unchanged, and _ops.replace_source retires prior - produced without knowing that some LLM calls failed. When extraction_partial_failure comes from a failed call (not from dropping one invalid item), replacing the source should either fail or skip retirement for the affected chunks.
- Lingua principale
- TypeScript
- Stelle
- 173
- Fork
- 58
- Merge medio
- 6h
- PR unite (30g)
- 120
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
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 hydra-db/selfgraph
-
approved-for-pr area: cli-mcp area: errors bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
hydra-db/selfgraph#401 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: errors area: store bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
hydra-db/selfgraph#398 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: errors area: write bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
hydra-db/selfgraph#392 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: parity area: write bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hydra-db/selfgraph#391 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di hydra-db/selfgraph
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
code-yeongyu/senpi#7139 ·
I maintainer di solito rispondono entro 1 giorno
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
lingdojo/kana-dojo#34395 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
mastra-ai/mastra#31093 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:web p2 product:business triage:active type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
cuadrao-ai/argus#2328 ·
I maintainer di solito rispondono entro 1 giorno
-
bug frontend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
nikhilb2/simple_invoicing#907 ·