Skip to main content

ADR-006: Remove deprecated MemoryModule (pgvector)

Date: 2026-05-13 Status: Accepted Issue: Dead code cleanup (rag-pipeline-1.2)

Contextโ€‹

MemoryModule (api/src/memory/) used OpenAI text-embedding-3-small + pgvector for per-org vector similarity search. It was superseded by the Haystack pipeline (api/src/haystack/) which provides document lifecycle management, hybrid search (vector + keyword), and managed chunking on pgvector.

Decisionโ€‹

Delete MemoryModule and MemoryService. Remove all imports from app.module.ts, data-source.ts, and seed scripts. The AgentMemory entity remains in entities.ts (deprecated) to avoid accidental table drops. The agent_memories table stays in the database but is no longer read or written by application code.

Consequencesโ€‹

  • Haystack is the sole retrieval substrate for all orgs
  • ~240 lines of dead code removed
  • No migration needed (table preserved, just unused)