Skip to main content

PRAXO-CORE: Python Agent Framework

PRAXO-CORE is a dependency-free Python framework for building tool-using AI agents. It provides the agent runtime, not a model or hosted service, so you keep control of your models, tools, storage, and sandboxing.

It is for teams that want a small, explicit agent loop instead of a large orchestration platform:

  • Async-first models, tools, events, and sessions.
  • Policy hooks, approvals, path checks, PII redaction, and call limits.
  • Context budgets, checkpoints, middleware, and fallback models.
  • Streaming, cancellation, and OpenAI-compatible, Anthropic, and Gemini adapters.
  • No runtime dependencies; Python 3.11 or newer.

Registry and Coding-Agent Entry

Get started

Install the published package:

pip install praxo-core==0.8.0

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 Python documentation for the full API and the language matrix for current scope.

Examples

Runnable examples live under language/python/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

pip install praxo-core==0.8.0

For a source checkout:

pip install ./language/python

Quickstart

For a complete application with explicit tool scope, policy denial tests, and virtual-environment package checks, use the independent Python consumer.

import asyncio

from praxo.agent import Agent, AgentOptions, Session
from praxo.event import Event
from praxo.model import Message, Response, Usage
from praxo.tool import FuncTool, Registry


class EchoModel:
    async def generate(self, request):
        return Response(message=Message(role="assistant", content="hello"))


class LogSink:
    async def emit(self, event: Event) -> None:
        print(event.to_wire())


async def main() -> None:
    tools = Registry()
    tools.register(FuncTool("echo", "Echo input", lambda args: args))
    agent = Agent(
        AgentOptions(model=EchoModel(), tools=tools, events=LogSink())
    )
    result = await agent.run(Session(id="session-1"), "hi")
    print(result.output, result.steps, result.usage)


asyncio.run(main())

What you get

Area Included
Agent loop Tool calls, multi-step runs, parallel tools, structured output
Governance Policy hooks, tool selection, PII middleware, call limits, HITL interrupts
Runtime Context budgets, checkpoints, events, streaming, cancellation
Integration OpenAI-compatible (OpenAI, DeepSeek, Kimi), Anthropic, and Gemini adapters; bring your own model and tools

Harmovela event sink

HarmovelaSink posts lifecycle events to {base_url}/events as JSON envelopes with spec_version, id, type, source, created_at, and a payload that merges the event data with session_id and run_id when present.

from praxo.adapters.harmovela import HarmovelaSink

sink = HarmovelaSink("http://127.0.0.1:8790/aep/api")
agent = Agent(AgentOptions(model=EchoModel(), events=sink))

Pass transport to run without network access; it receives (method, url, headers, body) and returns (status, body). Limits: the sink adds no authentication, retries, buffering, acknowledgements, ordering, or exactly-once delivery. Filter sensitive event data at the caller, and use HTTPS for remote endpoints.

MCP client (stdio)

MCPClient connects to a local MCP server over newline-delimited JSON-RPC 2.0, runs the initialize / notifications/initialized handshake, lists tools with pagination checks, and calls tools through the Core registry seam.

from praxo.adapters.mcp import MCPClient, MCPServerConfig
from praxo.tool import Registry

config = MCPServerConfig(command="my-mcp-server", args=["--stdio"])
async with MCPClient(config) as client:
    tools = await client.list_tools()
    result = await client.call_tool("search", {"query": "praxo"})

    registry = Registry()
    await client.register_tools(registry)

list_tools() follows nextCursor, preserves inputSchema on each MCPTool, and rejects repeated cursors and duplicate names. call_tool() returns structuredContent when present, otherwise a text string or an ordered list of text blocks; isError results raise MCPToolError. Registering tools does not bypass policy: the agent still authorizes each tool.invoke before calling the registered adapter. Limits: stdio only; no hosted service, authentication, sandboxing, schema promotion, resources, prompts, sampling, or server-initiated requests. Tool output is untrusted. Timeouts send notifications/cancelled, but local cancellation does not prove remote work stopped. MCP failures use MCP_* codes such as MCP_PROTOCOL, MCP_TRANSPORT, MCP_HANDSHAKE, MCP_TIMEOUT, MCP_PAGINATION, MCP_DUPLICATE_TOOL, MCP_TOOL_ERROR, MCP_RPC, and MCP_CLOSED; Registry.specs() still carries only names and descriptions, so read MCPTool.input_schema when you need the model-facing schema.

Contract and status

The normative contract is spec/; Go remains the reference implementation. This package supports SPEC_VERSION 0.2.0 and passes all eleven conformance vector groups. The latest source tag is python/v0.8.1; the published PyPI package remains praxo-core==0.8.0. VFS and plugin hosts are not yet implemented.

Requirements

  • Python 3.11 or newer
  • No runtime dependencies

Contract Surface

Module Contract
praxo.model Model, Request, Response, messages, tool specs, usage
praxo.tool Tool, Registry, FuncTool
praxo.event Event, Sink, MultiSink, FilterSink
praxo.policy Hook, Action, Decision, PathChecker
praxo.memory Store, Record, MemoryStore, ContextAssembler
praxo.checkpoint Checkpoint, Allowlist
praxo.agent Agent, AgentOptions, Session, Result
praxo.hitl Interrupt, InterruptDecision, approve/edit/reject/respond handlers
praxo.context ContextBudget, ModelSummarizer, Offloader, load_agents_md
praxo.middleware call limits, fallback, PII, structured output, tool selection
praxo.toolcall parse_tool_call, strip_tool_call_markup
praxo.jsonschema Schema, ValidationError
praxo.plugin Manifest v1 parsing and validation
praxo.adapters.openaicompat OpenAI-compatible adapter and provider presets
praxo.adapters.anthropic Anthropic Messages adapter
praxo.adapters.gemini Gemini generateContent adapter
praxo.adapters.harmovela Harmovela HTTP event sink
praxo.adapters.mcp stdio MCP client, tool listing, and registry registration

Wire codecs preserve the Go names, including image_url, runId, contentBlocks, and plugin plugin_id.

Conformance

From this directory:

python conformance/run.py
python -m unittest discover -s tests -v

Both commands read ../../spec/vectors/*.json. A released Core implementation must pass every vector and keep spec/parity.md current.

API Reference and Build

See API.md. Refresh the checked-in symbol snapshot after a public API change:

python api-snapshot.py
python api-snapshot.py --check
python api-signatures.py --check
python -m build --wheel --sdist .

The name snapshot and signature snapshot are checked independently. The signature baseline covers class constructors, dataclass fields/defaults, methods, properties, functions, and exported constants. Both are source-API gates, not runtime or ABI guarantees.

CI installs the built wheel and sdist into separate clean virtual environments and runs tests/installed_smoke.py from outside the source tree. This verifies the packaged artifacts, not the checkout. It does not prove PyPI publication or installation from a package registry.

License

MIT. See LICENSE.

Metadata

Release files for praxo-core 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for praxo-core 0.8.1
File Size Uploaded Provenance Actions
praxo_core-0.8.1.tar.gz 189.5 kB With provenance Details for praxo_core-0.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for praxo-core 0.8.1
File Interpreter ABI Platform Actions
praxo_core-0.8.1-py3-none-any.whl Python 3 none any Details for praxo_core-0.8.1-py3-none-any.whl

Total release size: 254.6 kB

Release files / praxo_core-0.8.1.tar.gz

Download URL praxo_core-0.8.1.tar.gz
Size 189.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0c60d75e00a46882a9200b265317d5340ad554c4adfa371195197864330a87bf
BLAKE2b-256 checksum
How to use checksums
5a737dc592f52ea894608ac8323fe0318a59b02905f36b95f91d432cc3d3743b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Release files / praxo_core-0.8.1-py3-none-any.whl

Download URL praxo_core-0.8.1-py3-none-any.whl
Size 65.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6f2cbe867fdcb9fdf6565c1e30906afcd1458451afa3e4455587f656b0ac82a
BLAKE2b-256 checksum
How to use checksums
b871afe097b818016f225052b2e958cf0351fbbb199f3a5d694a67e40c344d3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

Security for praxo-core 0.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for praxo_core-0.8.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page