Skip to content

[geaflow/ai-memory] Add minimal ANN adapter interface #854

Open

Description

@kaori-seasons

Priority: P1
Difficulty: Intermediate

Context: Current vector search is linear TopN. Phase 1 can ship with linear search, but the contract should allow an ANN implementation later.

Scope:

  • Add NearestNeighborIndex interface.
  • Provide linear adapter as default implementation.
  • Add tests for deterministic scoring and tie-break order.

Constraints:

  • Do not add heavy ANN dependency in this issue.
  • Do not claim performance improvement.

Acceptance Criteria:

  • Linear adapter passes the same contract that an ANN adapter will use.
  • Tie-break behavior is documented.

Suggested paths:

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

Activity

  1. E2ern1ty commented on Oct 9, 2026

    @E2ern1ty
    Contributor

    I'd like to work on this. Plan: add a NearestNeighborIndex interface under geaflow-ai's index/ann package with a linear default adapter, document the tie-break order (score descending, then insertion order), and cover it with a contract test suite designed so a future ANN adapter can run the exact same tests. No new dependencies, no behavior change to existing paths.

  2. E2ern1ty commented on Oct 9, 2026

    @E2ern1ty
    Contributor

    PR: #878

  3. E2ern1ty commented on Oct 12, 2026

    @E2ern1ty
    Contributor

    Completed by merged PR #878: the NearestNeighborIndex contract, the linear default adapter, and the reusable contract-test suite (shape + exactness tiers) are now on master under geaflow-ai/src/main/java/org/apache/geaflow/ai/index/ann. Tie-break behavior is documented in the interface javadoc and enforced by tests. Closing this out — happy to pick up the ANN-side follow-up work when the roadmap wants it.

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