No description
This repository has been archived on 2026-07-12. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Nix 82.4%
  • Shell 17.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nimmo 70c5dd276b
All checks were successful
Build and Push Attic Cache / build (push) Successful in 4s
Support configurable mem0 embedding dimensions
2026-07-02 19:30:20 +01:00
.forgejo/workflows fix: complete native mem0 package builds 2026-07-02 11:05:10 +01:00
packages Support configurable mem0 embedding dimensions 2026-07-02 19:30:20 +01:00
flake.lock fix: complete native mem0 package builds 2026-07-02 11:05:10 +01:00
flake.nix fix: complete native mem0 package builds 2026-07-02 11:05:10 +01:00
README.md Handle empty inferred mem0 results explicitly 2026-07-02 19:07:51 +01:00
update.sh feat: initial mem0-nix wrapper scaffolding 2026-07-02 09:36:28 +01:00

mem0-nix

Nix packaging wrapper for upstream mem0ai/mem0 — the self-hosted memory layer for AI agents.

This repo tracks upstream mem0 HEAD and exposes two Nix packages consumed by the nixos-config flake:

Package What it builds
mem0-server Python app (FastAPI + uvicorn) from server/ — REST API + MCP endpoint
mem0-dashboard Next.js standalone server from server/dashboard/ — proxied by nginx in the NixOS module

Usage

As a flake input (in nixos-config)

inputs.mem0-nix.url = "git+ssh://git@git.nimmog.uk:2222/nimmo/mem0-nix.git";
inputs.mem0-nix.inputs.nixpkgs.follows = "nixpkgs";
mem0-server = inputs.mem0-nix.packages.${system}.mem0-server;
mem0-dashboard = inputs.mem0-nix.packages.${system}.mem0-dashboard;

Build locally

nix build .#mem0-server
nix build .#mem0-dashboard

Update upstream pin

./update.sh

This bumps the pinned commit in flake.nix and attempts a fetch to discover the correct SHA. After the first build, replace fakeSha256 / fakeHash with the computed values.

Architecture

The wrapper mirrors the librarry-nix pattern: this repo only packages the upstream source. The NixOS module (modules/services/mem0.nix in nixos-config) handles service wiring — Postgres/pgvector, systemd, nginx, SOPS secrets.

Current packaging patches in packages/mem0-server-env-config.patch do two things:

  • allow selecting Ollama-backed LLM/embedder providers via environment variables, matching the NixOS service module wiring
  • turn infer=true writes that produce no storable memories into a clear API failure instead of a silent 200 with empty results

Upstream structure

  • mem0/ — core Python library (built as mem0ai via hatchling)
  • server/ — FastAPI server with Alembic migrations, auth, MCP routers
  • server/dashboard/ — Next.js dashboard UI

No Docker

The entire stack runs as native NixOS services. Postgres + pgvector are provided by services.postgresql in the NixOS module, not a container.