From 9f2a9a01c3318e4ae23d0a13b6f82e04a621021b Mon Sep 17 00:00:00 2001 From: Daniel Chalef <131175+danielchalef@users.noreply.github.com> Date: Thu, 2 Oct 2025 15:22:54 -0700 Subject: [PATCH] fix: Align fact field naming and add description - Change extraction rule to reference 'fact' instead of 'fact_text' - Add descriptive text for fact field in Edge model --- graphiti_core/prompts/extract_edges.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/graphiti_core/prompts/extract_edges.py b/graphiti_core/prompts/extract_edges.py index de581369..e8ce607c 100644 --- a/graphiti_core/prompts/extract_edges.py +++ b/graphiti_core/prompts/extract_edges.py @@ -30,7 +30,10 @@ class Edge(BaseModel): target_entity_id: int = Field( ..., description='The id of the target entity from the ENTITIES list' ) - fact: str = Field(..., description='') + fact: str = Field( + ..., + description='A natural language description of the relationship between the entities, paraphrased from the source text', + ) valid_at: str | None = Field( None, description='The date and time when the relationship described by the edge fact became true or was established. Use ISO 8601 format (YYYY-MM-DDTHH:MM:SS.SSSSSSZ)', @@ -116,7 +119,7 @@ You may use information from the PREVIOUS MESSAGES only to disambiguate referenc 2. Each fact must involve two **distinct** entities. 3. Use a SCREAMING_SNAKE_CASE string as the `relation_type` (e.g., FOUNDED, WORKS_AT). 4. Do not emit duplicate or semantically redundant facts. -5. The `fact_text` should closely paraphrase the original source sentence(s). Do not verbatim quote the original text. +5. The `fact` should closely paraphrase the original source sentence(s). Do not verbatim quote the original text. 6. Use `REFERENCE_TIME` to resolve vague or relative temporal expressions (e.g., "last week"). 7. Do **not** hallucinate or infer temporal bounds from unrelated events.