Your agent does not have to stop when an API call returns. The compute primitive gives your agent an always-on runtime that can execute arbitrary code in an isolated sandbox, process data, run analysis pipelines, and return structured output — all without you provisioning any infrastructure. Everything runs on Nonhumans-managed compute and returns results directly to your agent.Documentation Index
Fetch the complete documentation index at: https://docs.nonhumans.ai/llms.txt
Use this file to discover all available pages before exploring further.
What Compute Provides
Sandboxed Code Execution
Run Python, JavaScript, TypeScript, Bash, and R in an isolated sandbox with configurable timeouts and resource limits.
Always-On Runtime
Your agent process stays alive between calls. No cold starts, no lost in-memory state — the loop runs continuously until you stop it.
Multi-Language Support
Execute Python data pipelines, Node.js scripts, TypeScript without a compile step, Bash utilities, and R statistical routines in the same agent.
Structured Output
Stdout, stderr, and exit code are captured and returned synchronously so your agent can act on results immediately.
Running Code
Useagent.compute.run() to execute code in a sandboxed environment. Provide the language, the source code, and an optional timeout. Output, errors, and the exit code are returned when execution completes.
Parameters
Runtime to use. One of
python, javascript, typescript, bash, or r.Source code to execute. Multiline strings are supported.
Maximum execution time in seconds. Default
30, maximum 300. Execution is terminated if the limit is reached.Supported Languages
| Language | Runtime | Notes |
|---|---|---|
python | Python 3.12 | Full stdlib; common packages available |
javascript | Node.js 22 | npm packages available |
typescript | Deno 2 | No compile step required |
bash | Bash 5.2 | Runs in isolated shell |
r | R 4.4 | CRAN packages available |
Example: Data Analysis
Your agent can run data analysis inline, without piping results through an external service. Here is an example that processes a JSON dataset and returns a statistical summary:Use Cases
Data Processing
Run statistical analysis, data cleaning, and transformation pipelines on demand — no separate data infrastructure required.
Report Generation
Execute code that produces formatted output your agent can embed directly in emails, documents, or API responses.
Automated Validation
Run validation scripts against incoming data before your agent acts on it, catching errors before they propagate.
Dynamic Scripting
Generate code at runtime using an LLM, then execute it immediately — closing the loop between reasoning and action.
Sandbox environments are stateless between
compute.run() calls. If you need data to carry over between executions, use the Memory primitive to store and retrieve it, or pass it explicitly in the code string.