mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-11-22 13:29:19 +08:00
refactor(memory): name the exact arguments that skip Mem0 extraction
DirectMem0Adapter.save_memory skips Mem0's LLM extraction only for facts, extracted_entities or extracted_relationships; content with entities/relationships alone still runs it. Say that in the docstring and the deprecation warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
dab5f5607d
commit
2aff9be239
@@ -6,10 +6,12 @@ required by MemorySystem, enabling Mem0 to be used with the memory tools system.
|
||||
.. deprecated::
|
||||
Nothing in Headroom uses this adapter. For local mode (Qdrant + Neo4j), use
|
||||
``DirectMem0Adapter`` (``headroom.memory.backends.direct_mem0``), which also
|
||||
satisfies the MemoryBackend protocol. It skips Mem0's LLM extraction only when
|
||||
the caller passes pre-extracted ``facts``/entities/relationships; otherwise it
|
||||
still calls Mem0's extraction. Cloud mode (``Mem0Config(mode="cloud")``) has no
|
||||
replacement in Headroom; use the ``mem0`` client directly.
|
||||
satisfies the MemoryBackend protocol. ``save_memory`` skips Mem0's LLM
|
||||
extraction only when the caller passes pre-extracted ``facts``,
|
||||
``extracted_entities`` or ``extracted_relationships``. Passing only ``content``
|
||||
with ``entities``/``relationships`` still runs Mem0's extraction. Cloud mode
|
||||
(``Mem0Config(mode="cloud")``) has no replacement in Headroom; use the ``mem0``
|
||||
client directly.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -68,7 +70,9 @@ class Mem0SystemAdapter:
|
||||
"""
|
||||
warnings.warn(
|
||||
"Mem0SystemAdapter is deprecated and will be removed in a future release; "
|
||||
"for local mode use DirectMem0Adapter (headroom.memory.backends.direct_mem0); "
|
||||
"for local mode use DirectMem0Adapter (headroom.memory.backends.direct_mem0), "
|
||||
"which skips Mem0's LLM extraction only when given pre-extracted facts, "
|
||||
"extracted_entities or extracted_relationships; "
|
||||
"cloud mode has no Headroom replacement, so use the mem0 client directly.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
|
||||
Reference in New Issue
Block a user