From 09ec4a7012f3519d8efdecf854da98b2d5075474 Mon Sep 17 00:00:00 2001 From: Bartok9 Date: Thu, 23 Apr 2026 14:38:57 +0700 Subject: [PATCH] docs(agent): remove stale BuiltinMemoryProvider references from memory module docstrings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The BuiltinMemoryProvider class was removed from the codebase but its name lingered in the module-level docstrings of memory_manager.py and memory_provider.py, creating false expectations: - memory_manager.py docstring showed example code doing add_provider(BuiltinMemoryProvider(...)) which ImportError at runtime - memory_provider.py docstring listed BuiltinMemoryProvider as 'always present, not removable' — misleading for new contributors The regression test (test_memory_user_id.py) already passes without any reference to BuiltinMemoryProvider; it uses RecordingProvider instances directly. The stale references were docs-only drift. Update both docstrings to reflect the actual current architecture: MemoryManager accepts external plugin providers only (one at a time). Closes #14402 --- agent/memory_manager.py | 9 +++------ agent/memory_provider.py | 17 ++++++++--------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/agent/memory_manager.py b/agent/memory_manager.py index 2435c3f248..0c73ca972c 100644 --- a/agent/memory_manager.py +++ b/agent/memory_manager.py @@ -1,17 +1,14 @@ -"""MemoryManager — orchestrates the built-in memory provider plus at most -ONE external plugin memory provider. +"""MemoryManager — orchestrates memory providers for the agent. Single integration point in run_agent.py. Replaces scattered per-backend code with one manager that delegates to registered providers. -The BuiltinMemoryProvider is always registered first and cannot be removed. -Only ONE external (non-builtin) provider is allowed at a time — attempting -to register a second external provider is rejected with a warning. This +Only ONE external plugin provider is allowed at a time — attempting to +register a second external provider is rejected with a warning. This prevents tool schema bloat and conflicting memory backends. Usage in run_agent.py: self._memory_manager = MemoryManager() - self._memory_manager.add_provider(BuiltinMemoryProvider(...)) # Only ONE of these: self._memory_manager.add_provider(plugin_provider) diff --git a/agent/memory_provider.py b/agent/memory_provider.py index 24593e3345..68c9f8e7d4 100644 --- a/agent/memory_provider.py +++ b/agent/memory_provider.py @@ -1,17 +1,16 @@ """Abstract base class for pluggable memory providers. -Memory providers give the agent persistent recall across sessions. One -external provider is active at a time alongside the always-on built-in -memory (MEMORY.md / USER.md). The MemoryManager enforces this limit. +Memory providers give the agent persistent recall across sessions. +The MemoryManager enforces a one-external-provider limit to prevent +tool schema bloat and conflicting memory backends. -Built-in memory is always active as the first provider and cannot be removed. -External providers (Honcho, Hindsight, Mem0, etc.) are additive — they never -disable the built-in store. Only one external provider runs at a time to -prevent tool schema bloat and conflicting memory backends. +External providers (Honcho, Hindsight, Mem0, etc.) are registered +and managed via MemoryManager. Only one external provider runs at a +time. Registration: - 1. Built-in: BuiltinMemoryProvider — always present, not removable. - 2. Plugins: Ship in plugins/memory//, activated by memory.provider config. + Plugins ship in plugins/memory// and are activated via + the memory.provider config key. Lifecycle (called by MemoryManager, wired in run_agent.py): initialize() — connect, create resources, warm up