Hi Apache Geode community, I'm Goutham Reddy Aenugu (GitHub: gouthamaenugu). With develop on 2.1.0 and bundling Apache Lucene 9.12.3, I'd like to open a design discussion on adding native HNSW vector indexing and distributed hybrid k-NN search to geode-lucene (with zero new external dependencies).
Today geode-lucene indexes lexical text and scalar fields per partitioned bucket via LuceneService and gfsh search lucene, so workloads needing semantic retrieval or low-latency embedding search alongside partitioned regions have to maintain a separate vector store. Exposing Lucene 9.12.3's KnnFloatVectorField and HNSW graph indexing inside geode-lucene lets embeddings live directly alongside operational region entries under Geode's existing partitioning, redundancy, and persistence model. 1. Proposed Public API Shape ---------------------------- - VectorIndexMetadata (org.apache.geode.cache.lucene): immutable descriptor capturing fieldName, dimension, VectorSimilarityFunction (COSINE, DOT_PRODUCT, EUCLIDEAN), HNSW parameters (maxConnections M, beamWidth efConstruction), and optional 8-bit scalar quantization (quantizeSQ8). - LuceneIndexFactory & LuceneIndex: default fluent methods addVectorField(...) on LuceneIndexFactory and default getVectorFields() on LuceneIndex, plus zero-copy vector extraction from PdxInstance (via PdxInstance.getField without calling getObject()) and POJOs across the built-in Lucene serializers. - gfsh & Cluster Configuration: extend existing create/describe/search lucene commands and cluster configuration XML persistence with optional vector parameters, keeping lexical-only commands and XML backward-compatible. 2. Serialization & Wire Compatibility Impact -------------------------------------------- - Existing lexical-only indexes remain completely unchanged: all new interface methods are declared default, legacy LuceneRegionListener delegation is preserved, and non-vector indexes keep the default Lucene IndexWriterConfig and merge policy untouched. - Rolling-upgrade wire compatibility: LuceneIndexCreationProfile adds versioned toDataPre_GEODE_2_1_0_0 / fromDataPre_GEODE_2_1_0_0 serialization hooks and updates sanctionedDataSerializables.txt. - ObjectInputFilter safety: VectorIndexMetadata serializes similarityFunctionName as a String (rather than the third-party Lucene enum) and is registered in sanctioned-geode-lucene-serializables.txt. 3. Stacked Draft PR Series & Review Order ----------------------------------------- To keep reviews modular, I opened four draft PRs for early feedback and CI signal (recommended review order): 1. PR #8154 (PR 1 - base layer, start here): https://github.com/apache/geode/pull/8154 KnnFloatVectorField indexing, optional SQ8 codec (Lucene99HnswScalarQuantizedVectorsFormat), zero-copy PDX/POJO vector mapping, cluster profile validation, and vector-only bounded segment compaction. 2. PR #8156 (PR 2 - independent draft, composes with PR 1): https://github.com/apache/geode/pull/8156 Dual-epoch Tier-0 vector delta buffer for read-after-write visibility before AEQ commit, plus distributed per-bucket hybrid k-NN function with filter pushdown. 3. PR #8155 (PR 3 - stacked directly on #8154; merge after #8154): https://github.com/apache/geode/pull/8155 gfsh vector index CLI commands, cluster configuration XML persistence, and vector memory/segment metrics. 4. PR #8157 (PR 4 - independent draft, optional continuous listener layer): https://github.com/apache/geode/pull/8157 Adaptive SIMD / chordal Voronoi continuous vector similarity listener with Region Version Vector (RVV) monotonicity across primary-to-secondary failover. 4. Open Questions for the Community ----------------------------------- - Does extending LuceneIndexFactory and existing gfsh lucene commands feel like the right API shape, or would you prefer a separate vector index type/command set? - Are there specific rolling-upgrade, wire-compatibility, or serialization constraints beyond LuceneIndexCreationProfile versioning and sanctioned serializables that we should enforce up front? - For JIRA tracking, would you prefer one umbrella GEODE ticket with subtasks per PR, or four separate linked GEODE tickets? (I now have my ASF Jira account `gouthamaenugu` ready and am also preparing my ASF ICLA.) Thanks for your time and feedback! Best regards, Goutham Reddy Aenugu GitHub: gouthamaenugu
