Skip to content

[upstream PR 300] feat: add sqlite-vec vector backend with Strategy pattern #752

@wbugitlab1

Description

@wbugitlab1

Source: Source pull request number: 300 in rohitg00/agentmemory (URL omitted to avoid GitHub cross-reference)
Title: feat: add sqlite-vec vector backend with Strategy pattern
Author: Tanmay-008
State: open
Draft: no
Merged: no
Head: Tanmay-008/agentmemory:perf/vector-search-sqlite-vec @ f8c30f2
Base: main @ 1c8713f
Labels: (none)
Changed files: 0
Commits: 0
Created: 2026-05-12T10:40:08Z
Updated: 2026-05-17T09:42:42Z
Closed: (not closed)
Merged at: (not merged)

Original PR body:

  • Introduce VectorBackend interface with MemoryVectorIndex (default) and SqliteVectorIndex (opt-in via VECTOR_BACKEND=sqlite-vec)
  • Two-table schema (vec_meta + vec_data) with ACID transactions
  • Auto-migration from legacy KV store to sqlite-vec on startup
  • Dynamic imports with graceful fallback for native deps
  • optionalDependencies + postinstall.js for native dep detection
  • All methods now async to support both sync and async backends
  • Benchmark: 100k vectors baseline (MemoryVectorIndex ~40ms search)

838/838 tests passing, zero regressions.

Summary by CodeRabbit

  • New Features

    • Configurable vector storage backends: choose persistent SQLite or in-memory vectors via env
    • Added a standalone vector performance benchmark and reporting output
  • Improvements

    • Vector operations are now asynchronous for more reliable ingestion and reporting
    • Automatic legacy vector data migration during startup
    • Post-install check for optional native dependencies with install guidance
  • Chores

    • Added optional native packages to enable SQLite-backed vectors

Review Change Stack

Local branch:
Fork PR:
Fork decision:
Verification:
Notes:

Metadata

Metadata

Assignees

No one assigned

    Labels

    decision-candidateFork decision has not been madeupstream-openUpstream pull request is openupstream-prTracks an upstream pull request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions