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.

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

Stateful assistant runtime

Agentivium Core 0.3.0 adds 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.3.0.tar.gz (63.0 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.3.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentivium_core-0.3.0.tar.gz
  • Upload date:
  • Size: 63.0 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.3.0.tar.gz
Algorithm Hash digest
SHA256 715a51a47d170a09778a896489c8c7d96d1f710d79b64c3810a15d84fe13ecd4
MD5 6ba28a088ae84621a88aee2574637845
BLAKE2b-256 27610aa3b43a1e21ff08481455fbe7a71724720285ba912264643f31633d8d7d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentivium_core-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 27.1 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31b0b6510a00d93ef801b71611270fe82ddf2c0099685d7c116014b20c53a072
MD5 201850b03116960536a3b861d51dad5e
BLAKE2b-256 9fdc64e5839b0e6f4335c0caad8b3fc2c19bd7867fb7483a2e4194512cb31a49

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