Agents API#

Auto-generated API documentation for agents.

Supervisor Agent#

Supervisor agent that coordinates multiple specialized agents.

This agent uses a hierarchical approach - it delegates tasks to specialized sub-agents (Engineering, Search, etc.) rather than having all tools directly.

class src.agents.supervisor_agent.RouteDecision(*, agent, reasoning, task_instruction='', more_steps_after=False, final_response='')[source]#

Bases: BaseModel

Structured output for routing decision.

agent: Literal['engineering_agent', 'hpc_agent', 'search_agent', 'rag_agent', 'arxiv_agent', 'prusa_agent', 'excalidraw_agent', 'cli_agent', 'supervisor_response', 'FINISH']#
reasoning: str#
task_instruction: str#
more_steps_after: bool#
final_response: str#
model_config = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class src.agents.supervisor_agent.SupervisorState[source]#

Bases: TypedDict

State for the supervisor agent.

messages: Annotated[list, langgraph.graph.message.add_messages]#
next: str#
class src.agents.supervisor_agent.SupervisorAgent(model_name=None, temperature=None, seed=None, rag_read_only=False)[source]#

Bases: object

Supervisor agent that coordinates specialized agents.

Uses a hierarchical delegation model where the supervisor routes tasks to appropriate specialized agents based on the request.

__init__(model_name=None, temperature=None, seed=None, rag_read_only=False)[source]#

Initialize the supervisor agent.

Parameters:
  • model_name (str | None) – Name of the LLM model to use (defaults to config.llm_model)

  • temperature (float | None) – Model temperature (defaults to config.llm_temperature)

  • seed (int | None) – Random seed for model (defaults to config.llm_seed)

  • rag_read_only (bool) – If True, sub-agents only get read-only RAG tools (search, list).

search_agent: SearchAgent | None#
invoke(state, config)[source]#

Invoke the supervisor agent.

Parameters:
  • state – Current conversation state with messages, or None to resume from interrupt

  • config – Configuration including thread_id

Returns:

Updated state with agent responses

Base Agent#

Base agent class for LangGraph-based agents.

Provides common functionality for all agents including: - LLM initialization - Tool management - Graph building with standard structure - Common node implementations (_llm_call, _tool_node, _should_continue)

class src.agents.base_agent.BaseAgent(model_name=None, tools=None, require_confirmation=False, temperature=None, seed=None)[source]#

Bases: ABC

Abstract base class for LangGraph agents with common functionality.

__init__(model_name=None, tools=None, require_confirmation=False, temperature=None, seed=None)[source]#

Initialize the base agent.

Parameters:
  • model_name (str | None) – Name of the LLM model to use (defaults to config.llm_model)

  • tools (list | None) – List of LangChain tools for this agent

  • require_confirmation (bool) – Whether to require user confirmation before tool execution

  • temperature (float | None) – Model temperature (defaults to config.llm_temperature)

  • seed (int | None) – Random seed for model (defaults to config.llm_seed, None for non-deterministic)

invoke(state, config=None)[source]#

Invoke the agent with a given state.

Parameters:
  • state (MessagesState) – Input conversation state

  • config (dict | None) – Optional configuration (e.g., thread_id for conversation tracking)

Returns:

Updated conversation state

Return type:

MessagesState

RAG Agent#

RAG Agent for document-based question answering.

This agent handles queries about uploaded documents using the RAG system. Now powered by MMORE for advanced multimodal document processing.

class src.agents.rag_agent.RAGAgent(model_name=None, temperature=None, mmore_url=None, seed=None, rag_read_only=False)[source]#

Bases: BaseAgent

Agent for document-based question answering using MMORE RAG.

__init__(model_name=None, temperature=None, mmore_url=None, seed=None, rag_read_only=False)[source]#

Initialize the RAG agent with MMORE client.

Parameters:
  • model_name (str | None) – Name of the LLM model to use (defaults to config.llm_model)

  • temperature (float | None) – Model temperature (defaults to config.llm_temperature)

  • mmore_url (str | None) – URL of MMORE service (defaults to MMORE_RAG_URL env var)

  • seed (int | None) – Random seed for model (defaults to config.llm_seed)

  • rag_read_only (bool) – If True, only expose read-only RAG tools (search, list).

ArXiv Agent#

ArXiv Research Agent for searching and analyzing research papers.

This agent combines ArXiv search capabilities with MMORE RAG for paper analysis.

class src.agents.arxiv_agent.ArXivAgent(model_name=None, temperature=None, mmore_url=None, seed=None)[source]#

Bases: BaseAgent

Agent for ArXiv paper search and analysis with MMORE RAG integration.

__init__(model_name=None, temperature=None, mmore_url=None, seed=None)[source]#

Initialize the ArXiv agent with search and MMORE RAG capabilities.

Parameters:
  • model_name (str | None) – Name of the LLM model to use (defaults to config.llm_model)

  • temperature (float | None) – Model temperature (defaults to config.llm_temperature)

  • mmore_url (str | None) – URL of MMORE service (defaults to MMORE_RAG_URL env var)

  • seed (int | None) – Random seed for model (defaults to config.llm_seed)

HPC Agent#

HPC cluster agent for SLURM job management and training-code workflows.

In addition to the original SLURM job-management tools (submit / monitor / cancel / download / status), the agent owns the end-to-end training-code-generation workflow for benchmarks like training_code_beams2d: authoring the candidate training file, validating it locally, transferring it to the cluster, and running it through dryrun / submit / monitor / diagnose / evaluate.

The training-code tools are imported from their submodules rather than from src.tools (its package __init__ deliberately does NOT re-export them – see the note there – because they pull in the benchmark contract_validator and we don’t want unrelated agents to drag that in via the tools package init).

class src.agents.hpc_agent.HPCAgent(model_name=None, temperature=None, seed=None)[source]#

Bases: BaseAgent

Agent specialized in HPC job management and training-code workflows.

__init__(model_name=None, temperature=None, seed=None)[source]#

Initialize the HPC agent.

Parameters:
  • model_name (str | None) – Name of the LLM model to use (defaults to config.llm_model)

  • temperature (float | None) – Model temperature (defaults to config.llm_temperature)

  • seed (int | None) – Random seed for model (defaults to config.llm_seed)

Engineering Agent#

Engineering design agent with EngiBench integration.

This agent specializes in structural optimization and engineering design problems using the EngiBench library.

class src.agents.engineering_agent.EngineeringAgent(model_name=None, temperature=None, seed=None)[source]#

Bases: BaseAgent

Agent specialized in engineering design and structural optimization.

__init__(model_name=None, temperature=None, seed=None)[source]#

Initialize the engineering agent.

Parameters:
  • model_name (str | None) – Name of the LLM model to use (defaults to config.llm_model)

  • temperature (float | None) – Model temperature (defaults to config.llm_temperature)

  • seed (int | None) – Random seed for model (defaults to config.llm_seed)

Prusa Agent#

Prusa 3D Printer agent with MCP server integration.

This agent specializes in interacting with Prusa Connect to manage 3D printers, monitor print jobs, and control printer operations.

It was the one agent that reimplemented BaseAgent’s graph instead of inheriting it. That divergence cost more than it bought – every guard added to BaseAgent had to be duplicated here by hand, and the two it had accumulated by the end (empty-tools routing and hallucinated-call stripping) were line-for-line copies of the originals.

class src.agents.prusa_agent.PrusaAgent(model_name=None, skip_mcp=False, temperature=None, seed=None)[source]#

Bases: BaseAgent

Agent specialized in 3D printer management via Prusa Connect.

__init__(model_name=None, skip_mcp=False, temperature=None, seed=None)[source]#

Initialize the Prusa agent.

Parameters:
  • model_name (str | None) – Name of the LLM model to use (defaults to config.llm_model)

  • skip_mcp (bool) – Skip MCP server initialization (useful for testing). Also honoured via the SKIP_MCP environment variable.

  • temperature (float | None) – Model temperature (defaults to config.llm_temperature)

  • seed (int | None) – Random seed for model (defaults to config.llm_seed)

Excalidraw Agent#

Whiteboard agent, backed by the canvas MCP server.

Draws on the Excalidraw component the user is looking at, and reads back what is on it. The scene itself lives in the canvas MCP server (services/excalidraw_mcp_server/), keyed by conversation.

class src.agents.excalidraw_agent.ExcalidrawAgent(model_name=None, temperature=None, seed=None, skip_canvas=False)[source]#

Bases: BaseAgent

Agent specialized in drawing on the user’s whiteboard.

__init__(model_name=None, temperature=None, seed=None, skip_canvas=False)[source]#

Initialize the whiteboard agent.

Parameters:
  • model_name (str | None) – Name of the LLM model to use (defaults to config.llm_model)

  • temperature (float | None) – Model temperature (defaults to config.llm_temperature)

  • seed (int | None) – Random seed for model (defaults to config.llm_seed)

  • skip_canvas (bool) – Skip the MCP connection (useful for testing). Also honoured via SKIP_CANVAS / SKIP_MCP – see config.canvas_enabled.

Search Agent#

Search-focused agent with web search capabilities.

class src.agents.search_agent.SearchAgent(model_name=None, temperature=None, seed=None)[source]#

Bases: BaseAgent

Agent specialized in web search and information retrieval.

__init__(model_name=None, temperature=None, seed=None)[source]#

Initialize the search agent.

Parameters:
  • model_name (str | None) – Name of the LLM model to use (defaults to config.llm_model)

  • temperature (float | None) – Model temperature (defaults to config.llm_temperature)

  • seed (int | None) – Random seed for model (defaults to config.llm_seed)

CLI Agent#

CLI agent for executing local command-line tools.

This agent specializes in running command-line applications like PrusaSlicer, mesh processing tools, file converters, and other CLI utilities.

Uses LangGraph’s interrupt_before mechanism for human-in-the-loop confirmation.

class src.agents.cli_agent.CLIAgent(model_name=None, require_confirmation=False, temperature=None, seed=None)[source]#

Bases: BaseAgent

Agent specialized in executing local command-line tools.

__init__(model_name=None, require_confirmation=False, temperature=None, seed=None)[source]#

Initialize the CLI agent.

Parameters:
  • model_name (str | None) – Name of the LLM model to use (defaults to config.llm_model)

  • require_confirmation (bool) – Whether to require user confirmation before executing commands (default: False)

  • temperature (float | None) – Model temperature (defaults to config.llm_temperature)

  • seed (int | None) – Random seed for model (defaults to config.llm_seed)