Azure AI Agents Persistent SDK for Java
Create persistent AI agents with Azure SDK
Build persistent AI agents that maintain state across sessions. This SDK provides low-level control over agent threads, messages, and runs in Java applications.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "Azure AI Agents Persistent SDK for Java". Create a math tutor agent that helps students with algebra
Expected outcome:
- Agent 'Math Tutor' created successfully with ID: agent_abc123
- Thread created with ID: thread_xyz789
- Message added to thread
- Run initiated and completed
- Assistant: To solve 2x + 5 = 15, first subtract 5 from both sides...
Using "Azure AI Agents Persistent SDK for Java". Execute code to solve a quadratic equation
Expected outcome:
- Run status: RequiresAction
- Tool call: code_interpreter
- Code executed: numpy.roots([1, -5, 6])
- Assistant: The solutions are x = 2 and x = 3
Security Audit
SafeStatic analysis scanned 0 files with 0 lines. Risk score: 0/100. This skill contains only documentation (SKILL.md) describing the Azure AI Agents Persistent SDK for Java. No executable code, scripts, or security-sensitive patterns detected. The documentation describes standard Azure authentication patterns using DefaultAzureCredential which is the recommended secure approach.
Quality Score
What You Can Build
Customer Support Agent Integration
Embed a persistent support agent in your Java backend that maintains conversation history across customer sessions.
Educational Tutoring System
Build a personalized tutoring agent that tracks student progress and adapts teaching style over multiple sessions.
Enterprise Assistant Workflow
Create reusable agent instances for common enterprise tasks like document processing or data analysis.
Try These Prompts
Help me create a basic Azure AI persistent agent using Java. Show me how to set up authentication with DefaultAzureCredential, create an agent with custom instructions, and send a simple message.
Show me how to build a multi-turn conversation flow with Azure AI persistent agents. Include thread creation, adding messages, running the agent, polling for completion, and retrieving all messages from the thread.
I need to create an Azure AI agent that uses custom tools. Show me how to define tools, attach them to an agent, handle the RequiresAction status, and submit tool outputs back to the run.
Create a complete production-ready example of Azure AI persistent agents in Java. Include proper error handling for all run statuses, async client usage for high throughput, resource cleanup in finally blocks, and environment-based configuration.
Best Practices
- Use DefaultAzureCredential for secure production authentication instead of hardcoded keys
- Implement proper polling delays (500ms recommended) between run status checks to avoid rate limiting
- Always clean up resources by deleting threads and agents when no longer needed
Avoid
- Skipping polling between run status checks which causes missed state transitions
- Hardcoding credentials instead of using environment variables and Azure managed identities
- Not handling all run statuses (RequiresAction, Failed, Cancelled) leading to stuck workflows