MnemosynePostgres.Queries.NodeQueries (mnemosyne_postgres v0.1.1)

Copy Markdown View Source

Ecto query builders for the nodes table.

Summary

Functions

Base query scoped to the current tenant.

Filters the query to only include nodes with the given IDs.

Filters the query to only include nodes of the given types.

Base query scoped to the current tenant and repo.

Returns the {table_name, schema} source tuple for the nodes table.

Returns nodes ordered by cosine distance to the query embedding.

Functions

base(state)

@spec base(map()) :: Ecto.Query.t()

Base query scoped to the current tenant.

by_ids(query, ids)

@spec by_ids(Ecto.Query.t(), [String.t()]) :: Ecto.Query.t()

Filters the query to only include nodes with the given IDs.

by_types(query, types)

@spec by_types(Ecto.Query.t(), [atom()]) :: Ecto.Query.t()

Filters the query to only include nodes of the given types.

scoped(state)

@spec scoped(map()) :: Ecto.Query.t()

Base query scoped to the current tenant and repo.

source(map)

@spec source(map()) :: {String.t(), module()}

Returns the {table_name, schema} source tuple for the nodes table.

vector_search(state, type, query_embedding, limit)

@spec vector_search(map(), atom(), pgvector(), non_neg_integer()) :: Ecto.Query.t()

Returns nodes ordered by cosine distance to the query embedding.