- Nix 82.4%
- Shell 17.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Build and Push Attic Cache / build (push) Successful in 4s
|
||
| .forgejo/workflows | ||
| packages | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
| update.sh | ||
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=truewrites that produce no storable memories into a clear API failure instead of a silent200with empty results
Upstream structure
mem0/— core Python library (built asmem0aivia hatchling)server/— FastAPI server with Alembic migrations, auth, MCP routersserver/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.