Load each node's nearest neighbours among a set of ids, in one statement on every store (port of drivine4j#232)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
调研方向
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
topKother ids from the set, never the id itself, most similar first. Each carries the scoreloadNearestgives that pair on the store. Results belowthresholdare dropped. searchK: the candidates an approximate index is asked for per seed. It defaults totopK + 1, and asearchKbelowtopKis 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
topKcap and the threshold cut; - absent keys;
- scores equal to
loadNearest's; - a view against its fragment, and naming the property;
- key order and the
searchKshortfall; - refusals.
- 主要语言
- Python
- 星标
- 1
- 派生
- 0
- 平均合并
- 1 小时 16 分钟
- 30 天内合并 PR
- 74
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
liberation-data/drivine-python 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
liberation-data/drivine-python#154 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
liberation-data/drivine-python#152 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
liberation-data/drivine-python#150 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
liberation-data/drivine-python#138 ·
维护者通常 1 天内回复
-
Cypher on SQL stores: all(), any(), none() and single() are two-valued where the predicate is null未关闭
难度 4/5 3-5 天 新手友好度 55/100
liberation-data/drivine-python#159 ·
维护者通常 1 天内回复
查看 liberation-data/drivine-python 的全部 Issue
相似的 Issue
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-free可能已有人在做 @Aaqibhafeezkhan 今天认领。 未关闭beginner documentation good first issue
难度 2/5 1-3 小时 新手友好度 75/100
BistaDinesh03/critique#164 · 1 条评论 ·
维护者通常 1 天内回复
-
bug IO
难度 2/5 1-3 小时 新手友好度 65/100
MrNeRF/LichtFeld-Studio#3824 ·
维护者通常 1 天内回复
-
bug confirmed issue
难度 2/5 1-3 小时 新手友好度 72/100
open-webui/open-webui#33200 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog check可能已有人在做 @ocelotl 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 82/100
open-telemetry/opentelemetry-python#5825 ·
维护者通常 2 天内回复