Skip to content

[RFC] Feature Request: Introducing an Ingestion-Time Extension Hook for Knowledge Graph Hygiene #1880

Description

@DataAlchmesit

Description
I am analyzing your ingestion pipeline (specifically tracing the flow from raw source data/episodes through extraction and final bulk persistence). While your prompt engineering and extraction layers are incredibly sophisticated at managing graph topology and edge-fragmentation rules, there is an open architectural opportunity regarding semantic memory hygiene.

The Structural Gap
During multi-party dialogues or entries involving third parties (e.g., "My brother is a lawyer"), upstream LLMs can occasionally misattribute entity relationships during the initial extraction pass.

Currently, there is no deterministic middleware hook or validation callback phase between the resolution of these graph elements and their final bulk persistence to verify if the extracted triples remain semantically faithful to the raw input string.

An Open Question on Topology Pressures
Because graph optimization rules naturally pressure the model to prefer direct entity paths and drop scenery nouns, I am curious if the maintainers have noticed this compaction pressure occasionally collapsing human intermediaries (e.g., accidentally collapsing a relationship through a "colleague" directly into the primary User entity).

Proposed Solution
I want to propose an opt-in validator hook interface right before records are committed to the graph database:

async def verify_graph_hygiene(extracted_edges: list, source_text: str) -> list:
    # Local NLI/Attribution filtering runs here out-of-band
    return verified_edges

graph = Client(config={
    "ingest_validator": verify_graph_hygiene
})

Does an ingestion-time interceptor contract align with your architectural roadmap, and would you be open to a minimal PR exploring this hook structure?

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions