Skip to content

feat(knowledge): graph attribution is occupied by a constant — every entity's source is "ecl_pipeline" instead of the document it came from #17588

Open

Description

@mrveiss

Verdict

Every entity the knowledge pipeline writes to the graph is attributed to the
string "ecl_pipeline" — the name of the machinery that wrote it, not the
document it came from. Attribution is not missing; it is occupied.

autobot-backend/knowledge/pipeline/loaders/redis_graph_loader.py:93

"source": "ecl_pipeline",

So "which document did this fact come from?" has no answer, for every fact in
the graph. A consumer reading source gets a plausible, populated,
identically-valued field — which is why no check has caught it: any guard
asserting the field is non-empty passes.

The identity is already at the seam

autobot-backend/knowledge/pipeline/base.py:30

self.document_id: UUID | None = None

PipelineContext carries document_id through every stage, and
RedisGraphLoader receives that context and writes the constant anyway. The
value this field should hold is already in scope at the line that discards it.

That makes this the smallest possible change with the largest reach: no new
stage, no new producer, no schema decision.

DOCUMENT nodes exist today, and not for the reason anyone would assume

DOCUMENT has no ingest producer. It is produced only as a spaCy NER label
mapping — knowledge/pipeline/cognifiers/entity_extractor.py:51-52:

"LAW": "DOCUMENT",
"WORK_OF_ART": "DOCUMENT",

So ingesting a PDF creates a DOCUMENT node only if its text happens to
mention a law or an artwork.
That is vocabulary reuse, not attribution.

This matters for how the work is verified: a naive check for "do DOCUMENT
nodes exist?"
answers yes today, and would answer yes with nothing fixed.
The acceptance criteria below therefore assert the node's relationship to an
ingested document
, never its existence.

#17543 declared CODE and DOCUMENT in the vocabulary
(autobot_memory_graph/core.py:49-50). Declaring was the precondition; this is
the producer.

Scope: DOCUMENT only, and why CODE is excluded

CODE has no producer at all and cannot get one here.
codebase_indexing_service.py writes to Chroma directly — there is no
PipelineContext and no loader to extend, so linking code needs a seam built,
not extended. Whether codebase indexing should route through the ECL pipeline or
emit graph nodes alongside Chroma is a separate architectural decision and must
not ride on this change.

Supporting measurement: the autobot_code collection is referenced 0 times
from llc/ and 0 times from autobot_memory_graph/.

Acceptance criteria

  • RedisGraphLoader creates exactly one DOCUMENT node per ingested
    document, keyed on PipelineContext.document_id.
  • Every entity, relationship and event that loader writes attributes to that
    node's identity. No write carries "ecl_pipeline" as its source.
  • A test ingests two different documents and asserts the entities from each
    attribute to different DOCUMENT nodes. Existence-only assertions are
    explicitly insufficient — see the NER note above; a test that only checks
    DOCUMENT nodes exist passes on unfixed code.
  • A test covers document_id is None (the field is UUID | None) and
    asserts the loader does not invent an identity or silently fall back to a
    constant. Whatever it does instead must be distinguishable in the output
    from a real attribution.
  • A guard fails if any graph write reintroduces a literal constant as
    source, so the class cannot return by a different path.
  • The ACs above are verified against a real ingest, not a fixture alone,
    because the seam is the pipeline's own wiring.

Deconfliction

Neither blocks the other, and the seam between them is the source field this
issue gives a real value.

Related

#17543 (declared the vocabulary), #17527 (the round trip), #759 (the ECL
pipeline), #3230 (PropertyGraph typed edges)

Activity

  1. added this to the v0.9.0 milestone on Sep 27, 2026
  2. mrveiss commented on Sep 27, 2026

    @mrveiss
    OwnerAuthor

    This is one of two instances of the same defect — the other is #17631

    Recording the class rather than the incident, because a reader who finds one
    should find the other.

    Attribution exists in both stores. In the graph it is occupied by a
    constant
    — "source": "ecl_pipeline" at redis_graph_loader.py:93, the name
    of the machinery rather than the origin. In Chroma it is absent —
    source_id unwritten on the analysis path that holds 11,241 findings. A field
    present, a join impossible, and no signal to a consumer that the value means
    nothing.

    Neither needs new plumbing. Both are one write away from making the join
    possible, and both would pass any guard that only asserts the field is
    populated
    — which is why neither was caught.

    The Chroma half is #17631, measured on the deployment: the per-project
    attribution mechanism was shipped as a leakage fix (#1710), the read path
    requires it (where={"source_id": source_id}), and it is populated on 79 rows
    out of roughly 18,000. So it is implemented, proven, and unwritten on the path
    that matters — the same sentence as this issue with one word changed.

    Empirical support for this issue specifically, from the same measurement: the
    deployed memory graph has all three RediSearch indexes present and
    num_docs=0 on every one, with zero entity:* keys. So DOCUMENT has no
    ingest producer, as this issue states — and the NER path has never produced
    anything here either
    . One consequence worth recording: the "ecl_pipeline"
    constant cannot be demonstrated from live data, because there are no entity
    records to inspect. This issue stands on source evidence; the host corroborates
    the absence, not the constant.

  3. mrveiss commented on Sep 28, 2026

    @mrveiss
    OwnerAuthor

    Chunking triage — a proposal, not an assignment

    Nothing was relabelled, moved or closed by this pass.

  4. added
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Nov 2, 2026
  5. github-actions commented on Nov 2, 2026

    @github-actions
    Contributor

    needs-structure: this issue is missing:

    • a goal milestone M<n> - ...: v0.9.6 - knowledge base is not a goal milestone
    • a phase:M<n>.<k> label whose <n> matches the goal milestone: found none

    The label clears on the next issue event once all three are present (#19522).

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

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions