skills/azure-ai-agents-persistent-java/SKILL.md
Azure AI Agents Persistent SDK for Java. Low-level SDK for creating and managing AI agents with threads, messages, runs, and tools.
npx skillsauth add Regtransfers/agency-agents-mcp azure-ai-agents-persistent-javaInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
@ Azure AI Agents Persistent SDK for Java
Low-level SDK for creating and managing persistent AI agents with threads, messages, runs, and tools.
@ Installation
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-ai-agents-persistent</artifactId>
<version>1.0.0-beta.1</version>
</dependency>
@ Environment Variables
PROJECT_ENDPOINT=https://<resource>.services.ai.azure.com/api/projects/<project>
MODEL_DEPLOYMENT_NAME=gpt-4o-mini
@ Authentication
import com.azure.ai.agents.persistent.PersistentAgentsClient;
import com.azure.ai.agents.persistent.PersistentAgentsClientBuilder;
import com.azure.identity.DefaultAzureCredentialBuilder;
String endpoint = System.getenv("PROJECT_ENDPOINT");
PersistentAgentsClient client = new PersistentAgentsClientBuilder()
.endpoint(endpoint)
.credential(new DefaultAzureCredentialBuilder().build())
.buildClient();
@ Key Concepts
The Azure AI Agents Persistent SDK provides a low-level API for managing persistent agents that can be reused across sessions.
@ Client Hierarchy
Client; Purpose
PersistentAgentsClient; Sync client for agent operations PersistentAgentsAsyncClient; Async client for agent operations
@ Core Workflow
@ 1. Create Agent
// Create agent with tools
PersistentAgent agent = client.createAgent(
modelDeploymentName,
"Math Tutor",
"You are a personal math tutor."
);
@ 2. Create Thread
PersistentAgentThread thread = client.createThread();
@ 3. Add Message
client.createMessage(
thread.getId(),
MessageRole.USER,
"I need help with equations."
);
@ 4. Run Agent
ThreadRun run = client.createRun(thread.getId(), agent.getId());
// Poll for completion
while (run.getStatus() == RunStatus.QUEUED || run.getStatus() == RunStatus.IN_PROGRESS) {
Thread.sleep(500);
run = client.getRun(thread.getId(), run.getId());
}
@ 5. Get Response
PagedIterable<PersistentThreadMessage> messages = client.listMessages(thread.getId());
for (PersistentThreadMessage message : messages) {
System.out.println(message.getRole() + ": " + message.getContent());
}
@ 6. Cleanup
client.deleteThread(thread.getId());
client.deleteAgent(agent.getId());
@ Best Practices
@ Error Handling
import com.azure.core.exception.HttpResponseException;
try {
PersistentAgent agent = client.createAgent(modelName, name, instructions);
} catch (HttpResponseException e) {
System.err.println("Error: " + e.getResponse().getStatusCode() + " - " + e.getMessage());
}
@ Reference Links
Resource; URL
Maven Package; https://central.sonatype.com/artifact/com.azure/azure-ai-agents-persistent GitHub Source; https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-agents-persistent
@ When to Use This skill is applicable to execute the workflow or actions described in the overview.
@ Limitations
tools
Build AI agents that interact with computers like humans do - viewing screens, moving cursors, clicking buttons, and typing text. Covers Anthropic's Computer Use, OpenAI's Operator/CUA, and open-source alternatives.
testing
Generate structured PR descriptions from diffs, add review checklists, risk assessments, and test coverage summaries. Use when the user says "write a PR description", "improve this PR", "summarize my changes", "PR review", "pull request", or asks to document a diff for reviewers.
tools
Use when working with comprehensive review full review
development
You are an expert in creating competitor comparison and alternative pages. Your goal is to build pages that rank for competitive search terms, provide genuine value to evaluators, and position your product effectively.