Skip to navigation

Simulations Resource

Simulations

Simulations allow you to interact with a Mind.

Run a Simulation

Send a scenario to a mind and receive a response.

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

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

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

Get Simulation Details

Retrieve the full transcript and metadata of a past simulation.

const 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.

{
"simulation": {
"id": "123e4567...",
"title": "Simulation with Sarah",
"createdAt": "2023-11-16T10:00:00Z"
},
"messages": [
{
"id": "msg-1",
"role": "user",
"content": { "text": "What is the plan?" },
"createdAt": "2023-11-16T10:00:01Z"
},
{
"id": "msg-2",
"role": "assistant",
"content": { "text": "We stay hidden." },
"createdAt": "2023-11-16T10:00:05Z"
}
]
}

List Simulations

Retrieve a paginated list of past simulations.

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

Parameters

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

Response

{
"count": 50,
"simulations": [
{
"id": "123e4567...",
"title": "Strategy Meeting",
"userId": "961b1800..."
}
]
}

Delete Simulation

Remove a simulation from history.

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

Parameters

ParameterTypeRequiredDescription
simulationIdstringYesThe UUID of the simulation to delete.

Response

{
"message": "Simulation deleted successfully",
"simulationId": "123e4567..."
}