Interface EmbeddingStore

All Known Implementing Classes:
InMemoryEmbeddingStore

public interface EmbeddingStore
Interface for storing and querying vector embeddings. Essential for Retrieval-Augmented Generation (RAG) and Semantic Search.
Since:
2.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Represents a search result from the embedding store.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(String id, float[] embedding, Map<String,Object> metadata)
    Adds an embedding to the store.
    findNearest(float[] query, int maxResults)
    Finds the nearest neighbors to the query vector based on similarity.
  • Method Details

    • add

      void add(String id, float[] embedding, Map<String,Object> metadata)
      Adds an embedding to the store.
      Parameters:
      id - unique identifier for the content.
      embedding - the vector representation.
      metadata - associated metadata.
    • findNearest

      List<EmbeddingStore.SearchResult> findNearest(float[] query, int maxResults)
      Finds the nearest neighbors to the query vector based on similarity.
      Parameters:
      query - the search vector.
      maxResults - maximum number of results to return.
      Returns:
      a list of search results.