Set up DuckDB schema and VSS extension #28

Closed
opened 2026-03-08 10:48:42 +01:00 by shahondin1624 · 1 comment

Description

Configure DuckDB with the VSS (Vector Similarity Search) extension. Define the memory storage schema with tables for memories, embeddings, provenance, and correlations.

Acceptance Criteria

  • DuckDB initialized with VSS extension loaded
  • Schema: memories table (id, content, timestamp, session_id, agent_id, provenance)
  • Schema: embeddings table linked to memories with vector column
  • Schema: correlations table for cross-reference lookups
  • HNSW index configured for vector similarity search
  • Schema migration support

Blocked by

## Description Configure DuckDB with the VSS (Vector Similarity Search) extension. Define the memory storage schema with tables for memories, embeddings, provenance, and correlations. ## Acceptance Criteria - [ ] DuckDB initialized with VSS extension loaded - [ ] Schema: memories table (id, content, timestamp, session_id, agent_id, provenance) - [ ] Schema: embeddings table linked to memories with vector column - [ ] Schema: correlations table for cross-reference lookups - [ ] HNSW index configured for vector similarity search - [ ] Schema migration support ## Blocked by - #27
shahondin1624 added this to the Phase 4: Memory Service milestone 2026-03-08 10:48:42 +01:00
Author
Owner

Implementation Complete

PR #113 implements the DuckDB schema and VSS extension for the Memory Service.

What was implemented:

  • DuckDbManager with VSS extension loading, connection management (Mutex<Connection>), and with_connection() API
  • Schema: memories, embeddings (FLOAT[768] vectors), correlations, memory_tags, schema_version tables
  • HNSW index for vector similarity search (deferred creation pattern for empty tables)
  • Versioned migration system with idempotency

Quality Gates: All PASS

  • Build, Clippy, Tests (25 memory-service, 87 total), Coverage (97%+ on new files)

Notable deviations:

  • DuckDB doesn't support ON DELETE CASCADE — manual deletion order required
  • DuckDB VSS doesn't support filtered HNSW indexes — single unfiltered index with query-time filtering

🤖 Auto-implemented by Claude Code

## Implementation Complete PR #113 implements the DuckDB schema and VSS extension for the Memory Service. ### What was implemented: - `DuckDbManager` with VSS extension loading, connection management (`Mutex<Connection>`), and `with_connection()` API - Schema: `memories`, `embeddings` (FLOAT[768] vectors), `correlations`, `memory_tags`, `schema_version` tables - HNSW index for vector similarity search (deferred creation pattern for empty tables) - Versioned migration system with idempotency ### Quality Gates: All PASS - Build, Clippy, Tests (25 memory-service, 87 total), Coverage (97%+ on new files) ### Notable deviations: - DuckDB doesn't support `ON DELETE CASCADE` — manual deletion order required - DuckDB VSS doesn't support filtered HNSW indexes — single unfiltered index with query-time filtering 🤖 Auto-implemented by Claude Code
Sign in to join this conversation.