Skip to main content

Core abstractions for Agentivium agent-native systems.

Project description

Agentivium Core

agentivium-core defines the small, domain-neutral contracts shared by Agentivium agent-native systems. It provides typed schemas and abstract interfaces for intent parsing, policy validation, planning, tool adaptation, provider-neutral LLM calls, execution tracing, and evaluation.

It is not an agent runtime, a provider-specific LLM wrapper, or a domain implementation. Schedulers, provider clients, policies, and orchestration belong in extension packages.

Install

pip install agentivium-core

For local development:

pip install -e ".[dev]"

Extend the core

Domain packages subclass schemas and implement interfaces:

from agentivium_core.intent import IntentIR, IntentParser


class MyIntentIR(IntentIR):
    domain: str = "my_domain"
    task: str


class MyIntentParser(IntentParser):
    def parse(
        self,
        request: str,
        context: dict[str, object] | None = None,
    ) -> MyIntentIR:
        return MyIntentIR(raw_request=request, task=request)

The dependency direction stays one-way: domain packages import agentivium_core; the core never imports a domain package.

Public API

from agentivium_core.intent import IntentIR, IntentParser
from agentivium_core.planner import ActionPlan, Planner
from agentivium_core.policy import (
    PolicyValidator,
    ValidationIssue,
    ValidationResult,
)
from agentivium_core.tools import ToolAdapter
from agentivium_core.trace import ExecutionTrace
from agentivium_core.eval import EvaluationRecord

Provider-neutral LLM abstraction

agentivium-core defines LLMClient, LLMRequest, LLMResponse, PromptTemplate, StructuredOutputSpec, and LLMCallTrace so downstream packages can use LLMs without coupling core to OpenAI, Anthropic, Gemini, Ollama, vLLM, llama.cpp, or any other provider.

from agentivium_core.llm import (
    LLMClient,
    LLMRequest,
    LLMResponse,
    PromptTemplate,
)


class MyLocalLLMClient(LLMClient):
    def generate(self, request: LLMRequest) -> LLMResponse:
        return LLMResponse(content='{"intent": "example"}', model="local")


template = PromptTemplate(
    name="intent_parser",
    system="You extract structured intent.",
    user_template="Request: {request}",
)

messages = template.render({"request": "Run a small MPI job."})
client = MyLocalLLMClient()
response = client.generate(LLMRequest(messages=messages))
print(response.content)

Production provider clients live in domain or provider packages. Core only defines the contracts and a MockLLMClient for tests and demos.

See the concepts, API reference, extension guide, and examples. The complete v0.1 rationale and boundaries are preserved in the original design guideline.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentivium_core-0.2.1.tar.gz (54.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentivium_core-0.2.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file agentivium_core-0.2.1.tar.gz.

File metadata

  • Download URL: agentivium_core-0.2.1.tar.gz
  • Upload date:
  • Size: 54.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","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}

File hashes

Hashes for agentivium_core-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7dbb1cc4624ff7b364f6f1af6fbaa17c1ab5426d7c459ac2158911783fcf6dd0
MD5 d51867c4a422bfa0d745a7ead95372c0
BLAKE2b-256 bde16fc79399f58268e0c50c4233b2f8d8fc39cd3a7f1bb22caab7284f5f57b6

See more details on using hashes here.

File details

Details for the file agentivium_core-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: agentivium_core-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","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}

File hashes

Hashes for agentivium_core-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a6da75398f22c9e4a71a689d73e4fb4c55b0d4cb5994e782859c8b37a3ab6999
MD5 59b01da1291309125f76158c06a9d8c5
BLAKE2b-256 6cfd2c6599201dcc342c997f215f643fe4933fc9f12e495bfa5c17234a994a6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page