Skip to content

API reference

The reference is generated from the library's docstrings and type annotations. It documents each package's public API: the names in its __all__. Anything else is internal and may change without notice.

Packages

The packages are layers. Each depends only on the ones below it, so each is usable without the ones above (Architecture).

Package What it holds Install
artifactr.core Every rule, as pure functions over immutable values: artifact types, actors, commands, events, patches, rejections, change notes and the protocol's frames core
artifactr.telemetry Tracing and metrics through the OpenTelemetry API: span attribution, the metric registry, and untraced polling core
artifactr.workspace Tenant-scoped workspace handles, the storage protocol and in-memory storage core
artifactr.agent The pydantic-ai capability, the session, the runner and live output core
artifactr.scores Feedback as scores: the mirror that follows the log, on evalr's mapping and ports langfuse or evals extra
artifactr.sql SQL storage on PostgreSQL and SQLite, and its migrations sql, postgres or sqlite extra
artifactr.fastapi The thread protocol over WebSocket, and REST, as a FastAPI router fastapi extra
artifactr.otel configure_telemetry: the OpenTelemetry SDK, exporters and instrumentations, and metric views, composed with other libraries' contributions otel extra
artifactr.langfuse Langfuse behind evalr's score ports, a span filter for whole traces, and a turn's trace attributes langfuse extra
artifactr.litellm A model over a LiteLLM proxy, and a capability for each request's metadata, key and guardrails litellm extra
artifactr.mcp An MCP server for external agents mcp extra
artifactr.evals evalr for artifactr: datasets from the log, experiments that replay turns, online evaluation of turns, and the end-to-end measures evals extra

The wire formats have their own pages: the thread protocol and its JSON Schema.

The top-level package

artifactr re-exports the names most applications need, so from artifactr import Workspaces, Runner works. Each is documented in its layer:

Name Documented in
Artifact, MarkdownArtifact, Versioned, WritePolicy artifactr.core: Artifacts
new_id artifactr.core: Identifiers
Actor, UserActor, AgentActor, ExternalAgentActor, SystemActor artifactr.core: Actors
Applied, Proposed, Resolved, Recorded artifactr.core: Outcomes
Rejection, VersionConflict, NotFound artifactr.core: Rejections
JsonPatch, TextEdit, TextEdits artifactr.core: Patches
Workspaces, Workspace, InMemoryStorage artifactr.workspace
ArtifactWorkspace, Session, Runner, RunHandle, ArtifactDraft artifactr.agent

artifactr.__version__ is the installed version.