Search.Commits (fnord v0.9.24)

View Source

Semantic search over indexed git commits.

Given a natural-language query, we embed it and compare against precomputed commit embeddings using cosine similarity. Results include the commit SHA, similarity score, and selected metadata.

Summary

Functions

Returns {:ok, results} where results is a list of {sha, score, metadata} tuples, ordered by highest similarity and truncated to the provided limit.

Types

t()

@type t() :: %Search.Commits{limit: pos_integer(), query: String.t()}

Functions

get_results(search)

@spec get_results(t()) :: {:ok, [{String.t(), number(), map()}]} | {:error, any()}

Returns {:ok, results} where results is a list of {sha, score, metadata} tuples, ordered by highest similarity and truncated to the provided limit.

new(opts)

@spec new(Keyword.t() | map()) :: t()