Class NullMemory

    • Constructor Detail

      • NullMemory

        public NullMemory()
    • Method Detail

      • getInstance

        public static NullMemory getInstance()
        Gets the singleton instance of NullMemory}.
        Returns:
        The singleton instance of NullMemory.
      • saveInformationAsync

        public reactor.core.publisher.Mono<String> saveInformationAsync​(@Nonnull
                                                                        String collection,
                                                                        @Nonnull
                                                                        String text,
                                                                        @Nonnull
                                                                        String externalId,
                                                                        @Nullable
                                                                        String description,
                                                                        @Nullable
                                                                        String additionalMetadata)
        Description copied from interface: SemanticTextMemory
        Save some information into the semantic memory, keeping a copy of the source information.
        Specified by:
        saveInformationAsync in interface SemanticTextMemory
        Parameters:
        collection - Collection where to save the information.
        text - Information to save.
        externalId - Unique identifier, e.g. URL or GUID to the original source.
        description - Optional description.
        additionalMetadata - Optional string for saving custom metadata.
        Returns:
        Unique identifier of the saved memory record.
      • saveReferenceAsync

        public reactor.core.publisher.Mono<String> saveReferenceAsync​(@Nonnull
                                                                      String collection,
                                                                      @Nonnull
                                                                      String text,
                                                                      @Nonnull
                                                                      String externalId,
                                                                      @Nonnull
                                                                      String externalSourceName,
                                                                      @Nullable
                                                                      String description,
                                                                      @Nullable
                                                                      String additionalMetadata)
        Description copied from interface: SemanticTextMemory
        Save some information into the semantic memory, keeping only a reference to the source information.
        Specified by:
        saveReferenceAsync in interface SemanticTextMemory
        Parameters:
        collection - Collection where to save the information.
        text - Information to save.
        externalId - Unique identifier, e.g. URL or GUID to the original source.
        externalSourceName - Name of the external service, e.g. "MSTeams", "GitHub", "WebSite", "Outlook IMAP", etc.
        description - Optional description.
        additionalMetadata - Optional string for saving custom metadata.
        Returns:
        Unique identifier of the saved memory record.
      • getAsync

        public reactor.core.publisher.Mono<MemoryQueryResult> getAsync​(String collection,
                                                                       String key,
                                                                       boolean withEmbedding)
        Description copied from interface: SemanticTextMemory
        Fetch a memory by key. For local memories the key is the "id" used when saving the record. For external reference, the key is the "URI" used when saving the record.
        Specified by:
        getAsync in interface SemanticTextMemory
        Parameters:
        collection - Collection to search.
        key - Unique memory record identifier.
        withEmbedding - Whether to return the embedding of the memory found.
        Returns:
        Memory record, or null when nothing is found
      • removeAsync

        public reactor.core.publisher.Mono<Void> removeAsync​(@Nonnull
                                                             String collection,
                                                             @Nonnull
                                                             String key)
        Description copied from interface: SemanticTextMemory
        Remove a memory by key. For local memories the key is the "id" used when saving the record. For external reference, the key is the "URI" used when saving the record.
        Specified by:
        removeAsync in interface SemanticTextMemory
        Parameters:
        collection - Collection to search.
        key - Unique memory record identifier.
        Returns:
        Mono completion.
      • searchAsync

        public reactor.core.publisher.Mono<List<MemoryQueryResult>> searchAsync​(@Nonnull
                                                                                String collection,
                                                                                @Nonnull
                                                                                String query,
                                                                                int limit,
                                                                                float minRelevanceScore,
                                                                                boolean withEmbeddings)
        Description copied from interface: SemanticTextMemory
        Find some information in memory
        Specified by:
        searchAsync in interface SemanticTextMemory
        Parameters:
        collection - Collection to search
        query - What to search for
        limit - How many results to return
        minRelevanceScore - Minimum relevance score, from 0 to 1, where 1 means exact match.
        withEmbeddings - Whether to return the embeddings of the memories found.
        Returns:
        Memories found