diff --git a/aragora/debate/cognitive_limiter_rlm.py b/aragora/debate/cognitive_limiter_rlm.py index 5b5a5fbd64..b64ebfec2b 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 @@ -37,11 +37,6 @@ ) # 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 @@ -50,10 +45,10 @@ 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 @@ -206,7 +201,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 @@ -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", diff --git a/aragora/knowledge/mound/api/rlm.py b/aragora/knowledge/mound/api/rlm.py index 994308130d..2e2821910e 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. @@ -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" ) @@ -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 @@ -259,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" ) @@ -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