Esacode

Docs / Tutorials

Tutorial: build a study with an AI assistant

From a question to an answer in one conversation: connect an assistant, let it build and run a drone landing study on your worker, read the results and improve the study.

In this tutorial you ask a question (will the drone land on a moving pad in gusty wind, and where does it start to fail?) and an AI assistant builds the simulation that answers it, runs it on your worker and reads the results with you. It takes about twenty minutes. Everything the assistant makes is an ordinary project and blueprint: you can open, change and run them yourself at any point.

Prefer to write it yourself? Tutorial: a project in code builds a similar study by hand: the block in Python, the blueprint in JSON, in your own editor and git.

Before you start

  • An EsaSim account with GitHub linked (Profile > GitHub): the project is saved to a repository of yours.
  • One worker paired, with Run code from projects turned on. Any computer works for this study; no GPU is needed. See Set up a worker.
  • An assistant that speaks MCP: Claude, ChatGPT (in Developer mode), Cursor or Claude Code.

1. Connect the assistant

  1. Open Account > AI assistants and copy the server address.
  2. In the assistant, add it as a custom connector (in Claude: Settings > Connectors > Add custom connector). For Cursor and Claude Code, make a token on the same page instead.
  3. The app opens EsaSim. Choose your workspace and the access Build and run, then Allow.

Check it with: "List my EsaSim projects and workers." The assistant should name your workspace's projects and the worker you paired. AI assistants (MCP) has the details for each app.

2. Ask the question

Say what you want to learn, not which blocks to use:

In EsaSim, make a project "Pad landing study" and build a study that answers:
will our drone land on a moving pad in gusty wind, and at what wind speed
does it start to fail? Use the blocks that exist. Show me the plan before
you run anything.

The assistant reads the guide EsaSim gives it, looks at the blocks of your workspace and proposes a flow. Expect something like: a Landing sweep (the simulation), Telemetry, a Chart of success rate by wind, Metrics, a 3D view and a Table. It creates the project (from the Drone landing study template, or from an empty one) and tells you its address.

Open the project's Blueprint tab while it works: the blocks appear on the grid as the assistant places them.

3. Run it

Looks good. Run it on my machine and tell me when it is done.

The assistant checks that a worker fits, starts the run and follows it. Switch to the View page: the chart fills in by wind speed while the tasks report, and the 3D view flies one landing live. With the default settings (400 scenarios, 50 noise trials each) that is 20,000 simulated landings.

4. Read the results together

Where does it start to fail, and why? Look at the results table,
not just the summary.

The assistant opens the files the run made (the results table, the summary and the report) and answers from them: the overall success rate, the wind speed where it drops, and which scenarios failed. Ask it to show its numbers; they are the same ones on the View page.

5. Improve the study

A first run rarely asks the right question exactly. Change it in words:

Most failures are above 9 m/s. Narrow the sweep to 6 to 12 m/s with
800 scenarios so we see that range in detail, and run it again.
Then compare with the first run.

The assistant changes the settings of the Landing sweep, which makes a new numbered version of the flow, and runs it. Both runs stay in Runs, each with the version that made it, so the comparison is between two things on record.

Other things to ask for:

  • "Write a block that adds a crosswind gust model and wire it in." It writes a block in Python, checks it and adds it to the flow; you can read its code in the editor.
  • "Why did task 3 fail?" It reads the log and the error of that block.
  • "Render a video of the worst landing." It adds a Render block and runs it on your worker.

6. Keep it, share it, ship it

  • It is already saved. The project is a repository in your GitHub, and every change the assistant made is a commit: see the project's History tab.
  • Work on it with colleagues. Invite them in Team; each can start a branch and open a pull request. See Working together on GitHub.
  • Call it from your own code. Publish the flow as an endpoint and your CI can run the sweep on every change. See From a blueprint to your app.

What the assistant may and may not do

It works as you, within your role, with the access you chose (Read, Build, or Build and run). It cannot set or read API keys and other secrets, runs use only your workers, and every change and run it makes is in the audit log under the app's name. Remove its access at any time under Account > AI assistants.