Skip to content

Generalize point-lookup pathway (implementation lands in runtimedb) #34

Description

@rohan-hotdata

Context

Part of the "AI-native query layer" exploration for hotdata-langchain (single query_hotdata(...) tool routing across SQL/BM25/vector/point-lookup pathways — see internal plan notes). Point lookups are one of the four named retrieval pathways, and currently have no first-class, standalone path anywhere in the stack.

Note: the actual code change for this issue lands in hotdata-dev/runtimedb, not this repo. Tracked here to keep AI-native-layer roadmap items in one place.

Findings (verified via direct code investigation)

datafusion-vector-search-ext's PointLookupProvider::fetch_by_keys(keys, key_col, projection) (src/lookup.rs:66-76) is already a general-purpose abstraction with zero ANN-specific logic — three implementations exist (HashKeyProvider, SqliteLookupProvider, and the production FeatherLookupProvider: sorted Arrow IPC + binary search + mmap), none of which assume the keys came from a USearch search.

The actual coupling is in runtimedb:

  • The lookup sidecar is only ever built inside the vector-index build/update pipeline (runtimedb/src/vector/mod.rs, build_vector_index_from_batches / update_vector_index_from_batches, ~lines 443-660) — a table with no vector column has no sidecar today.
  • RegisteredTable / VectorIndexResolver (registry.rs) require a USearch Index to exist before a lookup provider can be attached.
  • RuntimeDB core has no other exact point-lookup mechanism outside this (only approximate Parquet row-group/bloom pruning and a coarse sorted-range index).

Scope to generalize

  1. Decouple lookup-sidecar lifecycle from the vector-index build pipeline in runtimedb/src/vector/mod.rs, so it can be built for any table with a declared key column, independent of a vector column.
  2. Loosen (or add a parallel path in) RegisteredTable / VectorIndexResolver so a lookup-only entry doesn't require a vector index.
  3. Add a small UDTF mirroring VectorSearchVectorUDTF (udtf.rs:43-91), e.g. point_lookup('conn.schema.table', 'key_col', ARRAY[...]).

Estimated as a moderate, scoped refactor — not a redesign. (1) and (2) are entirely in runtimedb; (3) is small once those land.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-native-layerPart of the AI-native query layer effort for LangChainenhancementNew feature or requestrepo:runtimedbImplementation lands in runtimedb (engine)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions