vector #1

Merged
despiegk merged 10 commits from vector into main 2026-01-18 06:13:48 +00:00
Owner
No description provided.
- Add hannoy 0.1.2 dependency for HNSW-based vector similarity search
- Create vector module with VectorIndex, supporting multiple distance metrics:
  - Cosine similarity
  - Euclidean (L2) distance
  - Manhattan (L1) distance

- Implement Redis commands for vector operations:
  - VECTOR.CREATE / VCREATE - create an index with dimensions and metric
  - VECTOR.ADD / VADD - add a vector with ID
  - VECTOR.ADDMULTI / VADDMULTI - batch add vectors
  - VECTOR.GET / VGET - retrieve a vector by ID
  - VECTOR.DEL / VDEL - delete a vector
  - VECTOR.SEARCH / VSEARCH - search for nearest neighbors by vector
  - VECTOR.SEARCHBYID / VSEARCHBYID - find similar items by ID
  - VECTOR.BUILD / VBUILD - build the HNSW index
  - VECTOR.INFO / VINFO - get index information
  - VECTOR.LIST / VLIST - list all indexes
  - VECTOR.DROP / VDROP - drop an index
  - VECTOR.CLEAR / VCLEAR - clear all vectors
  - VECTOR.EXISTS / VEXISTS - check if vector exists
  - VECTOR.LEN / VLEN - get vector count

- Add client API methods for all vector operations
- Add Rhai scripting bindings for vector operations
- Add example script: rhai_examples/07_vectors.rhai
- Remove vector DB limitation note from crypto README
- Add --admin-secret flag for simple auth (alternative to Ed25519)
- AUTH command now accepts secrets directly (Redis Desktop Manager compatible)
- Add SAUTH command for explicit secret-based auth
- Add USER.CREATESECRET to create users with username/secret
- USER.GRANT/REVOKE now work with both pubkeys and usernames
- Secrets hashed with SHA-256 before storage
- Change default port to 6666
- run.sh automatically creates database 1 on startup
- Add ai_embeddings.md documentation for vector search
- Update README with dual authentication modes
- Multiple users can access the same database with different permissions
- USER.GRANT/REVOKE work with both pubkeys and usernames
- Add DATABASE.PUBLIC command to enable/disable public read-only access
- Public databases allow unauthenticated users to:
  - SELECT the database
  - Execute read-only commands (GET, KEYS, HGETALL, etc.)
  - Vector search commands (VECTOR.SEARCH, etc.)
- Write operations still require authentication
- Database 0 can never be made public (admin database)
- Update README with public access documentation
Features:
- VECTOR.ADDBATCH command with binary format for bulk vector insertion
- ~97x faster than individual VECTOR.ADD commands (21,000+ vec/s vs 224 vec/s)
- BulkBytes variant in RESP protocol for binary data
- vector_add_batch() function in Rhai scripts
- memory_info() function to get server memory usage
- Real memory tracking in INFO MEMORY command

Binary format:
- Header: num_vectors (u32) + dimensions (u32) = 8 bytes
- Per vector: id (u32) + f32 × dimensions
- All integers little-endian

Performance (10K vectors, 128 dims):
- Individual adds: 224 vec/s
- Binary batch: 21,742 vec/s
- Build time: 71 ms
- Search: 0.14 ms avg (7,242 QPS)
- client: Redis client with Ed25519 auth (default)
- server: Redis server with redb backend
- rhai: Rhai scripting support
- vector: HNSW vector similarity search
- full: All features

Added comprehensive client README with examples.
Updated main README with feature flags documentation.
despiegk deleted branch vector 2026-01-18 06:14:00 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_redis!1
No description provided.