Skip to main content

swarmauri_core

Swarmauri SDK

swarmauri_core

Core interface contracts and shared types for Swarmauri composable intelligence infrastructure components.

pypi: swarmauri_core Source version: 0.11.0.dev8 Python: >=3.10,<3.15 Layer: core Lifecycle: active License: Apache-2.0 Notice: attribution

Monthly PyPI downloads: swarmauri_core README hits: swarmauri_core

README standards: CI gate Tests: example source Certification: not certified Governance: repository policy Evidence: source and CI

Overview · Installation · Quick Start · Usage · API · Contributing · Governance · License


Overview

Summary

swarmauri_core: Core interface contracts and shared types for Swarmauri composable intelligence infrastructure components.

Why This Package

swarmauri_core keeps component contracts separate from implementations. Package authors can depend on stable interfaces without pulling in every base class, provider adapter, model package, or runtime integration.

When to Use

Use swarmauri_core when you are designing or implementing a Swarmauri-compatible component and need the interface contract. Use swarmauri_base when you also need reusable base-class behavior, serialization helpers, and component registration. Use swarmauri_standard when you want ready-to-use implementations.

Features

The package is intentionally implementation-light. It defines contracts, protocol shapes, enums, and shared types so implementation packages can interoperate without depending on each other directly.

Major interface families include:

  • Agents and agent APIs: IAgent, conversation, parser, retrieval, toolkit, and vector-store agent mixins.

  • LLM and multimodal prediction: text LLMs, tool LLMs, OCR, STT, TTS, and VLM interfaces.

  • Documents and parsing: document contracts, parser contracts, chunkers, conversations, prompts, and prompt templates.

  • Retrieval and vectors: vector, matrix, tensor, metric, similarity, vector-store comparator, deprecated distance compatibility contracts, vector store, and document store contracts.

  • Security and trust: crypto, MRE crypto, cipher suites, signing, proof-of-possession, token services, key providers, certificates, and XMP embedding.

  • Runtime infrastructure: middleware, transports, storage adapters, publishers, rate limits, tracing, state, service registries, and pipelines.

  • Business systems: billing provider interfaces for customers, payments, invoices, subscriptions, refunds, payouts, risk, reporting, webhooks, and marketplace flows.

  • Stable abstract interfaces for Swarmauri component packages.

  • Shared types for crypto, signing, key management, transports, billing, and proof-of-possession workflows.

  • Zero runtime dependencies.

  • Interface-first design for packages that later inherit reusable behavior from swarmauri_base.

  • Python 3.10, 3.11, 3.12, 3.13, and 3.14 support.

Non-Goals

swarmauri_core owns core interface contracts and shared types for Swarmauri composable intelligence infrastructure components. Its imports do not by themselves configure credentials, deploy a service, or certify the behavior of its consumers. Dependencies and neighboring packages retain their own documented responsibilities.


Getting Started

Prerequisites

Python >=3.10,<3.15 is required. The manifest declares no direct runtime dependencies. Read the example’s inputs and service requirements before execution.

Installation

Install with uv:

uv add swarmauri_core

Install with pip:

pip install swarmauri_core

uv

uv add swarmauri_core

pip

python -m pip install swarmauri_core

Poetry

poetry add swarmauri_core

Quick Start

Example

Source: docs/readme/quick_start.py.

import asyncio
from typing import Any, Optional

from swarmauri_core.agents.IAgent import IAgent
from swarmauri_core.messages.IMessage import IMessage


class MinimalAgent(IAgent):
    def exec(
        self,
        input_data: Optional[Any] = None,
        llm_kwargs: Optional[dict] = None,
    ) -> Any:
        return {"input": input_data, "kwargs": llm_kwargs or {}}

    async def aexec(
        self,
        input_str: Optional[str | IMessage] = "",
        llm_kwargs: Optional[dict] = None,
    ) -> Any:
        return self.exec(input_str, llm_kwargs)

    def batch(
        self,
        inputs: list[str | IMessage],
        llm_kwargs: Optional[dict] = None,
    ) -> list[Any]:
        return [self.exec(item, llm_kwargs) for item in inputs]

    async def abatch(
        self,
        inputs: list[str | IMessage],
        llm_kwargs: Optional[dict] = None,
    ) -> list[Any]:
        return await asyncio.gather(
            *(self.aexec(item, llm_kwargs) for item in inputs)
        )

Expected Result

The example demonstrates the documented swarmauri_core source boundary or workflow. Complete its required configuration first. README CI checks the maintained source’s syntax and declarations; it does not claim that external services or the application workflow were exercised.


Usage

Common Workflows

Source: docs/readme/usage.py.

import asyncio
from typing import Any, Optional

from swarmauri_core.agents.IAgent import IAgent
from swarmauri_core.messages.IMessage import IMessage


class MinimalAgent(IAgent):
    def exec(
        self,
        input_data: Optional[Any] = None,
        llm_kwargs: Optional[dict] = None,
    ) -> Any:
        return {"input": input_data, "kwargs": llm_kwargs or {}}

    async def aexec(
        self,
        input_str: Optional[str | IMessage] = "",
        llm_kwargs: Optional[dict] = None,
    ) -> Any:
        return self.exec(input_str, llm_kwargs)

    def batch(
        self,
        inputs: list[str | IMessage],
        llm_kwargs: Optional[dict] = None,
    ) -> list[Any]:
        return [self.exec(item, llm_kwargs) for item in inputs]

    async def abatch(
        self,
        inputs: list[str | IMessage],
        llm_kwargs: Optional[dict] = None,
    ) -> list[Any]:
        return await asyncio.gather(
            *(self.aexec(item, llm_kwargs) for item in inputs)
        )

Use swarmauri_core when defining a new implementation package or validating that a class satisfies a public Swarmauri contract.

Implement a parser contract:

from pathlib import Path

from swarmauri_core.documents.IDocument import IDocument
from swarmauri_core.parsers.IParser import IParser


class PlainTextParser(IParser):
    def parse(self, data: str | bytes | Path) -> list[IDocument]:
        raise NotImplementedError("Return concrete Document instances here.")

Implement a storage or retrieval contract in a concrete package, then expose the class through swarmauri_base and the public swarmauri namespace when appropriate.

Configuration

Configure swarmauri_core through the APIs in package source; its manifest describes installation requirements, not an implicit service configuration. No additional package-global configuration contract is inferred from dependencies.

Error Handling

The inspected swarmauri_core source raises AttributeError, IntegrityError, KeyError, NotImplementedError, ValueError. Handle these at the calling boundary and consult the implementation for the triggering conditions.

Best Practices

Use the explicit swarmauri_core imports documented below and keep collaborator configuration with the caller. Run the package’s relevant tests after changing IAgentCommands, IAgentRouterCRUD, IExportConf, IAgent, IAgentCompaction, IAgentConversation, IAgentParser, IAgentRetrieve; an import or successful installation alone does not establish its runtime guarantees.


Package Boundary

What It Owns

swarmauri_core is located in core and owns core interface contracts and shared types for Swarmauri composable intelligence infrastructure components. Source-declared APIs include IAgentCommands, IAgentRouterCRUD, IExportConf, IAgent, IAgentCompaction, IAgentConversation, IAgentParser, IAgentRetrieve. The manifest records its direct dependency boundary.

Public API and Import Surfaces

Import namespace: swarmauri_core.

Source-declared exports or types: IAgentCommands, IAgentRouterCRUD, IExportConf, IAgent, IAgentCompaction, IAgentConversation, IAgentParser, IAgentRetrieve.

Inspect package source for exact signatures; this inventory does not designate every internal module as stable.

Entry Points

This package declares no command-line, GUI, or plugin entry points in its manifest.

Injected Dependencies

The direct installation dependencies of swarmauri_core are empty in the manifest. These declarations do not imply automatic provider selection. Pass collaborators through the explicit constructors or call signatures in package source.

Protocol Consumers

Direct consumers in this checkout’s package manifests include swarmauri_base, swarmauri_billing_adyen, swarmauri_billing_authorize_net, swarmauri_billing_braintree, swarmauri_billing_paypal, swarmauri_billing_paystack, swarmauri_billing_razorpay, swarmauri_billing_square, swarmauri_certs_acme, swarmauri_certs_azure, swarmauri_certs_cfssl, swarmauri_certs_csronly, swarmauri_certs_ocspverify, swarmauri_certservice_aws_kms, swarmauri_certservice_gcpkms. These edges describe declared dependencies, not protocol-conformance evidence.

Extensions

For swarmauri_core, use the source-declared public interfaces (IAgentCommands, IAgentRouterCRUD, IExportConf, IAgent, IAgentCompaction, IAgentConversation, IAgentParser, IAgentRetrieve) when composing or extending behavior. Its entry-point section below is authoritative for registered plugins; no additional extension loader is inferred from the package name.


Operations and Readiness

Operational Requirements

Operate swarmauri_core according to its actual entry points and collaborators. The dependency and Python requirements in the manifest are prerequisites; deployment topology, credentials, and readiness remain the responsibility of the consuming application unless explicitly documented above.

Health and Observability

This README does not establish a standalone health endpoint for swarmauri_core. Observe the concrete caller’s results, exceptions, and existing test reports. An application that embeds this package must define its own health and telemetry contract.

Security and Resource Limits

Apply the input, credential, and resource constraints implemented in package source. The swarmauri_core README gate is a documentation check, not a security review or a substitute for the implementation’s limits and caller authorization.

Compatibility

This source version of swarmauri_core declares Python >=3.10,<3.15. Consult its dependency constraints before upgrading. Source-version and registry-version badges have separate meanings; this migration makes no additional platform or interoperability certification claim.


Verification

Tests

Run python -m pytest tests/unit/test_readme_sources.py from the swarmauri_core package directory for the maintained example source checks (Python compilation and non-Python file presence). Existing package tests include:

The repository README gate also checks the required heading tree, metadata, managed fragments, and referenced files.

Certification Status

No external certification is asserted for swarmauri_core by this documentation migration. README conformance, example syntax, runtime tests, and protocol or security certification are distinct evidence scopes.

Evidence

The README standards CI records mechanical documentation results for its tested commit. The package source and example sources support the package-boundary description; external runtime behavior requires its own test evidence.


FAQ

Why

Q: What belongs in swarmauri_core?

A: Interface contracts, protocol shapes, enums, and shared types for Swarmauri component families.

How

Q: How does this package relate to swarmauri_base?

A: swarmauri_core defines interfaces. swarmauri_base implements reusable base classes and serialization behavior on top of those interfaces.

When

Q: Should application developers instantiate classes from this package?

A: Usually no. Most application code uses concrete implementations from swarmauri_standard, community packages, or provider-specific packages. Component authors use swarmauri_core to implement the correct contract.


More Documentation

The repository contribution guide, package source, and manifest provide the supporting context for swarmauri_core. The README policy defines the common document structure.

Foundational packages:

  • swarmauri provides the namespace importer and plugin discovery layer.
  • swarmauri_base provides reusable base classes built on these interfaces.
  • swarmauri_standard provides first-party implementations for common component kinds.

Packages built around specific core component kinds:


Contributing

How to Contribute

When adding or changing a core interface, keep the contract narrow, update downstream base classes where needed, add focused tests, and follow the Swarmauri SDK contribution guide.

Development Setup

Work from the pkgs/10-interfaces/swarmauri_core checkout. Synchronize its declared development environment with uv, then run the relevant package tests and python -m pytest tests/unit/test_readme_sources.py. The repository’s dedicated README job installs readme-standards==0.1.3 without resolving unrelated runtime packages.

Notes for Maintainers

Composable execution contracts

The executions, tasks, workflows, permissions, delegation and invocations namespaces define driver-neutral lifecycle, admitted task authority and invocation contracts. Existing service registries, task assignment, transports and token interfaces remain in use. See the composition guide.

swarmauri_core provides the interface contracts for the Swarmauri SDK. It is the package component authors use when they need stable abstract interfaces for agents, tools, LLMs, parsers, vector stores, cryptography, signing, key providers, transports, middleware, billing, storage, XMP, and other composable intelligence infrastructure components.

Component Author Workflow

  1. Choose the closest interface from swarmauri_core.
  2. Implement domain behavior in a package-specific class.
  3. Add reusable serialization and registration behavior with swarmauri_base when the implementation should become a Swarmauri component.
  4. Publish or register the implementation package through the appropriate swarmauri.<kind> entry point or namespace mapping.
  5. Document installation and usage in the implementation package README.

Run checkpoints and tool steps

swarmauri_core.run_stores defines IRunStore, RunCheckpoint, and RunConflictError. Checkpoints have an opaque text payload and a revision guarded by an atomic save. swarmauri_core.tool_llms.IToolStepModel is the opt-in contract for proposing tool calls and formatting their results.


Governance

Ownership and Decision Making

Changes to swarmauri_core follow the maintainer review process of swarmauri/swarmauri-sdk and its contribution guide. Author attribution remains in the manifest; this README does not assign new publishing or administrative authority.

Standards and Policies

swarmauri_core follows the versioned package-guide-v1 outline. All fixed headings, hierarchy, order, separators, and package-specific branding are checked by CI; reviewers assess the accuracy and usefulness of authored claims.

Lifecycle and Migration

The swarmauri_core source version is 0.11.0.dev8. This change standardizes documentation and adds a development-only gate; it does not publish a new runtime version or declare a previously unpublished package released. Preserve explicit deprecation and replacement instructions where present.


License and Attribution

License

Licensed under Apache-2.0. See LICENSE.

Apache-2.0

Notices

See NOTICE for attribution.

Metadata

Release files for swarmauri_core 0.11.0

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

Source distribution (sdist)

Source distribution for swarmauri_core 0.11.0
File Size Uploaded Provenance Actions
swarmauri_core-0.11.0.tar.gz 83.5 kB Without provenance Details for swarmauri_core-0.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for swarmauri_core 0.11.0
File Interpreter ABI Platform Actions
swarmauri_core-0.11.0-py3-none-any.whl Python 3 none any Details for swarmauri_core-0.11.0-py3-none-any.whl

Total release size: 245.3 kB

Release files / swarmauri_core-0.11.0.tar.gz

Download URL swarmauri_core-0.11.0.tar.gz
Size 83.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d3b26220e675c9f202440624a812d7ba97d2fc2f0ab3957f2c55bed6a831c47a
BLAKE2b-256 checksum
How to use checksums
1c71d006646f1e22149fcf233801cf7dd70c02b47ad378af520722ab0cbcfc0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / swarmauri_core-0.11.0-py3-none-any.whl

Download URL swarmauri_core-0.11.0-py3-none-any.whl
Size 161.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e975b78b3d8607fa0abd75370431790e4dc0118ed189ab58bfeac31005f9263
BLAKE2b-256 checksum
How to use checksums
d48eedf2bb1f9b06f972d27c45f151dadddba87a745b81fa4b4311922fd676f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for swarmauri_core 0.11.0

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

0.11.0 This release

2 release files No provenance

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