Skip to content

feat: add Qdrant as alternative storage backend#700

Open
RobertoGEMartin wants to merge 1 commit intoMemPalace:developfrom
RobertoGEMartin:feat/qdrant-backend
Open

feat: add Qdrant as alternative storage backend#700
RobertoGEMartin wants to merge 1 commit intoMemPalace:developfrom
RobertoGEMartin:feat/qdrant-backend

Conversation

@RobertoGEMartin
Copy link
Copy Markdown

Summary

Adds Qdrant as an opt-in alternative to ChromaDB for the palace vector store. This resolves scalability issues when palaces exceed ~100K drawers (related to #688).

  • New QdrantBackend + QdrantCollection in mempalace/backends/qdrant.py, implementing BaseCollection
  • Backend selection via config.json: {"backend": "qdrant"} (ChromaDB remains the default)
  • Full ChromaDB filter compatibility: $eq, $ne, $in, $nin, $and, $or, $contains
  • Deterministic UUID5 ID mapping for reproducible migrations
  • Lazy imports — qdrant-client and sentence-transformers only loaded when Qdrant backend is active

Why Qdrant?

Metric ChromaDB Qdrant
Max tested drawers ~100K (SQLite variable limit) 168K+ (production-tested)
Storage (168K drawers) ~3.4 GB ~800 MB (~4x smaller)
Filter queries at scale Degrades (col.get() fails) Stable (payload indexes)

Installation

pip install mempalace[qdrant]

Then in ~/.mempalace/config.json:

{"backend": "qdrant"}

Changes

File Change
mempalace/backends/qdrant.py New: QdrantBackend + QdrantCollection (411 lines)
mempalace/backends/__init__.py Conditional Qdrant exports
mempalace/palace.py Config-driven backend selection
mempalace/config.py Added backend property
pyproject.toml Added qdrant optional dependency
tests/test_backends_qdrant.py 20 tests (unit + integration)
README.md Qdrant backend documentation

Test plan

  • All 20 Qdrant tests pass (17 unit + 3 integration)
  • All 6 existing ChromaDB backend tests still pass (zero regressions)
  • Ruff lint passes on all changed files
  • Production-tested with 168K+ drawers across 8 wings
  • CI pipeline validation

🤖 Generated with Claude Code

Adds QdrantBackend as an opt-in alternative to ChromaDB, selectable via
config.json. Scales beyond 100K drawers with ~4x less storage. Resolves MemPalace#688.

Install with: pip install mempalace[qdrant]
Enable with: {"backend": "qdrant"} in config.json

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant