跳转到主要内容
Chinese, Simplified

category

正文

Disclosure: I maintain PRAXO-CORE. This article reflects the 2.10.0 source state; it is not a production or security certification.

The default answer for Erlang and AI is: put the agent in a Python service and
call the Erlang service as a tool.

It is a familiar architecture. The AI team gets Python, the Erlang team keeps its
runtime, and the boundary is an API call.

Sometimes that is the right answer. But it moves policy, approval, audit, and
credentials across a process boundary. And it asks the Erlang team to trust a
failure path that lives outside the system it already knows how to supervise.

PRAXO-CORE is testing a different answer: keep the Erlang service and put a
governed agent loop inside the process.

Not a bridge. Not a Python wrapper. A native Erlang/OTP 29 implementation of the
Core agent contract.

What this is not

This is the most important paragraph in the article.

The SDK is not an OTP application. It is not a supervision tree. It does not
create processes, mailboxes, supervisors, or restart strategies for you.

It is a synchronous Core loop that the caller runs inside its own process and
supervision model. The caller owns concurrency, failure handling, retries,
backoff, and what happens when the model is wrong at 3 a.m.

That boundary is deliberate. Erlang teams already have strong opinions about
process design and failure behavior. A library that silently creates a parallel
runtime would be a liability.

What native Erlang means

The Erlang SDK is implemented in Erlang/OTP 29. It is not a bridge to Go,
Python, C, or another Core. The agent loop, models, runtime, sinks, memory,
checkpoints, path policy, context, tool calls, JSON Schema, plugin manifests, and
middleware are native Erlang modules.

JSON uses the OTP json module. The verified target is OTP 29; older releases
without json are not supported. The source tag is erlang/v0.9.0, targeting
SPEC_VERSION 0.2.0, and the package is published on Hex as
praxo_core_erlang 0.9.0. The SDK is MIT-licensed; OTP is a separate toolchain.

Architecture

The core call is small:

Model = praxo_agent:static_model(<<"hello">>),
Options = praxo_agent:new_agent_options(Model),
{ok, Result, _Options} =
    praxo_agent:run_agent(Options, praxo_models:session(<<"demo">>), <<"hello">>),
io:format("~s~n", [maps:get(output, Result)]).

The surfaces include:

  • praxo_agent: agent loop, options, tool helpers, fallback model.
  • praxo_models: messages, requests, responses, usage, sessions, events,
    decisions, context budget, stream kinds.
  • praxo_sink: event sinks.
  • praxo_memory: memory store.
  • praxo_checkpoint: checkpoint allowlist.
  • praxo_runtime: path checker, token estimation.
  • praxo_toolcall: tool-call parsing and markup stripping.
  • praxo_jsonschema: schema validation.
  • praxo_plugin: manifest parsing.
  • praxo_middleware: PII redaction, structured output, call limits, tool
    selection.

The evidence is specific: all 11 vector groups pass on OTP 29, with native
regression tests, an API snapshot, a parity inventory, the erlang-conformance
CI job, and the Hex package praxo_core_erlang 0.9.0.

The synchronous, serial loop

The Core loop is synchronous. Tools run serially.

That is not a bug. It is a boundary. If you need high-concurrency streaming,
Erlang is excellent at concurrency, but this SDK is not a streaming runtime. It
is a controlled loop that you can place inside a process you already supervise.

The caller supplies the model and tool callbacks. Callback exceptions are not
converted to contract errors; the caller must decide how to handle them. That is
another deliberate boundary: the SDK does not hide Erlang failure semantics
behind a generic error type.

The partial surfaces

Two surfaces are explicitly partial in the parity inventory:

  1. Tool registry. The common path and vector behavior are covered; not every
    optional Go hook is.
  2. JSON Schema. The vector-defined behavior is covered; this is not full
    JSON Schema.

The stream part is parity, with some P2 stream options still partial. The rest of
the declared Core scope passes. PII redaction, structured output, per-run call
limits, and tool selection are opt-in middleware; fallback models are supported.
Provider adapters and SSE are present, and process plugin host integration is
available; built-in hosted provider configuration and supervision remain outside
the SDK.

Governance and failure

A telecom or messaging service does not need an agent that can talk about
Erlang. It needs an agent that can participate in an operational workflow without
bypassing the controls around that workflow.

That means:

  • policy checks that see the final tool arguments;
  • explicit tool authorization;
  • checkpoints that support recovery;
  • structured events for audit and telemetry;
  • human-in-the-loop approval at the right boundary;
  • a clear statement of what the framework does not own.

If the loop lives in the Erlang process, the service state, the credentials, and
the policy decision can stay closer together. That reduces one kind of boundary
crossing. It does not automatically make the service secure, compliant, or
fault-tolerant.

The supervision question remains yours. The SDK provides a loop; it does not
provide an OTP design.

What it does not do

  • It is not an OTP application or a supervision tree.
  • It does not provide an asynchronous streaming runtime; stream callbacks and SSE exist.
  • It does not ship a hosted provider runtime; adapters require caller-supplied transports.
  • It does not provide an OTP application or supervision tree; process plugin host integration exists.
  • It does not provide a persistent session store.
  • It is not full Go feature parity. Tool registry and JSON Schema are partial; stream part is parity.
  • It does not provide OS-level path containment.
  • It does not provide general PII compliance.
  • It does not claim production readiness or a security certification.

These limits are not footnotes. They are the boundary that makes the native claim
credible.

How to evaluate

Do not start with “AI in Erlang.” Start with the Erlang README and the matrix.

  1. Confirm the tier, tag, Hex package, and current scope.
  2. Run python language/erlang/run-tests.py and the API snapshot check.
  3. Read the synchronous/serial boundary and decide whether it fits your process
    design.
  4. Check the two partial surfaces against your workload.
  5. Test the failure behavior you depend on: callback exceptions, policy denial,
    cancellation, and path handling.
  6. Decide whether a native loop, a bridge, or a sidecar is the right fit.

Repo: https://github.com/axisvela/praxo-core
Erlang docs: https://axisvela.github.io/praxo-core/languages/erlang/
Erlang source: https://github.com/axisvela/praxo-core/tree/main/language/erlang
Matrix: https://github.com/axisvela/praxo-core/blob/main/spec/languages.md

Invitation

The interesting question is not “Can Erlang call a model?” It can.

The interesting question is whether a governed agent loop can fit inside the
operational model that Erlang teams already trust — and who owns supervision when
the model or a tool fails.

If you run Erlang/OTP services, I would value the hard questions. Where should the
loop sit? Which boundary should be native, and which should stay behind a bridge?
What would you test first before letting an agent call a production tool from
Erlang?

That conversation is more useful than another sidecar demo.

本文地址
最后修改
星期六, 十一月 21, 2026 - 17:18
Article
↑