Mnemosyne.Pipeline.Retrieval (mnemosyne v0.2.0)

Copy Markdown View Source

Multi-hop graph retrieval pipeline.

Classifies a query by memory mode, generates retrieval tags, embeds them, scores candidate nodes via value functions, and performs LLM-controlled multi-hop traversal to expand and re-rank results. At each hop a controller decides whether the accumulated candidates are sufficient to stop early, and selects focus candidates that drive the next-hop query. Episodic queries retrieve over the semantic graph and map results back to their provenance-linked episodic nodes.

Summary

Functions

Retrieves relevant memory nodes from the graph for the given query.

Functions

retrieve(query, opts)

Retrieves relevant memory nodes from the graph for the given query.

Options:

  • :llm (required) - LLM module implementing the LLM behaviour
  • :embedding (required) - Embedding module implementing the Embedding behaviour
  • :backend (required) - Tuple of {module, state} implementing GraphBackend
  • :value_function (required) - Map with :module (ValueFunction impl) and :params (per-type params)
  • :llm_opts - Additional LLM options (default: [])
  • :config - Config struct for per-step model overrides
  • :max_hops - Maximum traversal hops (default: 2)