query.nearest_unindexed
Nearest-neighbour order on a vector with no fixed length.
Area 21, AI; not declinable; the next step is usually the agent's.
nearest on a vector field whose type has no dimensions:: a plain
Vector, or an Embedding, which keeps its vector without a length.
pgvector builds an HNSW index only on a column of fixed length.
/// A reply an agent is still writing, with its meaning as a model made it.entity DraftReply { id: Uuid reply_meaning: Vector}/// The five replies nearest one being written.query similar_drafts(reply_meaning: Vector) -> List<Nearest<DraftReply>> { from: DraftReply order: [DraftReply.reply_meaning nearest reply_meaning] limit: 5}
error DraftReply.reply_meaning has no fixed length, so no index can order it by nearness
--> main.jadpo:10:13
|10 | order: [DraftReply.reply_meaning nearest reply_meaning] | ^^^^^^^^^^^^^^^^^^^^^^^^ a `Vector` without `dimensions:`
- reason
- A nearest-neighbour query reads an HNSW index, which pgvector builds only on a vector column of fixed length, and
DraftReply.reply_meaningis aVector, kept without one. - next
- Give
DraftReply.reply_meaninga type built onVectorwith the model'sdimensions:(agent) - rule
- query.
nearest_ unindexed - help
- https://jadpo.
dev/docs/errors/query. nearest_ unindexed
Markdown for agents: /docs/errors/query.nearest_unindexed.md.Built from Jadpo main at aee2e8f.