Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Load each node's nearest neighbours among a set of ids, in one statement on every store (port of drivine4j#232)

オープン
#119 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
neo4j, postgresql, python
領域
backend, databases

調査の方向性

Start by reading the existing loadNearest implementation and the backend hooks for each store; the issue names no files or tests to begin from. Port the NearestAmongCrossEngineTest dataset and cases from drivine4j, then implement the fragment, view, and Python sync and async forms across the listed stores. Done means the cross-store cases pass, including score parity, ordering, validation, and the documented refusals.

索引モデルが issue の本文から書いたものです。

説明

Port of liberation-data/drivine4j#232.

What it does: for each of a set of node ids, return its nearest neighbours among that same set, in one statement on every store. Callers currently write this as an UNWIND over the ids with Neo4j's vector procedure per seed, which runs only on Neo4j.

Shape (drivine4j): loadNearestAmong(graphClass, ids, topK, threshold?, property?, searchK?): Map<id, List<Scored<id>>>.

  • Keys: each id whose node has the embedding, in the order given. Ids are deduplicated; an unknown id, or one with no embedding (or a wrong-size one where the store leaves it out), is not a key.
  • Values: up to topK other ids from the set, never the id itself, most similar first. Each carries the score loadNearest gives that pair on the store. Results below threshold are dropped.
  • searchK: the candidates an approximate index is asked for per seed. It defaults to topK + 1, and a searchK below topK is refused.
  • Refusal: an empty set still validates the class and property before returning {}.
  • Shapes: works on a fragment and on a view; Python sync and async forms (the root fragment's embedding).

Backend hook: nearestAmong(class, property, ids, topK, threshold, searchK), returning one row per seed, {seed, near: [{id, score}]}.

Per store:

Store How
Neo4j UNWIND $ids, match each seed, db.index.vector.queryNodes with the seed's own embedding; always rescore exactly with vector.similarity.*, since the result is always trimmed
FalkorDB the same with db.idx.vector.queryNodes; pass the stored vector as it is, without vecf32(), which takes only a list
Memgraph the same with vector_search.search
Postgres the seeds in a CTE; per seed the pgvector index's nearest joined back to the set, or every same-size seed measured when no index is made
Oracle the seeds in a CTE with ROW_NUMBER; with an index, CROSS APPLY (… FETCH APPROX FIRST searchK) over its side table; with none, every same-size pair measured
Neptune refused, as loadNearest is

The Cypher vector head needs to take its vector from an expression and carry variables through its closing WITH.

Tests to port: drivine4j's NearestAmongCrossEngineTest, with its data set: A, B, C, D in one plane; X outside the set; E with no embedding; Z unknown. It covers:

  • results only from the set, an outsider and the seed absent;
  • the topK cap and the threshold cut;
  • absent keys;
  • scores equal to loadNearest's;
  • a view against its fragment, and naming the property;
  • key order and the searchK shortfall;
  • refusals.
主要言語
Python
スター
1
フォーク
0
平均マージ
1時間 16分
マージ済み PR(30日)
74

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

liberation-data/drivine-python のほかの issue

liberation-data/drivine-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。