Class MemoryRecordMetadata


  • public class MemoryRecordMetadata
    extends Object
    Class representing the metadata associated with a Semantic Kernel memory.
    • Constructor Detail

      • MemoryRecordMetadata

        public MemoryRecordMetadata​(boolean isReference,
                                    @Nonnull
                                    String id,
                                    @Nonnull
                                    String text,
                                    @Nonnull
                                    String description,
                                    @Nonnull
                                    String externalSourceName,
                                    @Nonnull
                                    String additionalMetadata)
        Constructor.
        Parameters:
        isReference - True if source data is local, false if source data comes from an external service.
        id - Unique string used to identify the MemoryRecord.
        text - Local source data associated with a MemoryRecord embedding.
        description - MemoryRecord description.
        externalSourceName - Name of the external source if isReference is true.
        additionalMetadata - Field for saving custom metadata with a memory.
    • Method Detail

      • isReference

        public boolean isReference()
        Whether the source data used to calculate embeddings are stored in the local storage provider or is available through and external service, such as web site, MS Graph, etc.
      • getExternalSourceName

        public String getExternalSourceName()
        A value used to understand which external service owns the data, to avoid storing the information inside the URI. E.g. this could be "MSTeams", "WebSite", "GitHub", etc.
        Returns:
        Name of the external service if isReference is true.
      • getId

        public String getId()
        Unique identifier. The format of the value is domain specific, so it can be a URL, a GUID, etc.
        Returns:
        Unique string used to identify the MemoryRecord.
      • getDescription

        public String getDescription()
        Optional title describing the content. Note: the title is not indexed.
        Returns:
        the optional title describing the content.
      • getText

        public String getText()
        Source text, available only when the memory is not an external source.
        Returns:
        Source text when the memory is not an external source.
      • getAdditionalMetadata

        public String getAdditionalMetadata()
        Custom metadata associated with a memory.
        Returns:
        Custom metadata associated with a memory.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object