Std.Ai.Memory.Pg
Types
type alias Entry
type alias Hit
Values
forget : Db -> String -> String -> Task Error ()
Remove a passage by key.
hybridSearch : Db -> String -> List Float -> String -> Float -> Int -> Task Error (List Hit)
Blend vector distance with a keyword score. A row scores by
remember : Db -> String -> Entry -> Task Error ()
Store (or overwrite) a passage by key. The embedding is written as a pgvector
search : Db -> String -> List Float -> Int -> Task Error (List Hit)
The `limit` passages closest to `query` by cosine distance, nearest first.
setup : Db -> String -> Int -> Task Error ()
Create the memory table and the pgvector extension if absent. `table` is the
vectorLiteral : List Float -> String
Serialise an embedding to a pgvector text literal, e.g. `[0.1,-0.2,0.3]`.