RemyxCodeExecutor
autogen.coding.RemyxCodeExecutor #
RemyxCodeExecutor(arxiv_id=None, image=None, api_key=None, timeout=300, work_dir=None, auto_remove=True, stop_container=True, **kwargs)
Bases: DockerCommandLineCodeExecutor
A code executor that runs research paper code in local Docker containers.
This executor extends DockerCommandLineCodeExecutor to: 1. Search and fetch paper metadata from Remyx API (via remyxai package) 2. Pull paper-specific Docker images 3. Execute code in pre-configured research environments 4. Enable interactive exploration with AI agents
All execution happens locally on the user's machine. The Remyx API (accessed via remyxai package) is only used for metadata discovery - no code is sent to remote servers.
The executor supports research papers from the Remyx catalog that have Docker images with pre-installed dependencies and code.
| PARAMETER | DESCRIPTION |
|---|---|
arxiv_id | arXiv ID to search and execute (e.g., "2010.11929v2"). If provided, will fetch paper metadata and Docker image from Remyx API. TYPE: |
image | Docker image to use (overrides arxiv_id lookup). TYPE: |
api_key | Remyx API key. If None, will try REMYXAI_API_KEY env var. TYPE: |
timeout | Code execution timeout in seconds. Default is 300. TYPE: |
work_dir | Working directory for code execution. TYPE: |
auto_remove | Remove container after execution. Default is True. TYPE: |
stop_container | Stop container after execution. Default is True. TYPE: |
**kwargs | Additional arguments passed to DockerCommandLineCodeExecutor. TYPE: |
| RAISES | DESCRIPTION |
|---|---|
ImportError | If remyxai package is not installed. |
ValueError | If arxiv_id not found or doesn't have Docker image. |
RuntimeError | If Docker is not available. |
Example
Basic execution:
from autogen import ConversableAgent from autogen.coding import RemyxCodeExecutor
Create executor for a paper#
executor = RemyxCodeExecutor(arxiv_id="2010.11929v2")
Create agent with executor#
agent = ConversableAgent("executor", llm_config=False, code_execution_config={"executor": executor})
Interactive exploration (recommended):
executor = RemyxCodeExecutor(arxiv_id="2010.11929v2") result = executor.explore(goal="Help me understand the main innovation from this paper", interactive=True)
Initialize Remyx Code Executor.
Source code in autogen/coding/remyx_code_executor.py
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
DEFAULT_EXECUTION_POLICY class-attribute #
DEFAULT_EXECUTION_POLICY = {'bash': True, 'shell': True, 'sh': True, 'pwsh': True, 'powershell': True, 'ps1': True, 'python': True, 'javascript': False, 'html': False, 'css': False}
restart #
(Experimental) Restart the code executor.
Source code in autogen/coding/docker_commandline_code_executor.py
stop #
execute_code_blocks #
Execute code blocks with correct file extensions.
Overrides parent to fix file extension issue where 'python' becomes '.python' instead of '.py'.
Source code in autogen/coding/remyx_code_executor.py
get_paper_context #
Get formatted context about the paper for agent prompts.
This is useful for creating system messages for exploration agents.
Source code in autogen/coding/remyx_code_executor.py
explore #
explore(goal=DEFAULT_EXPLORATION_GOAL, interactive=True, llm_model='gpt-4o', llm_config=None, max_turns=None, verbose=True, system_message=None)
Explore this research paper interactively with AI agents. This is the recommended way to understand and experiment with research code. Creates a 2-agent system where one agent proposes experiments and another executes them in the paper's Docker environment.
| PARAMETER | DESCRIPTION |
|---|---|
goal | Exploration goal/mission. Defaults to a comprehensive multi-phase exploration plan. TYPE: |
interactive | If True, pauses for human guidance at each step. If False, runs automatically. TYPE: |
llm_model | The LLM model to use for the exploring agent. Default is "gpt-4o". Ignored if llm_config provided. TYPE: |
llm_config | Full LLM config dict. If None, creates default OpenAI config with llm_model. |
max_turns | Maximum number of conversation turns. If None, continues until termination. TYPE: |
verbose | If True, logs session header and summary. If False, runs quietly. TYPE: |
system_message | Optional additional system message content to append. Useful for domain-specific guidance, prompt grounding, output format examples, or accommodating smaller models (e.g., with Ollama). TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
Any | The chat result from the exploration session. |
Example
Interactive exploration (recommended for learning)#
executor = RemyxCodeExecutor(arxiv_id="2508.06434v1") result = executor.explore( ... goal="Help me understand the main innovation from this paper", interactive=True ... )
Automated exploration (good for batch experiments)#
result = executor.explore( ... goal="Run all examples and benchmarks", ... interactive=False, ... verbose=False, # Quiet mode ... )
Use different LLM provider#
result = executor.explore( ... llm_config={ ... "model": "gemini-2.0-flash-exp", ... "api_key": os.getenv("GOOGLE_API_KEY"), ... "api_type": "google", ... } ... )
Custom system message for smaller models or domain-specific needs#
result = executor.explore( ... system_message="Keep responses concise. Focus only on the main training loop.", ... llm_config={"model": "llama3.2", "api_base": "http://localhost:11434/v1"}, ... )
Source code in autogen/coding/remyx_code_executor.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 | |
create_agents #
create_agents(goal=DEFAULT_EXPLORATION_GOAL, llm_model='gpt-4o-mini', llm_config=None, human_input_mode='ALWAYS', system_message=None)
Create the 2-agent system without starting exploration. Use this if you want more control over the exploration process. Most users should use the simpler explore() method instead.
| PARAMETER | DESCRIPTION |
|---|---|
goal | Exploration goal/mission. Defaults to a comprehensive multi-phase exploration plan. TYPE: |
llm_model | The LLM model to use. Ignored if llm_config provided. TYPE: |
llm_config | Full LLM config dict. If None, creates default OpenAI config with llm_model. |
human_input_mode | "ALWAYS" for interactive, "NEVER" for automated. TYPE: |
system_message | Optional additional system message content to append. Useful for domain-specific guidance, prompt grounding, output format examples, or accommodating smaller models (e.g., with Ollama). TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
tuple[Any, Any] | Tuple of (executor_agent, writer_agent) |
Example
executor = RemyxCodeExecutor(arxiv_id="2010.11929v2") executor_agent, writer_agent = executor.create_agents()
Customize the chat further#
result = executor_agent.initiate_chat(writer_agent, message="Custom starting message", max_turns=10)
With custom system message for domain-specific needs#
executor_agent, writer_agent = executor.create_agents( ... system_message="Focus on the data preprocessing pipeline. Output results as JSON.", ... llm_config={"model": "llama3.2", "api_base": "http://localhost:11434/v1"}, ... )
Source code in autogen/coding/remyx_code_executor.py
format_chat_result staticmethod #
Format a ChatResult object into a readable summary.
.. deprecated:: Use from autogen.coding.utils import format_chat_result instead.
| PARAMETER | DESCRIPTION |
|---|---|
result | The ChatResult object from explore() or initiate_chat() TYPE: |
| RETURNS | DESCRIPTION |
|---|---|
str | Formatted string summary |
Example
result = executor.explore(verbose=False) print(RemyxCodeExecutor.format_chat_result(result))