Guava.RAG.VectorStore behaviour (Guava v0.34.0)

Copy Markdown View Source

Behaviour for a vector store backing local-mode Guava.DocumentQA.

Implementations handle embedding internally: callers pass plain text and get plain text back. The store is any term (typically a struct) passed as the first argument to each callback.

Summary

Callbacks

add_texts(store, texts)

@callback add_texts(store :: term(), texts :: [String.t()]) :: [String.t()]

clear(store)

@callback clear(store :: term()) :: :ok

count(store)

@callback count(store :: term()) :: non_neg_integer()

delete(store, ids)

@callback delete(store :: term(), ids :: [String.t()]) :: :ok

search(store, query, k)

@callback search(store :: term(), query :: String.t(), k :: pos_integer()) :: [String.t()]

upsert_texts(store, ids, texts)

@callback upsert_texts(store :: term(), ids :: [String.t()], texts :: [String.t()]) :: :ok