Skip to content

feat(backends): storage backend plugins — pgvector, Qdrant, Redis, S3 (Step 1.1) - #40

Merged
officialCodeWork merged 1 commit into
mainfrom
build/phase-1/step-1.1-storage-backends
May 23, 2026
Merged

feat(backends): storage backend plugins — pgvector, Qdrant, Redis, S3 (Step 1.1)#40
officialCodeWork merged 1 commit into
mainfrom
build/phase-1/step-1.1-storage-backends

Conversation

@officialCodeWork

Copy link
Copy Markdown
Owner

Summary

  • New packages/backends/ (rag-backends) workspace package with five production-ready SPI implementations
  • MinIO added to the local dev stack as S3-compatible object storage
  • Integration test harness with auto-skip when services are not running

Backends delivered

Class SPI Backend Init required
PgVectorStore VectorStore PostgreSQL + pgvector await store.initialize()
QdrantVectorStore VectorStore Qdrant await store.initialize(dim)
RedisCache Cache Redis
S3Storage Storage AWS S3 / MinIO
LocalFileStorage Storage Filesystem

Test plan

  • 487 tests pass, 32 integration tests skip gracefully without services
  • task test-backends — LocalFileStorage unit tests (9 tests, no services needed)
  • task test-integration — full suite against live stack (skip-if-not-reachable)
  • ruff check . — clean
  • ruff format --check . — clean
  • mypy packages/ apps/gateway/ — clean (new mypy overrides for untyped 3rd-party libs)
  • Integration tests verified against task dev stack (run locally before merge)

Documentation

  • docs/adr/ADR-0004-storage-backends.md — decisions: single package, MinIO, graceful skip
  • docs/reference/backends.md — full public usage reference for all 5 backends
  • docs/architecture/storage-backends.md — architecture, tenant isolation, extension points
  • docs/README.md — updated index

Known gap (tracked)

rag_core.types.Embedding does not carry corpus_id. Both VectorStore backends store corpus_id = "" and skip corpus filtering until Phase 1.8 extends the Embedding type (documented in ADR-0004).

🤖 Generated with Claude Code

… (Step 1.1)

New `rag-backends` workspace package with production-ready SPI implementations:

- `PgVectorStore` — asyncpg + pgvector; ivfflat cosine index; `initialize()` DDL
- `QdrantVectorStore` — single collection with payload-based tenant isolation; qdrant-client 1.18 `query_points` API
- `RedisCache` — redis.asyncio; configurable key prefix + TTL
- `S3Storage` — aioboto3; works with AWS S3 and MinIO (S3-compatible)
- `LocalFileStorage` — aiofiles; path-traversal protected; no external deps

Infrastructure:
- MinIO added to docker-compose core profile (port 9000/9001; `rag-dev` + `rag-integration-test` buckets auto-created)
- `task test-integration` / `make test-integration` for service-dependent tests
- `task test-backends` / `make test-backends` for unit-level tests (no services)
- Integration tests auto-skip gracefully if backend not reachable

Quality:
- 487 tests pass (32 integration tests skip without services)
- mypy --strict clean; ruff clean; all checks pass
- mypy overrides for asyncpg, pgvector, aiofiles, aioboto3, qdrant-client

Docs: ADR-0004, docs/reference/backends.md, docs/architecture/storage-backends.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@officialCodeWork
officialCodeWork merged commit deb2454 into main May 23, 2026
10 checks passed
officialCodeWork pushed a commit that referenced this pull request May 23, 2026
Co-Authored-By: Claude Sonnet 4.6 <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