From 66a8294a957986f3ea8bf7b4fc5fdbea417b72fc Mon Sep 17 00:00:00 2001 From: Armand Date: Wed, 24 Jun 2026 04:43:06 -0500 Subject: [PATCH 1/3] fix(rlm): point install guidance at official rlm package, not aragora[rlm] extra The user-facing log/error messages in aragora/rlm/factory.py and related RLM modules instructed `pip install aragora[rlm]`, but rlm is not a pyproject [project.optional-dependencies] extra; the real package is the official rlm PyPI distribution (the base install ships only the compression fallback gated by HAS_OFFICIAL_RLM). Update all install-guidance strings to `pip install rlm` and correct the RLM install prose in docs/status/STATUS.md (was `pip install aragora`). String-only; no factory logic or control-flow change. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- aragora/debate/cognitive_limiter_rlm.py | 6 +++--- aragora/knowledge/mound/api/rlm.py | 13 +++++-------- aragora/memory/cross_debate_rlm.py | 2 +- aragora/rlm/__init__.py | 5 +---- aragora/rlm/adapter.py | 2 +- aragora/rlm/factory.py | 8 ++++---- docs/status/STATUS.md | 2 +- tests/debate/test_cognitive_limiter_rlm.py | 2 +- tests/rlm/test_cognitive_limiter_rlm.py | 2 +- 9 files changed, 18 insertions(+), 24 deletions(-) diff --git a/aragora/debate/cognitive_limiter_rlm.py b/aragora/debate/cognitive_limiter_rlm.py index 5b5a5fbd64..f36feb1a54 100644 --- a/aragora/debate/cognitive_limiter_rlm.py +++ b/aragora/debate/cognitive_limiter_rlm.py @@ -13,12 +13,12 @@ 3. The LLM can recursively call itself on context subsets 4. The LLM dynamically decides decomposition strategy (grep, map-reduce, peek, etc.) -When the official RLM library is installed (`pip install aragora[rlm]`), this module +When the official RLM library is installed (`pip install rlm`), this module uses the real REPL-based approach. Otherwise, it falls back to hierarchical summarization which preserves semantics but isn't true RLM. Install RLM support: - pip install aragora[rlm] + pip install rlm """ from __future__ import annotations @@ -206,7 +206,7 @@ def __init__( else: logger.info( "RLM factory not available. Using hierarchical summarization fallback. " - "Install with: pip install aragora[rlm]" + "Install with: pip install rlm" ) # Widen stats type to support mixed int/float/dict values from RLM extension diff --git a/aragora/knowledge/mound/api/rlm.py b/aragora/knowledge/mound/api/rlm.py index 994308130d..080eaadafc 100644 --- a/aragora/knowledge/mound/api/rlm.py +++ b/aragora/knowledge/mound/api/rlm.py @@ -11,7 +11,7 @@ approach where the model writes code to examine context. This is preferred over compression-based methods. -Install TRUE RLM: pip install aragora[rlm] +Install TRUE RLM: pip install rlm NOTE: This is a mixin class designed to be composed with KnowledgeMound. Attribute accesses like self._ensure_initialized, self.workspace_id, self.query_semantic, etc. @@ -212,7 +212,7 @@ async def query_with_true_rlm( - Model writes code like: `facts = get_facts(km, "topic", min_confidence=0.8)` - No information loss from truncation or compression - This is the PREFERRED method when `pip install aragora[rlm]` is installed. + This is the PREFERRED method when `pip install rlm` is installed. Falls back to compression-based query if TRUE RLM not available. @@ -227,8 +227,7 @@ async def query_with_true_rlm( """ if not HAS_RLM: logger.warning( - "[rlm] RLM not available for knowledge query. " - "Install with: pip install aragora[rlm]" + "[rlm] RLM not available for knowledge query. Install with: pip install rlm" ) return None @@ -242,7 +241,7 @@ async def query_with_true_rlm( logger.warning( "[rlm] TRUE RLM preferred but not available. " "Will use compression fallback. " - "Install with: pip install aragora[rlm] for better results." + "Install with: pip install rlm for better results." ) # Fetch relevant knowledge items via QueryOperationsMixin @@ -368,9 +367,7 @@ async def create_knowledge_repl( REPL environment, or None if TRUE RLM not available """ if not HAS_RLM or not HAS_OFFICIAL_RLM: - logger.warning( - "[rlm] TRUE RLM REPL not available. Install with: pip install aragora[rlm]" - ) + logger.warning("[rlm] TRUE RLM REPL not available. Install with: pip install rlm") return None # Cast self to Protocol to access methods provided by composed KnowledgeMound class diff --git a/aragora/memory/cross_debate_rlm.py b/aragora/memory/cross_debate_rlm.py index 5aa19de581..ee126579c7 100644 --- a/aragora/memory/cross_debate_rlm.py +++ b/aragora/memory/cross_debate_rlm.py @@ -23,7 +23,7 @@ context = await memory.get_relevant_context(task="Design a new API") Install official RLM support: - pip install aragora[rlm] + pip install rlm """ from __future__ import annotations diff --git a/aragora/rlm/__init__.py b/aragora/rlm/__init__.py index 602e37cfdc..67fa6f38d8 100644 --- a/aragora/rlm/__init__.py +++ b/aragora/rlm/__init__.py @@ -17,10 +17,7 @@ can symbolically interact with." Installation: - # Install with real RLM support - pip install aragora[rlm] - - # Or install the official library directly + # Install the official RLM library for real RLM support pip install rlm Usage with Real RLM: diff --git a/aragora/rlm/adapter.py b/aragora/rlm/adapter.py index 9d67a07589..7e349fa60e 100644 --- a/aragora/rlm/adapter.py +++ b/aragora/rlm/adapter.py @@ -849,7 +849,7 @@ class REPLContextAdapter(RLMContextAdapter): # >>> disagreements = search_debate(debate, r"disagree|however") # >>> FINAL(f"Key disagreements: {summarize(disagreements)}") - Requires: pip install aragora[rlm] for TRUE RLM functionality + Requires: pip install rlm for TRUE RLM functionality """ def __init__( diff --git a/aragora/rlm/factory.py b/aragora/rlm/factory.py index 167ddf786c..d60b7492e1 100644 --- a/aragora/rlm/factory.py +++ b/aragora/rlm/factory.py @@ -228,7 +228,7 @@ def _apply_env_overrides(rlm_config: RLMConfig) -> RLMConfig: if not HAS_OFFICIAL_RLM: error_msg = ( "TRUE RLM required but official RLM library not installed. " - "Install with: pip install aragora[rlm] or pip install rlm" + "Install with: pip install rlm" ) logger.error("[RLM Factory] %s", error_msg) raise RuntimeError(error_msg) @@ -264,12 +264,12 @@ def _apply_env_overrides(rlm_config: RLMConfig) -> RLMConfig: if warn_on_fallback and effective_mode in (RLMMode.AUTO, RLMMode.TRUE_RLM): logger.warning( "[RLM Factory] TRUE RLM not available, using compression fallback. " - "For better performance, install: pip install aragora[rlm]" + "For better performance, install: pip install rlm" ) else: logger.info( "[RLM Factory] Created AragoraRLM with compression fallback " - "(official RLM not installed - pip install aragora[rlm] for TRUE RLM)" + "(official RLM not installed - pip install rlm for TRUE RLM)" ) # Cache if using default config and no specific mode @@ -468,7 +468,7 @@ async def wrapper(*args, **kwargs): if not HAS_OFFICIAL_RLM: raise RuntimeError( f"Function {func.__name__} requires TRUE RLM but official library " - "is not installed. Install with: pip install aragora[rlm]" + "is not installed. Install with: pip install rlm" ) return await func(*args, **kwargs) diff --git a/docs/status/STATUS.md b/docs/status/STATUS.md index 75184ea193..61b8c3745c 100644 --- a/docs/status/STATUS.md +++ b/docs/status/STATUS.md @@ -1965,7 +1965,7 @@ Based on [arXiv:2512.24601](https://arxiv.org/abs/2512.24601) - "Recursive Langu **Installation:** ```bash # Install with real RLM support -pip install aragora +pip install rlm ``` **Usage:** diff --git a/tests/debate/test_cognitive_limiter_rlm.py b/tests/debate/test_cognitive_limiter_rlm.py index 8d0901da23..c125a722b9 100644 --- a/tests/debate/test_cognitive_limiter_rlm.py +++ b/tests/debate/test_cognitive_limiter_rlm.py @@ -15,7 +15,7 @@ - Real RLM integration (arXiv:2512.24601) - REPL-based approach - Fallback hierarchical summarization when RLM library not installed -Install real RLM: pip install aragora[rlm] +Install real RLM: pip install rlm """ from __future__ import annotations diff --git a/tests/rlm/test_cognitive_limiter_rlm.py b/tests/rlm/test_cognitive_limiter_rlm.py index 51018e902e..ae3083228d 100644 --- a/tests/rlm/test_cognitive_limiter_rlm.py +++ b/tests/rlm/test_cognitive_limiter_rlm.py @@ -5,7 +5,7 @@ is stored as a Python variable and LLM writes code to query it 2. Fallback hierarchical summarization when RLM library not installed -Install real RLM: pip install aragora[rlm] +Install real RLM: pip install rlm """ import asyncio From c0deee9c1cb1088ebbec49bec7fde4ed2842e6ba Mon Sep 17 00:00:00 2001 From: Armand Date: Wed, 24 Jun 2026 05:13:23 -0500 Subject: [PATCH 2/3] fix(rlm): silence pre-existing mypy errors in touched RLM files The required CI changed-file typecheck gate (mypy --follow-imports=skip, no baseline) surfaces 5 pre-existing union-attr/no-redef errors in cognitive_limiter_rlm.py and knowledge/mound/api/rlm.py once those files are touched by the install-guidance fix. Resolve them behavior-preservingly: collapse the redundant `Any | None` annotation on _aragora_rlm to `Any`, annotate the `source` locals as `Any`, and mark the conditional bridge import `# type: ignore[no-redef]` (matching this file's existing conditional-import convention). Annotations/comments only; no runtime change. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- aragora/debate/cognitive_limiter_rlm.py | 4 ++-- aragora/knowledge/mound/api/rlm.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aragora/debate/cognitive_limiter_rlm.py b/aragora/debate/cognitive_limiter_rlm.py index f36feb1a54..03b02e0f69 100644 --- a/aragora/debate/cognitive_limiter_rlm.py +++ b/aragora/debate/cognitive_limiter_rlm.py @@ -44,7 +44,7 @@ try: from aragora.rlm import get_rlm, get_compressor, HAS_OFFICIAL_RLM - from aragora.rlm.bridge import DebateContextAdapter, RLMBackendConfig + from aragora.rlm.bridge import DebateContextAdapter, RLMBackendConfig # type: ignore[no-redef] HAS_RLM_FACTORY = True except ImportError: @@ -181,7 +181,7 @@ def __init__( # Real RLM integration - use factory for consistent initialization self._rlm_model = rlm_model - self._aragora_rlm: Any | None = None + self._aragora_rlm: Any = None self._debate_adapter: Any | None = None if HAS_RLM_FACTORY and get_rlm is not None: diff --git a/aragora/knowledge/mound/api/rlm.py b/aragora/knowledge/mound/api/rlm.py index 080eaadafc..2e2821910e 100644 --- a/aragora/knowledge/mound/api/rlm.py +++ b/aragora/knowledge/mound/api/rlm.py @@ -127,7 +127,7 @@ async def query_with_rlm( # Build text content from knowledge items content_parts = [] for item in items: - source = getattr(item, "source", None) or getattr(item, "source_type", None) + source: Any = getattr(item, "source", None) or getattr(item, "source_type", None) source_str = ( source.value if hasattr(source, "value") else str(source) if source else "unknown" ) @@ -258,7 +258,7 @@ async def query_with_true_rlm( # Build text content from knowledge items content_parts = [] for item in items: - source = getattr(item, "source", None) or getattr(item, "source_type", None) + source: Any = getattr(item, "source", None) or getattr(item, "source_type", None) source_str = ( source.value if hasattr(source, "value") else str(source) if source else "unknown" ) From 54e38a271fc87ae537d6abe76a9e669790c909c3 Mon Sep 17 00:00:00 2001 From: Armand Date: Wed, 24 Jun 2026 05:38:00 -0500 Subject: [PATCH 3/3] refactor(rlm): align cognitive_limiter_rlm type handling with codebase convention Refine the changed-file typecheck-gate fixes per model review feedback: keep `_aragora_rlm` annotated `Any | None` (no widening, consistent with the sibling `_debate_adapter`), narrow it for the `.compress_and_query` call via a local bind after the None guard (behavior-identical to the prior `has_real_rlm` check, since that property is exactly `_aragora_rlm is not None`), and move the conditional-import `# type: ignore[no-redef]` onto the except-branch fallback assignments to match the existing knowledge/mound/api/rlm.py pattern. No runtime change. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- aragora/debate/cognitive_limiter_rlm.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/aragora/debate/cognitive_limiter_rlm.py b/aragora/debate/cognitive_limiter_rlm.py index 03b02e0f69..b64ebfec2b 100644 --- a/aragora/debate/cognitive_limiter_rlm.py +++ b/aragora/debate/cognitive_limiter_rlm.py @@ -37,23 +37,18 @@ ) # Check for official RLM library (use factory for consistent initialization) -get_rlm: Any -get_compressor: Any -DebateContextAdapter: Any -RLMBackendConfig: Any - try: from aragora.rlm import get_rlm, get_compressor, HAS_OFFICIAL_RLM - from aragora.rlm.bridge import DebateContextAdapter, RLMBackendConfig # type: ignore[no-redef] + from aragora.rlm.bridge import DebateContextAdapter, RLMBackendConfig HAS_RLM_FACTORY = True except ImportError: HAS_OFFICIAL_RLM = False HAS_RLM_FACTORY = False - get_rlm = None - get_compressor = None - DebateContextAdapter = None - RLMBackendConfig = None + get_rlm: Any = None # type: ignore[no-redef] + get_compressor: Any = None # type: ignore[no-redef] + DebateContextAdapter: Any = None # type: ignore[no-redef] + RLMBackendConfig: Any = None # type: ignore[no-redef] if TYPE_CHECKING: from aragora.rlm.compressor import HierarchicalCompressor @@ -181,7 +176,7 @@ def __init__( # Real RLM integration - use factory for consistent initialization self._rlm_model = rlm_model - self._aragora_rlm: Any = None + self._aragora_rlm: Any | None = None self._debate_adapter: Any | None = None if HAS_RLM_FACTORY and get_rlm is not None: @@ -251,7 +246,8 @@ async def query_with_rlm( ... strategy="grep" ... ) """ - if not self.has_real_rlm: + rlm = self._aragora_rlm + if rlm is None: logger.warning("Real RLM not available, using fallback search") return self._fallback_search(query, messages) @@ -263,7 +259,7 @@ async def query_with_rlm( formatted_context = self._format_messages_for_rlm(messages) # Use AragoraRLM for query - result = await self._aragora_rlm.compress_and_query( + result = await rlm.compress_and_query( query=query, content=formatted_context, source_type="debate",