[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FCWH3PD3ZB4X6JDNS0WPV5":3,"skill-same:01M6FCWH3PD3ZB4X6JDNS0WPV5":55},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":28,"linkOnly":29,"markdownContent":30,"markdownBody":30,"frontMatter":31,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":35,"repositoryHtmlUrl":36,"repositoryHomepageUrl":37,"ownerHtmlUrl":38,"ownerBlogUrl":6,"ownerDescription":39,"updatedAt":40,"install":41,"resources":54},"01M6FCWH3PD3ZB4X6JDNS0WPV5","azure-ai-agents-persistent-java",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fazure-ai-agents-persistent-java\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[23,24,25,26,27],"ai agents","azure ai","azure","azure ai agents persistent java","java","2026-11-10 10:12:30",false,"# Azure AI Agents Persistent SDK for Java\n\nLow-level SDK for creating and managing persistent AI agents with threads, messages, runs, and tools.\n\n## Installation\n\n```xml\n\u003Cdependency>\n    \u003CgroupId>com.azure\u003C\u002FgroupId>\n    \u003CartifactId>azure-ai-agents-persistent\u003C\u002FartifactId>\n    \u003Cversion>1.0.0-beta.1\u003C\u002Fversion>\n\u003C\u002Fdependency>\n```\n\n## Environment Variables\n\n```bash\nPROJECT_ENDPOINT=https:\u002F\u002F\u003Cresource>.services.ai.azure.com\u002Fapi\u002Fprojects\u002F\u003Cproject>\nMODEL_DEPLOYMENT_NAME=gpt-4o-mini\n```\n\n## Authentication\n\n```java\nimport com.azure.ai.agents.persistent.PersistentAgentsClient;\nimport com.azure.ai.agents.persistent.PersistentAgentsClientBuilder;\nimport com.azure.identity.DefaultAzureCredentialBuilder;\n\nString endpoint = System.getenv(\"PROJECT_ENDPOINT\");\nPersistentAgentsClient client = new PersistentAgentsClientBuilder()\n    .endpoint(endpoint)\n    .credential(new DefaultAzureCredentialBuilder().build())\n    .buildClient();\n```\n\n## Key Concepts\n\nThe Azure AI Agents Persistent SDK provides a low-level API for managing persistent agents that can be reused across sessions.\n\n### Client Hierarchy\n\n| Client | Purpose |\n|--------|---------|\n| `PersistentAgentsClient` | Sync client for agent operations |\n| `PersistentAgentsAsyncClient` | Async client for agent operations |\n\n## Core Workflow\n\n### 1. Create Agent\n\n```java\n\u002F\u002F Create agent with tools\nPersistentAgent agent = client.createAgent(\n    modelDeploymentName,\n    \"Math Tutor\",\n    \"You are a personal math tutor.\"\n);\n```\n\n### 2. Create Thread\n\n```java\nPersistentAgentThread thread = client.createThread();\n```\n\n### 3. Add Message\n\n```java\nclient.createMessage(\n    thread.getId(),\n    MessageRole.USER,\n    \"I need help with equations.\"\n);\n```\n\n### 4. Run Agent\n\n```java\nThreadRun run = client.createRun(thread.getId(), agent.getId());\n\n\u002F\u002F Poll for completion\nwhile (run.getStatus() == RunStatus.QUEUED || run.getStatus() == RunStatus.IN_PROGRESS) {\n    Thread.sleep(500);\n    run = client.getRun(thread.getId(), run.getId());\n}\n```\n\n### 5. Get Response\n\n```java\nPagedIterable\u003CPersistentThreadMessage> messages = client.listMessages(thread.getId());\nfor (PersistentThreadMessage message : messages) {\n    System.out.println(message.getRole() + \": \" + message.getContent());\n}\n```\n\n### 6. Cleanup\n\n```java\nclient.deleteThread(thread.getId());\nclient.deleteAgent(agent.getId());\n```\n\n## Best Practices\n\n1. **Use DefaultAzureCredential** for production authentication\n2. **Poll with appropriate delays** — 500ms recommended between status checks\n3. **Clean up resources** — Delete threads and agents when done\n4. **Handle all run statuses** — Check for RequiresAction, Failed, Cancelled\n5. **Use async client** for better throughput in high-concurrency scenarios\n\n## Error Handling\n\n```java\nimport com.azure.core.exception.HttpResponseException;\n\ntry {\n    PersistentAgent agent = client.createAgent(modelName, name, instructions);\n} catch (HttpResponseException e) {\n    System.err.println(\"Error: \" + e.getResponse().getStatusCode() + \" - \" + e.getMessage());\n}\n```\n\n## Reference Links\n\n| Resource | URL |\n|----------|-----|\n| Maven Package | https:\u002F\u002Fcentral.sonatype.com\u002Fartifact\u002Fcom.azure\u002Fazure-ai-agents-persistent |\n| GitHub Source | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-java\u002Ftree\u002Fmain\u002Fsdk\u002Fai\u002Fazure-ai-agents-persistent |\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fmicrosoft\u002Fskills\u002Fazure-ai-agents-persistent-java",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill azure-ai-agents-persistent-java",{"tool":47,"command":48},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill azure-ai-agents-persistent-java",{"tool":50,"command":51},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill azure-ai-agents-persistent-java","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fazure-ai-agents-persistent-java\u002FSKILL.md",true,[],[56,66,76,85,91,98],{"skillNo":57,"name":58,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":62,"publishedAt":28},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[61],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[63,64,65],"model","model hierarchy","model hierarchy skill",{"skillNo":67,"name":68,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":72,"publishedAt":28},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[71],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[73,74,75],"MCP","zoom","zoom mcp",{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":28},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[82,83,84,74],"sdk","zoom apps sdk","apps",{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":28},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[87],{"skillNo":92,"name":93,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":97,"publishedAt":28},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[96],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[93],{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":28},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[100]]