Artifacts
Troubleshooting
Common issues and quick fixes for artifact usage
"Artifact service is not initialized"
Ensure your Runner is constructed with an artifactService.
import { Runner, InMemoryArtifactService, InMemorySessionService } from '@iqai/adk';
const runner = new Runner({
appName: 'my_app',
agent,
sessionService: new InMemorySessionService(),
artifactService: new InMemoryArtifactService(),
});Auto-save not working
- Set
withRunConfig({ saveInputBlobsAsArtifacts: true })on your agent builder, or passRunConfigper run - Confirm incoming message parts use
inlineDatawith base64dataand correctmimeType
GCS permission/auth failures
- Verify ADC or service account credentials are available
- Check IAM roles: reader/writer on the bucket for your principal
MIME/base64 pitfalls
inlineData.datamust be a base64 string, not raw bytes- Always set an accurate
mimeType(e.g.,application/json,image/png)
Loading returns null/undefined
- If the artifact or version doesn’t exist,
loadArtifactreturns no value - Handle the nullish result before decoding the data
const art = await ctx.loadArtifact('maybe_exists.txt');
if (!art) return { error: 'not found' };
const text = Buffer.from(art.inlineData.data, 'base64').toString('utf-8');How is this guide?