Skip to content

[geaflow/ai-memory] Add EntityVectorIndex wrapper around graph entity embeddings #853

Description

@kitalkuyo-gita

Priority: P0
Difficulty: Intermediate

Context: Graph entity embedding exists, but Phase 1 needs explicit entity-vector semantics for fuzzy entity anchoring.

Scope:

  • Wrap current EmbeddingIndexStore behavior behind EntityVectorIndex.
  • Add entity ID, entity type, model metadata, and vector version.
  • Add compatibility tests with existing EmbeddingOperator.

Constraints:

  • Do not change retrieval ranking yet.
  • Link existing embedding correctness fix issue/PR where applicable.

Acceptance Criteria:

  • Entity vector lookup can distinguish vertex and edge entities.
  • Dimension/model mismatch is detected before search.

Suggested paths:

  • geaflow-ai/src/main/java/org/apache/geaflow/ai/index/entity

Activity

  1. Mugetsu-bankai commented on Sep 23, 2026

    @Mugetsu-bankai

    Hi @kitalkuyo-gita, I’d like to take #853 (GM-AI-P1-019). My implementation plan is:

    1. Add EntityVectorIndex under geaflow-ai/.../index/entity, preserving the existing EmbeddingIndexStore and IndexStore#getEntityIndex(GraphEntity) behavior so EmbeddingOperator remains compatible.
    2. Introduce typed entity-vector records and lookup results containing a stable entity ID, vertex/edge kind, model metadata, vector version, and score. Vertex and edge IDs will have distinct, unambiguous encodings; multiple embeddings for one entity will remain identifiable.
    3. Align the new lookup/storage path with the VectorStore contract from [geaflow/ai-memory] Define VectorStore SPI with model metadata #851 / PR [ISSUE-851] implemented VectorStore and VectorStoreMetadata interfaces with validation and persistence #855. Validate model and dimension before searching, and restrict results to entity vectors. Legacy JSONL entries have no model metadata, so I’ll preserve their existing lookup behavior but require explicit metadata binding or migration before using them in the validated lookup path.
    4. Add offline tests with deterministic embeddings for vertex/edge distinction, ID collisions, model and dimension mismatches, multiple vectors per entity, and compatibility with the existing EmbeddingOperator. Its ranking and current global vertex-only behavior will remain unchanged in this issue.
    5. Reference the embedding correctness fix in geaflow-ai: is the embedding value filter meant to drop prose and keep digits? #830 / PR [ISSUE-830] Fix inverted embedding value filter that dropped digit-free text #832 and rebase on the final [geaflow/ai-memory] Define VectorStore SPI with model metadata #851 SPI contract before opening the PR.
      Please let me know if you prefer a different policy for legacy records without model metadata.
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