Skip to content

feat(vector-search): enable Firestore vector search across sync and async models#1

Open
cto-new[bot] wants to merge 3 commits into
mainfrom
feat-firestore-vector-search-firedantic
Open

feat(vector-search): enable Firestore vector search across sync and async models#1
cto-new[bot] wants to merge 3 commits into
mainfrom
feat-firestore-vector-search-firedantic

Conversation

@cto-new

@cto-new cto-new Bot commented Jan 20, 2026

Copy link
Copy Markdown

Summary: Introduce vector search capabilities to Firedantic, enabling nearest-neighbor queries against Firestore vector fields while preserving the library’s pydantic-centric design.

Details:

  • Expose DistanceMeasure and Vector types in package exports for consumer model definitions.
  • Extend VectorConfig and FiredanticVector to annotate model fields as vector fields.
  • Implement vector_search on both AsyncBareModel and BareModel to return model instances by proximity.
  • Discover vector fields automatically via _get_vector_fields and expose an Enum of field names (VectorFields).
  • Support automatic resolution of the vector field when exactly one vector field exists; allow explicit field selection via a Union[str, Enum]; raise VectorFieldNotDefined or VectorFieldAmbiguous when appropriate.
  • Use Firestore find_nearest with distance_measure and the vector field; support optional distance_result_field and transaction.
  • Maintain backward-compatible API: new features are opt-in and do not modify existing methods.

cto-new Bot added 3 commits January 20, 2026 00:43
… async models

Adds vector search capability for Firestore while preserving Firedantic/Pydantic semantics.

- Introduces Vector and DistanceMeasure support and a VectorConfig type
- Extends model vector_search API for async and sync variants
- Enables vector fields to be used in composite indexes via vector_config
- Exposes vector types in the top-level exports for convenient usage

Impact:
- Adds a new vector_search workflow using Firestore's nearest neighbor queries
- No breaking changes; usage is optional via new API
- Introduce Firestore vector search integration within Firedantic's vector ecosystem.
- Extend configuration to support vector fields and vector-based queries while preserving backward compatibility.
- Implement vector_search in both async and sync model bases to enable nearest-neighbor lookups.
- Expose vector types for consumer usage to simplify adoption and integration.
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.

0 participants