Scalability Study of HNSW

Scaling HNSWs in Redis

Original article: Scaling HNSWs (via Hacker News)

Salvatore Sanfilippo has spent much of this year working on vector sets for Redis, first released in Redis 8 (May 2024).

---

Background

A central part of this effort involved implementing HNSW — Hierarchical Navigable Small World, an indexing technique introduced in Malkov & Yashunin (2016).

Salvatore’s implementation notes offer an in-depth look at:

* Clean, well-commented C source code

* Practical extensions to support efficient deletions and updates

* Strategies for scaling large HNSW vector sets across multiple Redis nodes

---

Key Innovations

  • Efficient Deletion and Update
  • Modifications to the standard HNSW algorithm allow removing and updating vectors without rebuilding entire indexes.
  • Distributed Scaling
  • Large vector sets can be divided across multiple nodes to enable parallel reads and writes.
  • Memory-Conscious Design
  • Embedding vectors consume significant memory — distributing them across nodes helps avoid bottlenecks.

---

Parallel Querying Across Nodes

Quoting Salvatore:

> If you have different vectors related to the same use case split across different instances/keys, you can query VSIM with the same query vector across all instances, add the WITHSCORES option (which returns the cosine distance), then merge the results client-side.

> This scales datasets of hundreds of millions of vectors by splitting them N times.

> You can query these N instances in parallel using multiplexing—provided your client library supports it.

---

Parallel Write Operations

> HNSWs in raw form allow writes to scale more easily.

> Approach: hash each element `modulo N` → select corresponding Redis key/instance → write concurrently.

> Multiple instances can handle slower HNSW writes in parallel, making bulk insert/update workloads faster.

---

* vector-sets/hnsw.c

* vector-sets/vset.c

---

Implications for AI Workflows

For teams building large-scale vector search systems or parallelized ingestion pipelines, these scaling methods fit neatly into modern AI-driven content workflows.

Platforms such as AiToEarn官网 integrate:

* AI-based content generation

* Cross-platform publishing (Douyin, Kwai, WeChat, Bilibili, Rednote, Facebook, Instagram, LinkedIn, Threads, YouTube, Pinterest, X)

* Analytics & performance tracking

* AI model ranking

This brings similar scalability benefits — connecting distributed querying in Redis with distributed content publishing, allowing creators and engineers alike to move from concept to delivery at scale.

---

Summary:

Salvatore’s HNSW enhancements in Redis 8 provide a textbook example of engineering for performance, scalability, and maintainability. Developers tackling large, memory-intensive vector datasets now have practical tools to query and write in parallel, opening the door for high-performance AI search, recommendation, and generative systems.

---

Would you like me to also diagram the N-node scaling strategy from this article? That could make the parallel query/write process visually clear.

Read more

BlueCodeAgent Uses Red Team Methods to Enhance Code Security

BlueCodeAgent Uses Red Team Methods to Enhance Code Security

Introduction Large Language Models (LLMs) are increasingly used for automated code generation across diverse software engineering tasks. While they can boost productivity and accelerate development, this capability also introduces serious security risks: * Malicious code generation — intentional requests producing harmful artifacts. * Bias in logic — discriminatory or unethical patterns embedded in generated

By Honghao Wang
Multi-Agent Collaboration Model Based on Strands Agents and Amazon Nova | Amazon Web Services

Multi-Agent Collaboration Model Based on Strands Agents and Amazon Nova | Amazon Web Services

# Multi-Agent Generative AI Systems ### Harnessing Amazon Nova for Scalable Orchestration Multi-agent generative AI systems coordinate **multiple specialized AI agents** to solve complex, multi-dimensional tasks beyond the scope of any single model. By integrating agents with different skills or modalities — such as **language**, **vision**, **audio**, and **video** — they can work in

By Honghao Wang