Mnemosyne.Pipeline.IntentMerger (mnemosyne v0.1.6)

Copy Markdown View Source

Deduplicates intent nodes in a changeset against both the existing graph and other intents within the same batch.

Applies three strategies based on cosine similarity thresholds:

  • Below merge threshold: keep the new intent as-is
  • Between merge and identity thresholds: LLM-merge descriptions, re-embed
  • Above identity threshold: drop duplicate, rewrite links to existing intent

Summary

Functions

Merges intent nodes in the changeset, deduplicating against graph and batch.

Functions

merge(changeset, opts)

@spec merge(
  Mnemosyne.Graph.Changeset.t(),
  keyword()
) :: {:ok, Mnemosyne.Graph.Changeset.t()} | {:error, term()}

Merges intent nodes in the changeset, deduplicating against graph and batch.

Options

  • :backend - {module, state} tuple for the graph backend
  • :llm - LLM adapter module
  • :embedding - embedding adapter module
  • :config - %Config{} with threshold settings
  • :value_function - value function config map (:module + :params) for candidate scoring