Interface Artifact
- All Known Implementing Classes:
AbstractArtifact, ArtifactThinkerOutput, BioRxivFetchOutput.DetailedPreprint, BioRxivSearchOutput.BioRxivPreprint, CitationArtifact, CodeArtifact, Document, FileEntry, Folder, LinkArtifact, ListArtifact, MCPArtifact, OrderRecord, PatentArtifact, PatentFullContentArtifact, PersonArtifact, PMCArticle, PubMedFetchOutput.DetailedArticle, PubMedSearchOutput.PubMedArticle, Statement, WebPageArtifact
public interface Artifact
Marker interface for domain entities that can be preserved as artifacts
across multi-agent workflows.
When an entity implements Artifact, the framework will:
- Automatically detect it during serialization to LLM
- Generate a unique artifact reference (e.g., «artifact:link:cite~a1b2c3»)
- Store the full object in the agent's ephemeral registry
- Replace the object with its reference in LLM communications
- Allow agents to reference the artifact without regurgitating details
This solves the "broken telephone" problem in multi-agent hierarchies where domain objects get corrupted as they pass through multiple LLM transformations.
Concrete implementations should extend AbstractArtifact which provides
the artifactRef field and associated logic.
- Since:
- 0.1 (2025-11-13)
- Author:
- Andrey Santrosyan
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidcacheSummary(String fieldName, SummarizedField value) Caches a summary for a field.Gets the artifact reference string, or null if not yet assigned.getCachedSummary(String fieldName) Gets a previously cached summary for a field, or null if not cached.voidsetArtifactRef(String ref) Sets the artifact reference string.
-
Method Details
-
getCachedSummary
Gets a previously cached summary for a field, or null if not cached. Used by the Jackson serializer to avoid re-summarizing on repeated serializations.- Parameters:
fieldName- the snake_case field name- Returns:
- the cached SummarizedField, or null
-
cacheSummary
Caches a summary for a field. Called by the Jackson serializer after generating a summary so subsequent serializations skip the Summarizer.- Parameters:
fieldName- the snake_case field namevalue- the SummarizedField containing both full text and summary
-
getArtifactRef
String getArtifactRef()Gets the artifact reference string, or null if not yet assigned.- Returns:
- the artifact reference in the canonical format «artifact:type~uuid», or null
-
setArtifactRef
Sets the artifact reference string.- Parameters:
ref- the artifact reference
-