--- id: azure-ai-agentserver-core version: "2.0.0" license: MIT license_treatment: permissive maintenance: active --- # azure-ai-agentserver-core — Foundation utilities and host framework for Azure AI Hosted Agents License: permissive · Maintenance: active · Downloads: 813.1K/mo ## What it is and what it does Azure AI Agent Server Core is a Python framework for hosting containerized Azure AI agents. It abstracts away the operational plumbing — HTTP serving via Hypercorn on a configurable port, health readiness probes, graceful shutdown with request draining, and automatic OpenTelemetry tracing with Azure Monitor and OTLP export — so that protocol-specific packages can focus on endpoint logic. You subclass AgentServerHost, add your routes, and call run(). The package includes a durable state store (FoundryStateStore) for persisting agent session memory and per-user state, a @task decorator for building crash-resilient long-running agents that survive container restarts, and request context utilities for multi-user sessions that partition state by user ID while forwarding only the opaque call ID on outbound Foundry calls. Configuration is driven by environment variables (PORT, FOUNDRY_AGENT_NAME, APPLICATIONINSIGHTS_CONNECTION_STRING, OTEL_EXPORTER_OTLP_ENDPOINT, etc.), making it container-friendly. Use it for: - Build a containerized agent that handles HTTP requests, exports traces to Azure Monitor, and serves on a configurable port with health probes. - Implement multi-user agent sessions where each request carries user identity and call context, with state partitioned per user. - Create a crash-resilient agent using the @task decorator that persists state across container restarts and redeployments. - Set up graceful shutdown for an agent container that drains in-flight requests before exiting with a default 30 s timeout. - Store agent session memory, conversation checkpoints, and per-user preferences in a durable state store with optimistic concurrency. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides the host framework and infrastructure for building Azure AI Hosted Agent containers, handling health probes, graceful shutdown, OpenTelemetry tracing, and ASGI serving. Yes. The package is actively maintained (released 8 days ago), has low install friction, carries a permissive MIT license, and solves a concrete problem — hosting Azure AI agents with production-grade infrastructure (tracing, graceful shutdown, health probes, state persistence) built in. It's in the top 5000 PyPI packages by download volume. Install it if you are building agents for Azure Foundry or need a structured ASGI host with OpenTelemetry and graceful shutdown. ## Install pip install azure-ai-agentserver-core uv add azure-ai-agentserver-core poetry add azure-ai-agentserver-core ## Installing azure-ai-agentserver-core Before you install: Low install friction with a pure-Python wheel. Active maintenance — released 8 days ago with recent commits. Requires Python 3.10 or later and brings 9 runtime dependencies including starlette, hypercorn, and OpenTelemetry libraries. License in practice: MIT license (permissive) — you can use, modify, and distribute this package freely with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: pip install azure-ai-agentserver-core from azure.ai.agentserver.core import AgentServerHost from starlette.responses import JSONResponse from starlette.routing import Route class MyAgent(AgentServerHost): def __init__(self, **kwargs): routes = [Route("/my-endpoint", self._handle, methods=["POST"])] super().__init__(routes=routes, **kwargs) async def _handle(self, request): return JSONResponse({"status": "ok"}) app = MyAgent() app.run() Requires Python 3.10 or later. Optional azure-identity package needed for DefaultAzureCredential; optional gRPC extra for OTLP/gRPC protocol support. Verify before relying: - Whether the state store's optimistic concurrency model and tag-filtered listing cover all common use cases for agent session memory. - Performance characteristics and throughput limits of FoundryStateStore under concurrent multi-user load. - How the @task decorator's crash recovery and resume patterns interact with distributed deployments or container orchestration platforms. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 813.1K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags azure ai agent server framework, asgi host for azure agents, opentelemetry tracing azure, agent container infrastructure, graceful shutdown http server, azure foundry agent hosting, health probe readiness check, azure-sdk, asgi-framework, observability [View on SkillFed](https://skillfed.io/packages/azure-ai-agentserver-core) · [View on PyPI](https://pypi.org/project/azure-ai-agentserver-core/)