mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-11-22 13:29:19 +08:00
refactor(memory): make the Mem0SystemAdapter deprecation guidance accurate
DirectMem0Adapter covers local mode only and skips Mem0's LLM extraction only when facts or entities are pre-extracted. Say so, and say cloud mode has no Headroom replacement (use the mem0 client directly). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ae09314ab6
commit
dab5f5607d
@@ -4,7 +4,7 @@ This module provides backend adapters for the memory system:
|
||||
- LocalBackend: Fully local using SQLite + HNSW + InMemoryGraph (default)
|
||||
- Mem0Backend: Graph + vector memory via Mem0 (Neo4j + Qdrant)
|
||||
- Mem0SystemAdapter: Adapter to use Mem0Backend with MemorySystem tools (deprecated;
|
||||
use DirectMem0Adapter)
|
||||
use DirectMem0Adapter for local mode; cloud mode has no replacement)
|
||||
- DirectMem0Adapter: Optimized adapter that bypasses Mem0's LLM extraction
|
||||
|
||||
LocalBackend is always available. Mem0-based backends require optional
|
||||
|
||||
@@ -4,9 +4,12 @@ This adapter bridges the Mem0Backend interface to the MemoryBackend protocol
|
||||
required by MemorySystem, enabling Mem0 to be used with the memory tools system.
|
||||
|
||||
.. deprecated::
|
||||
Nothing in Headroom uses this adapter. Use ``DirectMem0Adapter``
|
||||
(``headroom.memory.backends.direct_mem0``), which also satisfies the
|
||||
MemoryBackend protocol and skips Mem0's internal LLM extraction.
|
||||
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.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -31,7 +34,8 @@ class Mem0SystemAdapter:
|
||||
"""Adapter that makes Mem0Backend conform to MemorySystem's MemoryBackend protocol.
|
||||
|
||||
.. deprecated::
|
||||
Use ``DirectMem0Adapter`` instead.
|
||||
Use ``DirectMem0Adapter`` for local mode. Cloud mode has no replacement in
|
||||
Headroom; use the ``mem0`` client directly.
|
||||
|
||||
This adapter wraps Mem0Backend and provides the interface expected by
|
||||
MemorySystem, enabling LLM-driven memory tools (memory_save, memory_search,
|
||||
@@ -64,7 +68,8 @@ class Mem0SystemAdapter:
|
||||
"""
|
||||
warnings.warn(
|
||||
"Mem0SystemAdapter is deprecated and will be removed in a future release; "
|
||||
"use DirectMem0Adapter (headroom.memory.backends.direct_mem0) instead.",
|
||||
"for local mode use DirectMem0Adapter (headroom.memory.backends.direct_mem0); "
|
||||
"cloud mode has no Headroom replacement, so use the mem0 client directly.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user