Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Cross Agents Runtime

Cross Agents Runtime (Python)

Cross Agents Runtime is a provider-agnostic, model-adaptive agent runtime for building controlled mono-agent and multi-agent systems on Python. It picks an execution pattern that fits a given task, model, policy, and operational constraints, then runs it inside an audited, bounded session.

This repository contains the Python implementation of the framework. Implementations in other ecosystems (.NET, TypeScript) live in separate repositories so each can follow the conventions and release cadence of its own ecosystem.

What it is

  • A small set of stable contracts (crossagents.abstractions) describing models, tools, memory, patterns, policy, and audit.
  • A minimal runtime host (crossagents.core) that registers adapters and patterns, selects one for each task, runs it, and surfaces a structured result.
  • A first-party set of safe patterns (crossagents.patterns): a no-tool single call, a Plan-Execute-Validate flow, a JSON plan skeleton, and a strictly bounded ReAct loop.
  • Optional layers for tooling (crossagents.tooling) and memory (crossagents.memory) that can be plugged in independently.
  • Deterministic test doubles (crossagents.testing) for pattern and runtime tests with no external dependencies.

What it isn't

  • Not a chatbot framework. Conversations are a use case applications can build on top, not the framework's purpose.
  • Not coupled to a single LLM provider. The framework ships no provider adapters in this milestone; applications wire their own through IModelAdapter.
  • Not a tool-calling library. Tooling is an optional module; tasks that don't need tools never see the tooling layer.
  • Not a memory store. Memory retrieval is an optional module; the framework does not own a database or vector index.
  • Not unbounded. Patterns must declare bounds. Unbounded ReAct configurations are rejected at registration time.

Core concepts

  • Model adapter: a thin IModelAdapter implementation that talks to one model and reports ModelCapabilities.
  • Agent task: a single unit of work (AgentTask) with a type, input, and optional requirements.
  • Pattern: an IAgentPattern plus a PatternDescriptor that declares its risk profile, bounds, and dependencies.
  • Pattern selector: a deterministic chooser that filters patterns by task requirements, model capabilities, and policy, then scores survivors.
  • Policy engine: an IPolicyEngine that translates declarative policies (AgentPolicy) into yes/no decisions for selection and tool calls.
  • Audit pipeline: a per-session buffer that fans events out to IAuditSink and surfaces them in the runtime result.

Minimal example

import asyncio

from crossagents.abstractions.agents import AgentTask
from crossagents.abstractions.models import (
    ModelCapabilities, ModelProfile, ModelProvider,
)
from crossagents.core import AgentRuntime, RuntimeOptions
from crossagents.patterns import NoToolPattern, PlanExecuteValidatePattern
from crossagents.testing import FakeModelAdapter, InMemoryAuditSink


async def main() -> None:
    runtime = AgentRuntime(RuntimeOptions(audit_sink=InMemoryAuditSink()))

    profile = ModelProfile(
        profile_id="demo-echo",
        display_name="Demo echo model",
        provider=ModelProvider.CUSTOM,
        capabilities=ModelCapabilities(
            provider_name="demo", model_id="echo", is_local=True,
        ),
    )

    runtime.register_model(
        FakeModelAdapter(profile, "Hello from Cross Agents Runtime.")
    ).register_pattern(NoToolPattern()).register_pattern(PlanExecuteValidatePattern())

    result = await runtime.run(
        AgentTask(task_id="demo-1", input="Say hello.", requires_validation=False),
        profile.profile_id,
    )

    print(f"{result.selected_pattern_id}: {result.agent.output if result.agent else ''}")


if __name__ == "__main__":
    asyncio.run(main())

A self-contained runnable version of this lives in examples/minimal_runtime.py.

Package layout

Module Purpose
crossagents.abstractions Stable contracts (models, tools, memory, patterns, policy, audit)
crossagents.core Runtime host, session, selector, default policy engine, audit pipeline
crossagents.patterns First-party safe patterns
crossagents.tooling Optional tool registry, validator, executor, normalizer
crossagents.memory Optional retrieval, ranking, compression, sliding buffer
crossagents.testing Deterministic test doubles

Design principles

  1. Provider-agnostic: model behaviour reaches the runtime only through IModelAdapter and ModelCapabilities.
  2. Model-adaptive: pattern selection inspects the model's capability profile and degrades safely when something is missing.
  3. Bounded by default: every shipped pattern declares step counts and risk levels; the runtime rejects unbounded configurations.
  4. Optional middleware: tooling and memory are separate modules and separate runtime services; they can be omitted entirely.
  5. Auditable: every session emits a canonical sequence of audit events suitable for compliance and debugging.
  6. Deterministic to test: crossagents.testing ships in-process fakes for every external dependency the framework defines.
  7. Small public surface: contracts are short, immutable, and documented; framework code never exposes provider-specific types.

Current status

This is the first milestone. It establishes the contracts, the runtime, three patterns plus a strictly bounded ReAct loop, optional tooling and memory layers, and the test surface. Provider adapters, multi-agent orchestration primitives, distributed session storage, and other extensions are out of scope for this milestone.

What is intentionally not in this milestone

  • No real provider adapters (OpenAI, Anthropic, Bedrock, Ollama, etc.).
  • No vector store, embedding, or document extraction implementations.
  • No multi-agent orchestration patterns (debate, swarm, voting). The contracts allow them; an implementation will arrive in a later milestone.
  • No streaming response surface beyond the boolean capability flag.
  • No long-term session persistence.
  • No telemetry exporter (open-telemetry, Prometheus, etc.). The audit sink is the integration point.

Building and testing

Using uv (recommended):

uv sync --all-extras
uv run pytest
uv run python examples/minimal_runtime.py
uv build

Using pip and python -m build:

python -m pip install -e ".[test]"
pytest
python examples/minimal_runtime.py
python -m pip install build && python -m build

Tests run entirely in-process and require no credentials or network access.

License

MIT. See LICENSE.

Metadata

Release files for crossagents-runtime 0.1.0a1

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

Source distribution (sdist)

Source distribution for crossagents-runtime 0.1.0a1
File Size Uploaded Provenance
crossagents_runtime-0.1.0a1.tar.gz 946.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for crossagents-runtime 0.1.0a1
File Interpreter ABI Platform
crossagents_runtime-0.1.0a1-py3-none-any.whl Python 3 none any Details

Total release size: 992.5 kB

Release files / crossagents_runtime-0.1.0a1.tar.gz

Download URL crossagents_runtime-0.1.0a1.tar.gz
Size 946.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6e84fd12ad3e00fbe8be0d2c269c0834fd0eefea106f6591854581a907bd2c1e
BLAKE2b-256 checksum
How to use checksums
31bf1d4f53a9f670d3c30a5d95ba9cd701f9d673e7ac3433248bfb394b173867
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / crossagents_runtime-0.1.0a1-py3-none-any.whl

Download URL crossagents_runtime-0.1.0a1-py3-none-any.whl
Size 46.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ddc9cc76e9673169680f643d1c48a35c3063dc59bbeac2bda521d7b3021640a
BLAKE2b-256 checksum
How to use checksums
c52e4aee711f809a69021554cfc3ee877c5d7ca7beadd24a9f39a4bcda987c6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for crossagents-runtime 0.1.0a1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release
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