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, evaluation, and stateful assistant runtimes. Version 0.4.0 adds a verifiable-intent kernel for typed evidence, deterministic verification, admissibility, approval, and audit.

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.

Verifiable intent kernel

The 0.4.0 kernel keeps domain semantics in extensions while core provides the mechanism:

Intent + snapshots + candidate decision + evidence
  → verification checks
  → intent-decision relation
  → admissibility
  → approval / escalation
  → guarded domain execution
  → audit trace

The default policy fails closed: unsupported hard constraints, unknown policy compliance, missing required evidence, contradictions, expired snapshots, and provider exceptions cannot produce an accepted decision. Admissibility remains separate from authorization and approval.

Stable cross-package imports are documented in the 0.4 compatibility note. See the verifiable-intent guide for a complete non-domain extension example and strictness behavior.

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

Stateful assistant runtime

Agentivium Core 0.3.0 added reusable abstractions for multi-turn assistant systems: conversation state, context packs, memory, retrieval, ambiguity modeling, clarification requests, intent updates, tool permissions, trace events, and multi-turn evaluation records.

from agentivium_core.clarification import (
    BlockingFirstClarificationPlanner,
    IntentAmbiguity,
)

ambiguities = [
    IntentAmbiguity(
        field="policy.account",
        ambiguity_type="missing_required",
        severity="blocking",
        reason="Account is required.",
        question="Which account should I use?",
    )
]

planner = BlockingFirstClarificationPlanner()
request = planner.plan_clarification(ambiguities)

print(request.questions[0].question)

Domain packages specialize these contracts. For example, hpc-claw can build HPC-specific context providers, policy checks, and tool adapters on top of the core assistant-runtime interfaces without adding scheduler logic to core.

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.4.0.tar.gz (94.6 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.4.0-py3-none-any.whl (55.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentivium_core-0.4.0.tar.gz
  • Upload date:
  • Size: 94.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.4.0.tar.gz
Algorithm Hash digest
SHA256 dcfee611cd398e0f38eaf858508b72b6a6ed1b83e46bfa5032fb412a89d78eba
MD5 d44ff71b78283d1ffdc8c16b0400d8b6
BLAKE2b-256 2e1f480714f3c96d303771448aa833691b6e4cbc6edc04db8df3e3d6b6b70904

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentivium_core-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 55.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 891634cd862b2a179c9aafa6468f31256efbe89bb915fd8fbf31bbe05f62cd7e
MD5 3bb77ad869c5a8b2d1cc317964549252
BLAKE2b-256 67a6e5e96c488f5e0c8370f12925912a384846cb5679595f985425cbf7232f97

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