Skip to content

debezium/dbz#2128 feat: add PGVector adapter and core logging improve…#11

Open
KMohnishM wants to merge 1 commit into
gsoc-week-4-chatbotfrom
gsoc-week-5-pgvector
Open

debezium/dbz#2128 feat: add PGVector adapter and core logging improve…#11
KMohnishM wants to merge 1 commit into
gsoc-week-4-chatbotfrom
gsoc-week-5-pgvector

Conversation

@KMohnishM

Copy link
Copy Markdown
Contributor

Description

This Pull Request implements the first half of GSoC Week 5 targets under tracking issue debezium/dbz#2128. It introduces support for the PGVector (PostgreSQL) vector database backend and establishes a standardized, library-wide logging and observability framework.

Key Changes

  1. PGVector Adapter:
    • Implemented PGVectorAdapter in pydebeziumai/adapters/pgvector.py extending the core VectorStoreAdapter contract.
    • Leveraged the langchain-postgres backend underneath to perform idempotent upsert, delete, and retriever generation.
    • Registered PGVectorAdapter in the public adapters interface (pydebeziumai/adapters/__init__.py).
  2. Standardized Logging & Observability:
    • Integrated python-native logging throughout all core lifecycle layers.
    • SyncManager: Log all CDC synchronization activities (INFO level for inserts, updates, deletes, and soft-deletes) and clear warnings for retries and Dead Letter Queue (DLQ) routing.
    • DocumentBuilder: Added debug logs tracing document parsing, building, and tombstone discard phases.
    • IdStrategy & ProjectionPolicy: Injected debug logs indicating selected formatting policies and resolved document ID values.
  3. Tests:
    • Added a comprehensive unit/mock test suite in tests/unit/test_pgvector_adapter.py validating initialization, correct backend instantiation, mock-upsert, mock-delete, exception fallbacks, and retriever exports.

Verification Results

All code validation checks have been successfully run and passed within WSL:

  • Ruff Quality Check: Passed (All checks passed!).
  • MyPy Type Safety: Passed (Success: no issues found in 22 source files with strict mode enabled).
  • PyTest Execution: 79/79 unit and integration tests passed successfully.

@KMohnishM
KMohnishM force-pushed the gsoc-week-5-pgvector branch 4 times, most recently from ad2c0a7 to e18e631 Compare June 23, 2026 04:03
@KMohnishM
KMohnishM force-pushed the gsoc-week-4-chatbot branch from 279505c to 1384ebd Compare June 26, 2026 13:32
@KMohnishM
KMohnishM force-pushed the gsoc-week-5-pgvector branch from e18e631 to 88a4341 Compare June 26, 2026 13:33
@KMohnishM
KMohnishM force-pushed the gsoc-week-4-chatbot branch from 1384ebd to 089627a Compare June 27, 2026 07:17
@KMohnishM
KMohnishM force-pushed the gsoc-week-5-pgvector branch from 88a4341 to 55f909e Compare June 27, 2026 07:18
@KMohnishM
KMohnishM force-pushed the gsoc-week-4-chatbot branch from 089627a to f364c36 Compare June 27, 2026 07:19
@KMohnishM
KMohnishM force-pushed the gsoc-week-5-pgvector branch from 55f909e to b1b2be7 Compare June 27, 2026 07:19

@vjuranek vjuranek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Juts one minor comment about logging, otherwise LGTM.

"""
try:
self._store.delete(ids=[doc_id])
logger.debug("PGVector delete: %s", doc_id)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO it's better do the logging first and then do the action itself - if anything goes wrong, you know from log what action triggered it (e.g. exception with full stack trace can swallowed somewhere etc)

@KMohnishM
KMohnishM force-pushed the gsoc-week-5-pgvector branch from b1b2be7 to d6894d4 Compare July 1, 2026 14:11
…ments

Signed-off-by: KMohnishM <kmohnishm@gmail.com>
@KMohnishM
KMohnishM force-pushed the gsoc-week-5-pgvector branch from d6894d4 to a9e236e Compare July 3, 2026 05:43
@jpechane

jpechane commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

@KMohnishM I am a bit confused, the PR contains Miluvs related changes I already merged in the other PR.

@KMohnishM
KMohnishM force-pushed the gsoc-week-5-pgvector branch from 7a4a81c to a9e236e Compare July 3, 2026 12:55
@KMohnishM

Copy link
Copy Markdown
Contributor Author

Hi @jpechane, apologies for the confusion! Here is what happened with the stacked branches:

  1. The Stacked Structure:

  2. The Source of the Confusion:

  3. The Resolution:

    • I have just rebased , cleaned up and force-pushed the gsoc-week-5-pgvector branch.
    • It now contains only the PGVector adapter and the core logging improvements. The Milvus commits have been completely removed from this branch.

Everything should look clean and correct now!

@KMohnishM

Copy link
Copy Markdown
Contributor Author

@jpechane One small request is to merge every PR also to main branch as the PRs are stacked there base branch is the sub sequent branch rather than main branch.

@jpechane

jpechane commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

@KMohnishM Thanks for the explanation, I completely forgot about the PR stacking

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.

3 participants