Artifact Components
Copy page
Learn how to use artifact components to store and retrieve data from the agent
Artifacts are structured components that capture and store source information when agents interact with tools or other agents. They act as a record-keeping system, automatically documenting where information comes from during tool and agent interactions.
How Artifacts Work
When an agent uses a tool (whether that's another agent or a utility tool), the response is automatically parsed to create artifacts. These artifacts store:
- The source of the information (tool/agent used)
- The relevant content from the response
- Metadata about the interaction
Defining Artifact Components
Artifact components are defined when creating an agent using the artifactComponents
property:
The summaryProps
is used in the agent's context. The fullProps
is used to store extra information about the artifact, stored in the database.
Automatic Artifact Creation
When an agent uses a tool or delegates to another agent:
- The tool/agent processes the request and returns a response
- The response is automatically parsed according to the artifact component schema
- An artifact is created containing the parsed information
- The artifact is associated with any data components (facts, clarifying questions, etc.) that use this information
Using Artifacts with Data Components
Artifacts work hand-in-hand with data components to maintain traceability. For example:
- An agent uses a tool to fetch information
- The response is automatically captured as an artifact
- The agent creates a fact component using this information
- The artifact is automatically linked to the fact component
This creates a clear chain of evidence showing where each piece of information originated.
Example Flow
In this example, when the facts_tool
is used:
- The tool returns information
- An artifact is automatically created with the response
- The agent can create fact components using this information
- The facts are automatically linked to their source artifacts