PRAXO-CORE Erlang Core
PRAXO-CORE is an embeddable, MIT-licensed agent framework. This package is its
native Erlang Core with source tag erlang/v0.8.2. It passes all eleven shared
vector groups on Erlang/OTP 29 and includes the native agent loop, memory store,
checkpoint allowlist, lexical path policy, context compaction, event sinks,
middleware helpers, tool selection, and human-in-the-loop interrupt decisions.
It does not call Go or another Core.
- Implementation type: Core.
- Package version:
0.8.2; supportedSPEC_VERSION:0.2.0. - Hex package name:
praxo_core_erlang; OTP application name:praxo_core. - The Hex package is
praxo_core_erlang@0.8.2. - Toolchain: Erlang/OTP 29 or newer. JSON uses the OTP
jsonmodule.
Registry and Coding-Agent Entry
- Registry introduction: REGISTRY.md
- Machine-readable entry: llms.txt and llms.md
- Examples: runnable language-specific examples.
- Coding-agent contract: docs/getting-started/coding-agents.md
- Registry: Hex
- Community: X · Weibo
Get started
Install the published package:
{praxo_core, "0.8.2", {pkg, praxo_core_erlang}}
Then run the smallest deterministic example:
- Consumer starter: explicit tool scope and a deny check.
- Live model: connect an OpenAI-compatible endpoint and register
get_time.
See the Erlang documentation for the full API and the language matrix for current scope.
Examples
Runnable examples live under language/erlang/examples.
| Goal | Example |
|---|---|
| Install and deny one unsafe call | consumer |
| Connect a real model | live-model |
| Connect MCP tools | mcp |
| Validate structured output | structured-output |
| Stream a response | streaming |
| Add identity and policy | identity-policy |
| Persist checkpoints | checkpoint |
| Run behind HTTP | service |
| Approve or edit a tool call | hitl |
| Resume a multi-turn session | session-checkpoint |
| Retry transient failures | retry |
| Add provider fallback | provider-fallback |
| Observe agent events | event-sink |
Install
{deps, [{praxo_core, "0.8.2", {pkg, praxo_core_erlang}}]}.
- Local gate: eleven vector groups, native regression tests, API snapshot, and parity inventory.
Build and Test
From the repository root:
python language/erlang/run-tests.py
python language/erlang/api-snapshot.py --check
Set ERLC and ERL to select the compiler and runtime. The Python runner only
launches erlc, erl, and the API checks; the implementation and tests are
Erlang. Build output stays under language/erlang/build/ebin/.
To build manually from language/erlang/:
erlc -I src -o build/ebin src/*.erl conformance/*.erl tests/*.erl
erl -noshell -pa build/ebin -eval "praxo_conformance:main()." -s init stop
erl -noshell -pa build/ebin -eval "praxo_tests:run()." -s init stop
Usage
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)]).
OpenAI-Compatible Adapter
praxo_openai_compatible provides a non-streaming adapter over the native model
seam. It posts to {base_url}/chat/completions and maps assistant content, tool
calls, and token usage. Inject transport to run without network access; it
receives (Path, Payload) and returns {ok, DecodedJson}.
Adapter = praxo_openai_compatible:new(
<<"https://api.example.com/v1">>, <<"model-id">>,
#{api_key => <<"token">>}),
Request = praxo_models:request([praxo_models:message(<<"user">>, <<"hi">>)]),
{ok, Response, _} = praxo_openai_compatible:generate(Adapter, Request),
Model = praxo_openai_compatible:model(Adapter).
Provider HTTP failures return {error, <<"PROVIDER_HTTP">>, Adapter}; invalid
tool-argument JSON returns PROVIDER_JSON. Streaming is not implemented.
Public declarations are inventoried in api/0.4.0.txt.
This is a source declaration check, not a binary ABI promise. Regenerate it with
python api-snapshot.py.
Anthropic and Gemini Adapters
praxo_anthropic and praxo_gemini map the native Messages and generateContent
APIs. Both accept a caller-supplied transport for deterministic tests.
Anthropic = praxo_anthropic:new(<<"claude-sonnet-4-5">>, <<"ak">>),
Gemini = praxo_gemini:new(<<"gemini-2.5-pro">>, <<"gk">>),
MCP Client
praxo_mcp implements a stdio JSON-RPC MCP session with initialize, paginated tool listing, tool calls, timeouts, cancellation notifications, and an injectable transport for deterministic tests.
Harmovela Event Sink
praxo_harmovela posts each event to {base_url}/events.
Sink = praxo_harmovela:new(<<"http://127.0.0.1:8790/aep/api">>),
Event = praxo_models:event(<<"tool.call">>, <<"s1">>, <<"run-1">>, #{<<"name">> => <<"echo">>}),
ok = praxo_harmovela:emit(Sink, Event).
The returned map is also a praxo_sink sink, so events => Sink works with the
agent loop. Inject transport (and clock) in the options map to test without
a network. A 2xx status returns ok; other statuses return
{error, {http_status, Status, BoundedBody}} from praxo_harmovela:emit/2.
The sink adds no authentication, retries, buffering, ordering, or exactly-once
delivery. Use HTTPS and filter sensitive event data first.
Current Limits
- The verified target is Erlang/OTP 29. Older releases without the
jsonmodule are not supported. - No HTTP streaming runtime, plugin host, or persistent session store is
provided. The loop is synchronous; tool batches can execute in spawned
processes when
max_parallel_toolsis greater than one. - Optional
cancellation,on_stream, andmax_parallel_toolsagent options add cooperative cancellation, stream parts, and bounded parallel tool execution.praxo_sse:parse/1rejects truncated and half-packet streams. - PII redaction, structured output, per-run call limits, and tool selection are opt-in and integrated into the agent loop.
- Path checks are lexical and do not resolve symlinks or reparse points; they are not an OS containment boundary.
- Model and tool callbacks are caller-supplied functions. Callback exceptions are not converted to contract errors.
- Core-local errors and exception terms are not new shared wire error codes. Passing the vectors does not establish full Core parity or production readiness.
The source is MIT; see LICENSE. Erlang/OTP is a separate toolchain, not vendored code.
See CHANGELOG.md for per-release changes and compatibility notes.
See language policy, parity inventory, SETUP.md, and implementation support.