跳转到主要内容
Chinese, Simplified

category

正文

Putting an agent loop inside Erlang/OTP 29 is an engineering choice, not a performance stunt.

The runtime is already used in telecom, messaging, and uptime-sensitive services. The service already has supervision, failure semantics, and operational knowledge. Adding a new Python runtime moves policy, approval, and credentials outside the system the team knows how to supervise.

PRAXO-CORE keeps the runtime and embeds a governed loop. This article covers the entry point, the modules, the tool boundary, the partial surfaces, and when not to use it.

Entry point

Model = praxo_agent:static_model(<<"hello">>),
Options = praxo_agent:new_agent_options(Model),
{ok, Result, _} = praxo_agent:run_agent(
    Options, praxo_models:session(<<"demo">>), <<"hello">>).

The entry point carries options, a session, a prompt, and caller-owned state. The application supplies model callbacks, tool dispatch, policy, and events. The loop owns ordering and contract checks; it does not own the business policy content.

Modules and packages

Surface Purpose
praxo_agent loop, options, tool helpers, fallback model
praxo_models messages, sessions, events, decisions, stream kinds
praxo_sink, praxo_memory event sinks and in-memory store
praxo_checkpoint, praxo_runtime checkpoints, paths, token estimation
praxo_toolcall, praxo_jsonschema tool parsing and schema validation
praxo_plugin, praxo_middleware manifests, PII redaction, structured output, limits

The design follows the language rather than importing a foreign object model. The goal is a small, auditable surface that fits the runtime’s existing idioms.

Tools and callbacks

A tool registration is not just a function pointer. The boundary has to define how arguments are parsed, how the policy sees final arguments, how results and failures propagate, and how events and checkpoints record what happened.

The implementation supports the tool-call formats recorded by the language README. Different models and provider prompts produce different shapes; the runtime should not assume one.

Dependencies

OTP 29 and its json module. The library does not create processes, mailboxes, supervisors, or restart strategies for you.

This is not “zero dependencies in the abstract.” It is a deliberately small dependency surface that an operator can audit.

Partial surfaces

  • Tool registry common path is covered; not every optional Go hook.
  • JSON Schema covers the declared vector behavior, not the full specification.
  • The library is not an OTP application or supervision tree.

Publishing partials is part of the contract. A framework that hides them makes the integration boundary look simpler than it is.

Cost and scope

  • Synchronous loop; tools run serially.
  • Caller owns supervision and failure handling.
  • Tool registry and JSON Schema remain partial; stream part is parity.
  • No hosted provider runtime.

The current scope also does not claim full Go parity. Check the parity inventory before depending on an optional surface.

When not to use

  • You need an OTP application or supervision tree from the library.
  • You need a hosted provider runtime.
  • You need an async high-throughput streaming runtime.

If one of these applies, a bridge, sidecar, migration, or a different runtime may be the better answer. That is a boundary mismatch, not a failure.

Conclusion

The value of a native Erlang loop is not that it makes the language fashionable. It is that the governance boundary can stay close to the work, with an explicit scope and explicit failure modes.

Repo: https://github.com/axisvela/praxo-core
Language source: https://axisvela.github.io/praxo-core/languages/erlang/
Matrix: https://github.com/axisvela/praxo-core/blob/main/spec/languages.md
Canonical: https://architect.pub/erlang-predictable-failure-agent-deep-dive

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