Jido.AI.Retrieval.Store (Jido AI v2.2.0)

Copy Markdown View Source

In-process retrieval memory store backed by ETS.

Summary

Functions

Clears all memories from a namespace and returns the number removed.

Ensures the ETS table exists.

Returns all memory entries in a namespace.

Recalls top-k memories for a query using simple token-overlap scoring.

Inserts or updates a memory entry in the given namespace.

Types

memory()

@type memory() :: %{
  :id => String.t(),
  :text => String.t(),
  optional(:metadata) => map(),
  optional(:inserted_at_ms) => non_neg_integer(),
  optional(:updated_at_ms) => non_neg_integer()
}

Functions

clear(namespace)

@spec clear(String.t()) :: non_neg_integer()

Clears all memories from a namespace and returns the number removed.

ensure_table!()

@spec ensure_table!() :: :ok

Ensures the ETS table exists.

namespace_entries(namespace)

@spec namespace_entries(String.t()) :: [memory()]

Returns all memory entries in a namespace.

recall(namespace, query, opts \\ [])

@spec recall(String.t(), String.t(), keyword()) :: [map()]

Recalls top-k memories for a query using simple token-overlap scoring.

upsert(namespace, memory)

@spec upsert(String.t(), memory()) :: memory()

Inserts or updates a memory entry in the given namespace.