Skip to main content
artifactr: people and agents editing the same artifacts, every change versioned and attributed.

Docs Nightly Python 3.12, 3.13 and 3.14 Coverage: 100% Typed: pyright strict License: MIT

artifactr is a Python library for chat applications in which people and agents work on the same documents, plans and specs, with every change versioned, attributed and fed back into the agent's context.

Status: alpha, on PyPI. 0.1.0, from its original repository, was the first release, and delivered RFC-0001, the v0.1 plan. The API may still change before 1.0.

Why

In most chat applications the conversation is the only channel. artifactr adds a second: artifacts that live beside the chat and that both sides edit directly. When a person rewrites a paragraph the agent drafted, or the agent restructures a plan, the edit says something about how each side is thinking. So every edit is versioned, attributed to whoever made it, visible to every participant, and told to the agent before it acts.

Install

Python 3.12 or newer. artifactr is on PyPI as artifactr-ai, and imported as artifactr (the name artifactr on PyPI is an unrelated project):

uv add "artifactr-ai[fastapi]"

Extras: fastapi (WebSocket and REST), mcp (external agents), postgres or sqlite (SQL storage with a driver), sql (SQL storage without one), files (native files, artifactr.files), and forms (forms and dashboards in the chat, artifactr.ui).

Example

A person edits a brief, then asks the agent for more. The agent is told about the edit before it starts, and its own edit is recorded the same way:

import asyncio

from pydantic_ai import Agent

from artifactr import (
    ArtifactWorkspace,
    InMemoryStorage,
    MarkdownArtifact,
    Runner,
    Session,
    UserActor,
    Workspaces,
)
from artifactr.core import SetFocus


class Brief(MarkdownArtifact):  # an artifact type: a Pydantic model, registered as "brief"
    pass


agent = Agent(
    "anthropic:claude-sonnet-5-5",
    deps_type=Session[None],
    capabilities=[ArtifactWorkspace(types=[Brief])],  # tools, instructions and change notes
)
runner = Runner(agent, app=None)
workspaces = Workspaces(InMemoryStorage(), types=[Brief])


async def main() -> None:
    alice = UserActor(id="u_alice", name="Alice")
    ws = await workspaces.open("acme", "launch", actor=alice)
    thread = await ws.create_thread("Launch brief")

    await ws.create(Brief(text="# Launch\n\nWe ship on Friday."), artifact_id="brief")
    await ws.commit(SetFocus(thread_id=thread.id, artifact_ids=("brief",)))

    brief = await ws.get(Brief, "brief")
    await ws.commit(brief.edit_text("Friday", "Monday"))  # version 2, by Alice

    sent = await runner.send(ws, thread.id, "Add a risks section to the brief.")
    if sent.run is not None:
        await sent.run.wait()  # the agent is told what Alice changed before it starts

    for envelope in await ws.read():
        print(envelope.seq, envelope.actor.kind, envelope.event.type)


asyncio.run(main())

It needs ANTHROPIC_API_KEY, or any other pydantic-ai model. The log it prints shows Alice's edit, the agent's run, its tool call and its own edit, in order and attributed.

Try it

examples/docplan is a complete application built on the library: a person and an agent co-write a document and plan its work, over WebSocket, REST and MCP, with a terminal client. From the root of a clone of lattice:

make install
export ANTHROPIC_API_KEY=...
uv run docplan-serve            # in one terminal
uv run docplan --user alice     # in another

Set DOCPLAN_DATABASE_URL (for example sqlite+aiosqlite:///docplan.db) to keep its workspaces in a database instead of memory.

What you get

  • Artifact types as Pydantic models. Subclass Artifact; versioning, validation, patches, change summaries and agent tools come from the library.
  • One write path. Every change, from any participant and any surface, is a command committed through a tenant-scoped workspace handle, checked against the artifact's version and appended to the workspace's ordered log.
  • Proposals that don't block. Artifact types can make agents propose instead of edit; people accept, edit or reject whenever they like, and the agent hears the outcome.
  • An agent that follows along. One pydantic-ai capability adds the artifact tools, instructions rendered fresh for every request, notes on what others changed, steering mid-run, and pauses for questions and approvals.
  • Live output apart from history. Token-level output streams to watchers; the log holds only durable facts.
  • Surfaces that behave the same. A WebSocket thread protocol and REST for your frontend, and MCP for external agents, all through one command handler.
  • Storage in memory, SQLite or PostgreSQL, behind one protocol.
  • Rules you can read and port. A pure, synchronous core pinned by language-neutral conformance fixtures, with 100% branch coverage and pyright strict.

Documentation

The documentation is artifactr's section of lattice's site, at https://lattice.alexnodeland.com/artifactr/. It is built from docs/artifactr/ and published from main on every push; run moon run lattice:docs-serve to read it locally at http://localhost:8000.

Built on

Pydantic, pydantic-ai, SQLAlchemy, FastAPI and the MCP Python SDK.

Contributing

See CONTRIBUTING.md for setup, the trunk-based workflow, and the RFC and ADR process.

License

MIT

Metadata

Release files for artifactr-ai 0.4.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 artifactr-ai 0.4.0
File Size Uploaded Provenance Actions
artifactr_ai-0.4.0.tar.gz 393.2 kB With provenance Details for artifactr_ai-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for artifactr-ai 0.4.0
File Interpreter ABI Platform Actions
artifactr_ai-0.4.0-py3-none-any.whl Python 3 none any Details for artifactr_ai-0.4.0-py3-none-any.whl

Total release size: 893.4 kB

Release files / artifactr_ai-0.4.0.tar.gz

Download URL artifactr_ai-0.4.0.tar.gz
Size 393.2 kB
Tags Source
SHA-256 checksum
How to use checksums
24cda7c93efac6c6c7f6f375a43d21e748420d55ad746b07821da61c12d55412
BLAKE2b-256 checksum
How to use checksums
469f3cde39f8ea2480c4bc956a2d56988703f7380eb19083be726184964571db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / artifactr_ai-0.4.0-py3-none-any.whl

Download URL artifactr_ai-0.4.0-py3-none-any.whl
Size 500.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
464d7ca15701f4a3e4c982ba365eb98825d963e7547415e94b995e4edbcd166f
BLAKE2b-256 checksum
How to use checksums
09910d6844939d9222f3f44d0cfc03901c51ccfc5829e6bfe93d3e8279976241
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for artifactr-ai 0.4.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for artifactr_ai-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

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.

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