> For the complete documentation index, see [llms.txt](https://docs.algenta.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.algenta.ai/concepts/engine.md).

# How the engine works

How Algenta integrates deterministic compiled compute, validates every request, and fails closed without exposing runtime lifecycle to users.

Algenta combines a Python and TypeScript control plane with a compiled Mojo compute runtime. The control plane owns validation, authorization, persistence, and orchestration. The compiled runtime owns deterministic numerical kernels. They ship and operate as one product boundary.

## Integrated compiled compute

The runtime is included in the Algenta deployment and supervised with the API. Hosted users, SDK users, and self-hosted operators do not install or start a separate compute service. A request crosses a typed internal interface, executes in the bundled runtime, and returns a schema-validated result.

This boundary keeps business logic out of Mojo while preserving low-latency numerical execution:

1. The API parses and validates the external request.
2. Authorization and governance checks run before compute.
3. Algenta dispatches the typed payload to the bundled compiled runtime.
4. The runtime returns deterministic output for the same input and seed.
5. The API validates, records, and returns the public response.

## Warm execution

Algenta keeps licensed compute workers warm inside the deployment so repeated calls avoid process-creation overhead. Worker lifecycle, integrity verification, and replacement are implementation responsibilities of Algenta, not user setup steps. Edition limits determine worker concurrency per device.

## Fail-closed behavior

Production execution does not silently switch to an interpreted Python implementation when compiled compute is unavailable. A missing or unhealthy runtime surfaces as an explicit deployment or compute error. This makes a latency regression visible instead of masking it behind a slower implementation.

`GET /v1/infrastructure` reports `engine_mode: "binary"` when the compiled runtime artifact exists and a primary node `status: "live"` when the compute probe succeeds. Treat `missing` or `error` as deployment failures.

## Why this matters

* **Determinism** — identical validated inputs and seed produce identical compute outputs.
* **Performance** — warm compiled workers serve the numerical hot path.
* **Security** — external inputs are validated by the control plane before they reach compute.
* **Operability** — one deployment owns startup, health, and recovery.
* **Auditability** — the API records the request and result contract around each execution.

## Related

{% content-ref url="/pages/yhNYrVe9zjfJTh9Jj7Pl" %}
[Verify the bundled engine](/engine-runtime/bundled-runtime.md)
{% endcontent-ref %}

{% content-ref url="/pages/l0L6fUVZOMtx6UivtoX2" %}
[Engine health & verification](/engine-runtime/health.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.algenta.ai/concepts/engine.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
