Repository navigation
Description
In #10492, we're adding the ability to map arbitrary properties to a data store vector property, via an IEmbeddingGenerator:
[VectorStoreRecordVector(Dimensions: 3)]
public string Description { get; set; }The slight issue here is that currently maps Description only to a vector property; we believe there are non-contrived scenarios out there where users want to fetch back the description (as a string) when searching/getting records. We also believe some users would reasonably expect the above to just roundtrip, and would be a bit surprised when it doesn't.
Option 1 (Current): two .NET properties, one pointing to the other
The current way for users to do this is to have two properties as follows:
[VectorStoreRecordData]
public string Description { get; set; }
[VectorStoreRecordVector(Dimensions: 3)]
public string DescriptionEmbedding => Description;Note that this also allows easily e.g. concatenating multiple string properties together for embedding generation, or any arbitrary transformation.
Option 2: single .NET property, implicitly mapped to both vector and data
One possible design would be to implicitly map the above single .NET property to two database properties for the user. That is, the single Description .NET property would be mapped to a Description data property, and also to e.g. a Description_Embedding property (via some arbitrary naming convention). We don't like this design because:
- There's an excess of "magic" (e.g. the naming convention)
- The data property can't be configured (to e.g. be indexed)
- Generally because the two-property mapping is non-obvious.
If we did want to do this, we'd need to do it now, since doing it later would be a breaking change.
Option 3: single .NET property, multiple attributes
An alternative would be for the user to simply annotated the same .NET property with two attributes:
[VectorStoreRecordVector(Dimensions: 3, StorageName = "Description_Embedding")]
[VectorStoreRecordData]
public string Description { get; set; }- This makes it much more explicit that the same .NET property is mapped to two database properties.
- It allows configuring each one separately, via the separate attribute (or record definition)
- This only works in the case where a single string property that's already mapped to a single data property in the databae needs to be embedding-generated. Other scenarios, e.g. concatenating multiple properties still need to be addressed via option 1 above.
Importantly, this is something that we should be able to implement later without any breaking changes. We currently throw in model validation when the same .NET property has more than one attribute - we'd just relax that.
/cc Adam Sitnik (@adamsitnik) Eduard van Valkenburg (@eavanvalkenburg) hopefully this captures our conversation!
/cc westey (@westey-m) Dmytro Struk (@dmytrostruk)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBacklog
Activity
[-][MEVD] Allow mapping the same .NET property to both data and vector properties in the database[/-][+].Net: [MEVD] Allow mapping the same .NET property to both data and vector properties in the database[/+]github-actions commentedon Jul 25, 2025
This issue is stale because it has been open for 90 days with no activity.
github-actions commentedon May 20, 2026
This issue was closed because it has been inactive for 14 days since being marked as stale.