diff --git a/__init__.py b/__init__.py index 3834bba..21e582a 100644 --- a/__init__.py +++ b/__init__.py @@ -3,9 +3,11 @@ Self-hosted Mem0 server with semantic search and automatic fact extraction. Config via environment variables: - MEM0_BASE_URL — Local Mem0 server URL (required, e.g., http://localhost:8000) - MEM0_USER_ID — User identifier for memory scoping (default: hermes-user) - MEM0_AGENT_ID — Agent identifier (default: hermes) + MEM0_BASE_URL — Local Mem0 server URL (required, e.g., http://localhost:8000) + MEM0_USER_ID — User identifier for memory scoping (default: hermes-user) + MEM0_AGENT_ID — Agent identifier (default: hermes) + MEM0_PREFETCH_LIMIT — Max memories to prefetch (default: 3) + MEM0_PREFETCH_SCORE_THRESHOLD — Min similarity score % to include memory (default: 60) Or via $HERMES_HOME/mem0-local.json. """ @@ -46,8 +48,10 @@ def _load_config() -> dict: "agent_id": os.environ.get("MEM0_AGENT_ID", "hermes"), "rerank": True, "timeout": 10.0, - "prefetch_limit": 3, - "prefetch_score_threshold": 60, + "prefetch_limit": int(os.environ.get("MEM0_PREFETCH_LIMIT", "3")), + "prefetch_score_threshold": int( + os.environ.get("MEM0_PREFETCH_SCORE_THRESHOLD", "60") + ), } config_path = get_hermes_home() / "mem0-local.json" diff --git a/plugin.yaml b/plugin.yaml index c8ab4db..d6baafa 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -10,6 +10,10 @@ requires_env: url: "https://github.com/mem0ai/mem0" - name: MEM0_USER_ID description: "User identifier for memory scoping (default: hermes-user)" + - name: MEM0_PREFETCH_LIMIT + description: "Max memories to prefetch before LLM call (default: 3)" + - name: MEM0_PREFETCH_SCORE_THRESHOLD + description: "Min similarity score % to include memory 0-100 (default: 60)" provides_tools: - mem0_profile