API Reference mnemosyne v#0.1.5

Copy Markdown View Source

Modules

Agentic memory library that models memory as a knowledge graph using reinforcement-learning primitives (episodes, trajectories, rewards, value functions).

Embedding adapter backed by Bumblebee's Nx.Serving.

Embedding adapter backed by Sycophant.

LLM adapter backed by Sycophant.

Unified configuration for Mnemosyne LLM and embedding settings.

Behaviour for text embedding generation.

Struct returned by embedding generation calls.

Top-level Splode error aggregator for Mnemosyne.

Error class for internal framework-level errors.

Raised when an LLM or embedding adapter encounters an error.

Raised when a referenced resource cannot be found.

Raised when a pipeline operation fails during extraction or reasoning.

Raised when a repository lifecycle operation fails.

Raised when a session operation is invalid for the current state.

Raised when a storage backend operation fails.

Error class for validation and invalid-input errors.

Raised when Mnemosyne configuration is missing or invalid.

Raised when an episode operation violates preconditions.

Raised when an LLM prompt response cannot be parsed into the expected format.

Error class for unknown or unrecognized errors.

Fallback concrete error used when an error cannot be mapped to a known Splode error type.

Domain-specific extraction profiles that customize how knowledge is extracted, scored, and prioritized from episodes.

Core knowledge graph data structure.

Batched mutations for the knowledge graph.

Defines the typed edge categories used in the knowledge graph.

Protocol for polymorphic graph node operations.

Episodic memory node capturing an observation-action-reward tuple within a trajectory.

Utility functions for working with node links across edge types.

Intent node representing a high-level goal that links to procedural prescription nodes for hierarchical retrieval.

Procedural memory node encoding an instruction with its triggering condition and expected outcome.

Semantic memory node representing a proposition with a confidence score.

Source node linking back to a specific step within an episode.

Subgoal node representing a decomposed objective, optionally linked to a parent goal.

Tag node used to label and categorize other nodes in the graph.

Cosine similarity computations using Scholar and Nx.

Behaviour for unified graph persistence and querying backends.

In-memory graph backend wrapping Mnemosyne.Graph.

DETS-backed persistence for the InMemory graph backend.

Behaviour for LLM chat completions.

Struct returned by LLM chat completions.

GenServer owning the graph backend state.

Metadata tracked per node for value function scoring.

Behaviour for pluggable event notification.

No-op notifier that discards all events.

Trace struct capturing episode pipeline execution details.

Trace struct capturing recall pipeline execution details.

Trace struct capturing structuring pipeline execution details.

Maintenance module that prunes low-utility nodes from the knowledge graph.

Functional core for managing in-progress episodes.

Maintenance module that validates episodic grounding of abstract nodes.

One-shot maintenance op that scrubs dangling link references from the graph and deletes orphaned tags/intents.

Per-hop query refinement for the retrieval pipeline.

Tracks refinement state across hops during retrieval.

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

Prompt for classifying a query into a memory retrieval mode: :episodic, :semantic, :procedural, or :mixed.

Prompt for generating retrieval tags from a query and its classified mode. Produces a list of search tags used to query the knowledge graph.

Prompt for extracting prescriptive knowledge (instructions for future) from a trajectory segment.

Prompt for refining retrieval tags during multi-hop retrieval. Generates bridge-concept search tags targeting information not yet reached.

Prompt for scoring each prescription (procedural instruction) individually against its specific intent and the trajectory evidence.

Prompt for evaluating how well a step serves the current sub-goal. Returns a reward score between 0.0 and 1.0.

Prompt for extracting propositional knowledge (facts learned) from a trajectory segment, along with associated concept terms that serve as semantic routing indices.

Prompt for deriving progressive environment state from a single step.

Prompt for inferring what sub-goal the agent is pursuing given the current state, observation, action, and overall goal.

Prompt for merging two similar intent descriptions into a single unified intent that captures the essence of both.

Prompt for synthesizing retrieved episodic memory nodes into a coherent narrative summary relevant to the query.

Prompt for synthesizing retrieved procedural memory nodes into actionable instructions relevant to the query.

Prompt for synthesizing retrieved semantic memory nodes into a factual summary relevant to the query.

Parallel reasoning module that synthesizes retrieved memory candidates into typed summaries.

Result of reasoning over retrieved memory candidates. Each field is nil when no candidates of that type were found.

Result of a recall operation containing reasoned summaries, touched nodes, and execution trace.

Multi-hop graph retrieval pipeline.

Result of a retrieval operation containing the classified mode, generated tags, and scored candidate nodes partitioned by type.

Internal struct representing a scored candidate with its origin phase. Replaces raw {node, score} tuples in the retrieval pipeline.

Caller-facing projection of a retrieved candidate node.

Discovers near-duplicate semantic nodes via embedding similarity and merges the lower-scored one into the higher-scored survivor.

Orchestrates knowledge extraction from a closed episode.

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

Behaviour for building LLM prompts and parsing responses.

GenStateMachine managing the lifecycle of a memory session.

Top-level supervisor for the Mnemosyne runtime.

Telemetry event catalog and instrumentation helpers for Mnemosyne.

Optional telemetry handler that logs Mnemosyne events via Logger.

Behaviour for scoring memory nodes during retrieval.

Default value function combining relevance with recency, frequency, and reward signals from node metadata.