- fetchPypi: sdists are published underscore-named, so the hyphenated pname 404'd. - sitePackages is relative; prefix the env path so the unit's -d check and the symlink point at the store. - hermes_memory_provider ships in mnemosyne-memory, not mnemosyne-hermes; move the import check accordingly. - Drop the unused /opt/data/mnemosyne-env mount, the orphaned requirements.txt, and trim comments. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
57 lines
1.5 KiB
Nix
57 lines
1.5 KiB
Nix
# Mnemosyne memory provider for Hermes. Built here rather than pip-installed:
|
|
# the image's Python has no pip and is PEP 668 managed.
|
|
#
|
|
# Core deps only: the embeddings extra (fastembed/onnxruntime) is optional at
|
|
# runtime, and recall falls back to FTS5.
|
|
{
|
|
python3,
|
|
fetchPypi,
|
|
}:
|
|
|
|
let
|
|
mnemosyneMemory = python3.pkgs.buildPythonPackage rec {
|
|
pname = "mnemosyne-memory";
|
|
version = "3.15.1";
|
|
pyproject = true;
|
|
|
|
src = fetchPypi {
|
|
pname = "mnemosyne_memory";
|
|
inherit version;
|
|
hash = "sha256-lspUMxc0pUSkhSUrNdiiO5OJ1NMC/S853EYSanXtXKM=";
|
|
};
|
|
|
|
build-system = with python3.pkgs; [ setuptools ];
|
|
dependencies = with python3.pkgs; [ pyyaml ];
|
|
|
|
doCheck = false; # tests want a live Hermes + LLM key
|
|
# Ships the Hermes plugin package too, not just the core.
|
|
pythonImportsCheck = [
|
|
"mnemosyne"
|
|
"hermes_memory_provider"
|
|
];
|
|
};
|
|
|
|
mnemosyneHermes = python3.pkgs.buildPythonPackage rec {
|
|
pname = "mnemosyne-hermes";
|
|
version = "0.5.0";
|
|
pyproject = true;
|
|
|
|
src = fetchPypi {
|
|
pname = "mnemosyne_hermes";
|
|
inherit version;
|
|
hash = "sha256-CzEvnUw5oPFtT5bHQQ/GBdy2C/E7qShQn32irIRYKqw=";
|
|
};
|
|
|
|
build-system = with python3.pkgs; [ setuptools ];
|
|
# Upstream asks for mnemosyne-memory[embeddings]; see the header.
|
|
dependencies = [ mnemosyneMemory ] ++ (with python3.pkgs; [ pyyaml ]);
|
|
|
|
doCheck = false;
|
|
pythonImportsCheck = [ "mnemosyne_hermes" ];
|
|
};
|
|
in
|
|
python3.withPackages (_: [
|
|
mnemosyneMemory
|
|
mnemosyneHermes
|
|
])
|