agentscope-ai/agentscope · error · RuntimeError

ReMe {name!r} failed: {getattr(response, 'answer', '')}

Error message

ReMe {name!r} failed: {getattr(response, 'answer', '')}

What it means

Every ReMe operation (reindex, search, write-back) goes through _run_job, which checks the response's success flag; success=False raises RuntimeError embedding the job name and ReMe's answer text as the diagnostic.

Source

Thrown at src/agentscope/middleware/_longterm_memory/_reme/_middleware.py:470

        if self._parameters.mode == "static_control":
            return []
        return _build_memory_tools(self)

    # ==================================================================
    # ReMe job helpers (shared by hooks and tools)
    # ==================================================================
    async def _run_job(self, name: str, **kwargs: Any) -> Any:
        """Start the embedded app (if needed) and run a ReMe job.

        Raises:
            RuntimeError:
                If ReMe reports ``success=False``.
        """
        await self._ensure_started()
        assert self._app is not None
        response = await self._app.run_job(name, **kwargs)
        if getattr(response, "success", True) is False:
            raise RuntimeError(
                f"ReMe {name!r} failed: {getattr(response, 'answer', '')}",
            )
        return response

    async def _search(
        self,
        query: str,
        *,
        limit: int | None = None,
    ) -> list[str]:
        """Search ReMe and return the retrieved memory texts."""
        response = await self._run_job(
            _SEARCH_JOB,
            query=query,
            limit=self._parameters.top_k if limit is None else limit,
        )
        return _extract_memory_texts(getattr(response, "metadata", {}))

View on GitHub (pinned to e90f1c7592)

Solutions

  1. Read the answer text in the message — it carries ReMe's own error detail
  2. Verify ReMe app config (graph store URI, embedding keys) and connectivity
  3. Run a reindex job before search if the memory graph is empty/uninitialized
  4. Wrap calls in try/except RuntimeError to surface and log job failures
Defensive patterns

Strategy: try-catch

Try / catch

try:
    resp = await middleware.search(query)
except RuntimeError as e:
    logger.error('ReMe job failed: %s', e)
    return []  # degrade gracefully without memory

Prevention

When it happens

Trigger: self._app.run_job('search', ...) returning success=False — bad ReMe config, missing graph store, embedding failure, or invalid query/job arguments.

Common situations: ReMe backend (graph DB / vector store) misconfigured or unreachable; API-key issues; schema not initialized before search.

Related errors


AI-assisted analysis of agentscope-ai/agentscope@e90f1c7592 (2026-08-28). Data as JSON: /api/errors/13dfdae2e5f0e6d2. Report an issue: GitHub.