Skip to content

NU-008 Compiler: SchemaLLMPathExtractor with provenance enrichment #22

Closed

Description

@BasuruK

Part of #30.

The Compiler: turn an approved Reviewed Source into typed graph triples with an explicit
decisions[].

Build

SchemaLLMPathExtractor with:

possible_entities  = Literal["DECISION", "ENTITY", "EVIDENCE"]
possible_relations = Literal["SUPERSEDES", "EVIDENCED_BY", "AFFECTS", "DEPENDS_ON", "PART_OF"]
kg_validation_schema = {...}
strict = True

Pydantic-validated triples — the schema guardrail is enforced by the library rather than by prompt
discipline.

LLM is OpenAILike so any OpenAI-compatible endpoint works. Add a startup check that structured
output actually works
on the configured endpoint — compatible endpoints vary wildly in JSON-mode
fidelity, and SchemaLLMPathExtractor depends on it. Fail loudly at boot, not at 3am on malformed
triples.

The write-side hole this closes

PRD §3 defines LLM-Wiki as a Markdown document with four sections — Executive Summary, Core
Entities & Relationships, Known Issues & Verified Solutions, Cross-References — and calls it "the
only form the graph ever ingests."
None of those four sections is a Decisions section, yet
FR-5 requires persisting Decisions out of it. Worse, author — which FR-5 makes mandatory on
every Decision node — appears in neither upstream schema.

So LLM-Wiki becomes structured output with an explicit decisions[], not prose. If it stayed
prose, author/timestamp/evidence_span would exist only as words inside a paragraph and
persistence would have to re-extract them — a second lossy pass, and two places that can
disagree about what the author's name was.

Enrichment seam the library does not cover

SchemaLLMPathExtractor yields typed nodes and edges. It does not carry author,
author_source, timestamp, evidence_span, or provenance ref-sets. allowed_entity_props is a
list of permitted property names, not a typed validated model — and author_source originates
in the parser, which the extractor never sees. Needs a custom extractor subclass or a
post-extraction enrichment step stamping these before insert_nodes().

Do not use PropertyGraphIndex.from_documents() — it does chunk→extract→persist in one shot,
and this pipeline splits those across two human gates.

Activity

  1. added
    wayfinder:taskWayfinding child ticket: implementation task
    ready-for-agentFully specified, ready for an AFK agent
    on Aug 17, 2026
  2. changed the title [-]Compiler: SchemaLLMPathExtractor with provenance enrichment[/-] [+]NU-007 Compiler: SchemaLLMPathExtractor with provenance enrichment[/+] on Aug 17, 2026
  3. changed the title [-]NU-007 Compiler: SchemaLLMPathExtractor with provenance enrichment[/-] [+]NU-008 Compiler: SchemaLLMPathExtractor with provenance enrichment[/+] on Aug 17, 2026
  4. self-assigned this
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ready-for-agentFully specified, ready for an AFK agentwayfinder:taskWayfinding child ticket: implementation task

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions