LangEx.Store.ETS (LangEx v0.11.3)

Copy Markdown View Source

In-memory LangEx.Store backend.

Values live in a public ETS table owned by the application — fast and dependency-free, but per-VM and lost on restart. Use for development, tests, and ephemeral memory.

Configure an embedder to enable similarity search:

Graph.compile(builder,
  store: {LangEx.Store.ETS, index: [embed: &MyApp.embed/1]}
)

The :embed function maps a string to a numeric vector ([number()]). put/4 embeds each value's text; search/3 with a :query embeds the query and returns entries ranked by cosine similarity (highest first). Without an embedder, search/3 falls back to prefix ordering.

Summary

Functions

Removes every entry (test helper).

Functions

clear()

@spec clear() :: :ok

Removes every entry (test helper).