Simulations Resource

Simulations

Simulations allow you to interact with a Mind.

Run a Simulation

Send a scenario to a mind and receive a response.

1const result = await mindsim.simulations.run({
2 mindId: "mind-id-uuid",
3 scenario: {
4 message: "A client is asking for a refund outside of the policy window. How do you respond?"
5 },
6 runInBackground: false
7});

Parameters

ParameterTypeRequiredDescription
mindIdstringYesThe ID of the mind to simulate.
scenario.messagestringYesThe prompt, question, or context for the simulation.
runInBackgroundbooleanNoIf true, returns immediately with a queued status. Defaults to false.

Response

1{
2 "message": "I would empathize with the client but firmly explain the policy..."
3}

Get Simulation Details

Retrieve the full transcript and metadata of a past simulation.

1const details = await mindsim.simulations.get("simulation-id-uuid");

Parameters

ParameterTypeRequiredDescription
simulationIdstringYesThe UUID of the simulation.

Response

Returns a GetSimulationResponse object containing the simulation metadata and the message history.

1{
2 "simulation": {
3 "id": "123e4567...",
4 "title": "Simulation with Sarah",
5 "createdAt": "2023-11-16T10:00:00Z"
6 },
7 "messages": [
8 {
9 "id": "msg-1",
10 "role": "user",
11 "content": { "text": "What is the plan?" },
12 "createdAt": "2023-11-16T10:00:01Z"
13 },
14 {
15 "id": "msg-2",
16 "role": "assistant",
17 "content": { "text": "We stay hidden." },
18 "createdAt": "2023-11-16T10:00:05Z"
19 }
20 ]
21}

List Simulations

Retrieve a paginated list of past simulations.

1const history = await mindsim.simulations.list({
2 limit: 20,
3 offset: 0
4});

Parameters

ParameterTypeRequiredDescription
limitnumberNoMax number of records to return.
offsetnumberNoNumber of records to skip.

Response

1{
2 "count": 50,
3 "simulations": [
4 {
5 "id": "123e4567...",
6 "title": "Strategy Meeting",
7 "userId": "961b1800..."
8 }
9 ]
10}

Delete Simulation

Remove a simulation from history.

1await mindsim.simulations.delete("simulation-id-uuid");

Parameters

ParameterTypeRequiredDescription
simulationIdstringYesThe UUID of the simulation to delete.

Response

1{
2 "message": "Simulation deleted successfully",
3 "simulationId": "123e4567..."
4}