Commit graph

2 commits

Author SHA1 Message Date
Kayzo
f5cea7c51e fix(memory): batch onnx embeddings and sqlite-vec ops
Make the ONNX + sqlite-vec memory path truly batched.

Batch ONNX embed_batch calls, batch sqlite-vec index/remove work under a single cached connection, and update MCP warm-up to use batch embed/save/index flows.

Add focused regression tests for ONNX batching, sqlite-vec single-connection batch behavior, and MCP warm-up batching.

Skip the MCP-specific test when optional MCP dependencies are not installed.

Refs #240
2026-04-24 09:49:28 +00:00
chopratejas
84ad47eba9 Add SQLiteVectorIndex using sqlite-vec for bounded vector search
A SQLite-based alternative to HNSWVectorIndex offering:
- True CRUD operations (real deletes, not marks)
- Bounded memory via SQLite page cache (default 8MB)
- Persistent storage by default
- Cosine similarity search
- Native integration potential with FTS5 for hybrid search

New files:
- headroom/memory/adapters/sqlite_vector.py: Implementation
- tests/test_sqlite_vector_index.py: 16 comprehensive tests

Dependencies:
- sqlite-vec added as optional dependency (pip install sqlite-vec)
- Requires Python built with loadable extension support

Key advantages over HNSWVectorIndex:
- No SIGILL crash risk (pure C, no AVX requirement)
- True deletes (not just marks, space actually reclaimed)
- Simpler persistence (SQLite handles it automatically)
- Consistent with SQLiteGraphStore (same technology stack)
2026-02-01 21:23:09 -08:00