Using Agents#
EngiAI provides several specialized agents for different tasks. All agents are LangGraph state machines that are invoked through the Supervisor Agent, which automatically routes requests to the appropriate agent.
How Agents Work#
Each agent is a LangGraph graph with an LLM and a set of tools. You interact with agents through the Streamlit UI or by invoking the Supervisor Agent programmatically:
from langchain_core.messages import HumanMessage
from src.agents.supervisor_agent import SupervisorAgent
supervisor = SupervisorAgent()
state = {
"messages": [HumanMessage(content="Optimize a beam with 30% material")],
"next": "",
}
result = supervisor.invoke(state, config={"configurable": {"thread_id": "demo"}})
# The response is in result["messages"]
for msg in result["messages"]:
print(msg.content)
The supervisor analyzes the user’s message and routes it to the appropriate specialized agent.
Available Agents#
Engineering Agent#
Handles structural design and topology optimization using EngiBench problems (beams2d, photonics2d).
Tools available:
create_problem— Initialize a problem instanceoptimize_design— Run topology optimizationsimulate_design— Evaluate a designrender_design— Visualize the designconvert_design_to_stl— Export to STL for 3D printingget_problem_details/get_dataset_info— Problem metadatadownload_wandb_model/load_wandb_model/sample_designs_from_model— Generative model tools
Example queries:
"Create a 2D beam design with 35% volume fraction"
"Optimize and export to STL with 10mm extrusion height"
ArXiv Agent#
Searches, downloads, and analyzes research papers from arXiv.
Tools available:
search_arxiv— Search for papers by queryget_arxiv_paper— Get paper details by arXiv IDdownload_and_analyze_paper— Download PDF and index in MMOREask_about_papers— Query indexed papers via RAGlist_analyzed_papers— List all indexed papers
Example queries:
"Find recent papers on generative design"
"Download and analyze paper 2301.12345"
RAG Agent#
Queries the knowledge base using Retrieval-Augmented Generation via the MMORE service.
Tools available:
search_documents— Query MMORE for relevant documentsadd_document— Upload a PDF to the knowledge baseadd_url_to_knowledge_base— Crawl and index a web pagelist_documents/delete_document— Manage indexed documents
Example queries:
"What papers discuss topology optimization?"
"What does the EngiBench paper say about volume fraction?"
HPC Agent#
Manages high-performance computing workflows on SLURM clusters.
Tools available:
test_hpc_connection— Verify SSH connectivitysubmit_slurm_job— Submit a SLURM job scriptget_slurm_job_status— Check job statusmonitor_job_until_complete— Wait for job completioncancel_slurm_job— Cancel a running jobdownload_job_outputs— Retrieve resultswrite_training_script/validate_training_script/generate_training_slurm/validate_slurm_script/dryrun_training_script/diagnose_job_failure/evaluate_model— training-code generation and evaluation pipelinecheck_job_status_change— detect a change in a job’s cached stateget_active_jobs_summary— summarize all tracked jobs
(generate_training_command, for built-in engiopt algorithms, lives on the Engineering Agent.)
Example queries:
"Submit training job to Euler cluster"
"Check status of my running jobs"
See the HPC Integration Guide for setup details.
Search Agent#
Performs web searches for technical information using keyless DuckDuckGo by default. Tavily can be selected explicitly for deployments that provide a key.
Example queries:
"Find the latest research on additive manufacturing"
"What are the best practices for topology optimization?"
Prusa Agent#
Controls 3D printers via Prusa Connect through an MCP server.
Tools: Dynamically loaded from the Prusa MCP server (printer listing, file upload, print job management, status monitoring).
See the Prusa Integration Guide for setup and usage.
Excalidraw Agent#
Draws on the whiteboard shown next to the chat, and reads back what is on it.
Tools: Dynamically loaded from the canvas MCP server — read_me,
draw_elements, get_canvas, delete_elements, clear_canvas.
The scene is stored per conversation. canvas_id and source are injected by
the agent rather than chosen by the model, so it cannot draw into another
conversation’s whiteboard or claim the user synced a drawing they did not.
Disabled with SKIP_CANVAS=true, or SKIP_MCP=true as a master switch. When
disabled the agent’s capability block is removed from the routing prompt
entirely, so the supervisor never considers it. See
services/excalidraw_mcp_server/README.md.
CLI Agent#
Executes command-line tools on the local system. Supports human-in-the-loop confirmation for safety.
Tools available:
execute_cli_command— Run shell commandsopen_gui_application— Launch GUI apps (PrusaSlicer, VS Code, etc.)
Example queries:
"List files in the outputs directory"
"Open PrusaSlicer with the latest design"
Note: In Docker, GUI apps are opened on the host machine via the host service (services/host_service.py).
Supervisor Agent#
The Supervisor Agent is the entry point that routes requests to specialized agents. It:
Analyzes the user’s message intent
Routes to the appropriate agent with scoped instructions
Collects the agent’s response
Decides whether to route to another agent or return to the user
The supervisor also handles:
Human-in-the-loop: Interrupts before CLI agent execution for user confirmation
Loop detection: Prevents the same agent from being called repeatedly without progress