Skip to content

feat(vectordb): Add database-agnostic vector search abstraction#27

Merged
Shinu95J merged 4 commits intomainfrom
chore/fix_qdrant_search
Dec 22, 2025
Merged

feat(vectordb): Add database-agnostic vector search abstraction#27
Shinu95J merged 4 commits intomainfrom
chore/fix_qdrant_search

Conversation

@Shinu95J
Copy link
Copy Markdown
Contributor

@Shinu95J Shinu95J commented Dec 11, 2025

Add new vectordb package with Service interface for database-agnostic vector similarity search. This enables pharia- holmes to switch between vector databases (Qdrant, Weaviate, Pinecone) without code changes.

Changes:

  • Add vectordb.Service interface with Search, Insert, Delete, and
    collection management methods
  • Define DB-agnostic filter types: FilterSet, MatchCondition,
    MatchAnyCondition, NumericRangeCondition, TimeRangeCondition, etc.
  • Add convenience constructors (NewMatch, NewFilterSet, Must/Should/MustNot)
  • Implement custom JSON marshal/unmarshal for filter conditions
  • Add type validation to prevent mixed types in MatchAny/MatchExcept

Qdrant adapter:

  • Add qdrant.Adapter implementing vectordb.Service
  • Add converter.go for vectordb → qdrant type conversion
  • Expose Client() method on QdrantClient for adapter creation
  • Remove duplicate types from qdrant/utils.go (now in vectordb)

Error handling:

  • Changed Search() signature to return partial results: ([][]SearchResult, []error, error)
  • results[i] contains results for request i (empty slice on failure)
  • errs[i] contains per-request error (nil on success)
  • Final error is for systemic failures (context cancelled, etc.)
  • Uses sync.WaitGroup instead of errgroup to allow partial success
  • Semaphore limits concurrent searches to 10

Package layout:

  • vectordb/ - DB-agnostic interface and types
  • qdrant/ - Qdrant adapter (implements vectordb.Service)

@Shinu95J Shinu95J marked this pull request as draft December 11, 2025 13:50
@Shinu95J Shinu95J changed the title feat(vectordb): Add database-agnostic filter abstraction layer feat(vectordb): Add database-agnostic vector search abstraction Dec 15, 2025
@Shinu95J Shinu95J marked this pull request as ready for review December 15, 2025 15:07
Comment thread v1/vectordb/interface.go Outdated
Comment thread v1/vectordb/doc.go Outdated
Comment thread v1/qdrant/converter.go
Comment thread v1/vectordb/filters.go Outdated
@Shinu95J Shinu95J force-pushed the chore/fix_qdrant_search branch from 545349c to 840ca0f Compare December 22, 2025 10:30
@alphamt alphamt enabled auto-merge (squash) December 22, 2025 10:55
@Shinu95J Shinu95J disabled auto-merge December 22, 2025 11:10
@Shinu95J Shinu95J merged commit 94bca33 into main Dec 22, 2025
3 checks passed
@Shinu95J Shinu95J deleted the chore/fix_qdrant_search branch December 22, 2025 11:11
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