From b6fb73c7e5474f7a60b5c52c69fc4040159f32df Mon Sep 17 00:00:00 2001 From: Amit Paz Date: Fri, 3 Jul 2026 14:17:40 +0300 Subject: [PATCH] feat(lore): raise memory limit to 2G for transformer NER (en_core_web_trf) Lore now defaults to the en_core_web_trf spaCy model (transformer NER), which loads torch + RoBERTa and needs ~1.5GB RAM. The old 256M limit OOM-killed the container on model load. Raise to 2G, and surface LORE_GRAPH_SPACY_MODEL as an overridable env (default en_core_web_trf) so it can be dialed down to en_core_web_sm/lg (and the limit lowered) for a smaller footprint. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01CKkfVA3iY5G3Q43Mg4Xsu2 --- docker-compose.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 92a4d85..4546569 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,6 +21,7 @@ services: - JWT_SECRET=${JWT_SECRET:?set JWT_SECRET in .env (copy from .env.example)} - AGENTGATE_URL=http://agentgate:3002 - LORE_ENABLED=true + - LORE_MODE=remote - LORE_API_URL=http://lore:8765 - LORE_API_KEY=${LORE_API_KEY:?set LORE_API_KEY in .env (copy from .env.example)} volumes: @@ -96,6 +97,10 @@ services: # stack is usable without a manual POST /v1/org/init. MUST be the same # value AgentLens uses to call Lore (shared .env var). - LORE_API_KEY=${LORE_API_KEY:?set LORE_API_KEY in .env (copy from .env.example)} + # spaCy model for graph entity extraction. Default en_core_web_trf + # (transformer NER, best quality — needs ~1.5GB RAM, see limit below). + # Dial down to en_core_web_lg or en_core_web_sm for a smaller footprint. + - LORE_GRAPH_SPACY_MODEL=${LORE_GRAPH_SPACY_MODEL:-en_core_web_trf} volumes: - lore-data:/app/data networks: @@ -113,7 +118,9 @@ services: deploy: resources: limits: - memory: 256M + # transformer NER (en_core_web_trf) loads torch + RoBERTa (~1.5GB). + # Lower to 512M if LORE_GRAPH_SPACY_MODEL is set to en_core_web_sm/lg. + memory: 2G lore-db: image: pgvector/pgvector:pg16