-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[ai.agentserver] add azure-ai-agentserver-langgraph package #43804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a comprehensive Azure AI Agent Server implementation with LangGraph integration, consisting of two main packages:
azure-ai-agentserver-core: Core agent server infrastructureazure-ai-agentserver-langgraph: LangGraph adapter for hosting LangGraph agents
Key Changes:
- Added core agent server framework with OpenTelemetry tracing, streaming support, and event-driven architecture
- Implemented LangGraph adapter to convert between LangGraph state and OpenAI-style responses
- Included multiple samples demonstrating different use cases (simple agents, MCP integration, RAG patterns, Redis checkpointing)
Reviewed Changes
Copilot reviewed 108 out of 113 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/ai/ci.yml | Added azure-ai-agentserver-core to CI pipeline |
| sdk/ai/azure-ai-agentserver-langgraph/pyproject.toml | Package configuration with dependencies on LangChain/LangGraph |
| sdk/ai/azure-ai-agentserver-langgraph/azure/ai/agentserver/langgraph/*.py | Core LangGraph adapter implementation with request/response converters |
| sdk/ai/azure-ai-agentserver-langgraph/samples/*/main.py | Sample applications showing various agent patterns |
| sdk/ai/azure-ai-agentserver-langgraph/tests/unit_tests/*.py | Unit tests for request conversion |
| sdk/ai/azure-ai-agentserver-core/azure/ai/agentserver/core/server/base.py | Base agent server with Starlette/Uvicorn |
| sdk/ai/azure-ai-agentserver-core/samples/*/main.py | Custom agent samples (mock, MCP, bilingual planner) |
| sdk/ai/azure-ai-agentserver-core/tests/*.py | Test infrastructure for gated tests |
Comments suppressed due to low confidence (1)
sdk/ai/azure-ai-agentserver-langgraph/samples/agent_calculator/langgraph_agent_calculator.py:1
- The import statement is incorrect. For LangGraph >= 1.0.0, the correct import should be
from langgraph.prebuilt import create_react_agent, notfrom langchain.agents import create_agent. This will cause an ImportError at runtime.
| def calculator(expression: str) -> str: | ||
| """Evaluates mathematical expression""" | ||
| try: | ||
| maths_result = eval(expression) |
Copilot
AI
Nov 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using eval() on user input is a security vulnerability that allows arbitrary code execution. Replace with ast.literal_eval() for safe mathematical expression evaluation, or use a dedicated math parser library like simpleeval or numexpr.
| def calculator(expression: str) -> str: | ||
| """Evaluates mathematical expression""" | ||
| try: | ||
| maths_result = eval(expression) |
Copilot
AI
Nov 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using eval() on user input is a security vulnerability that allows arbitrary code execution. Replace with ast.literal_eval() for safe mathematical expression evaluation, or use a dedicated math parser library like simpleeval or numexpr.
|
|
||
| return create_react_agent(model, tools) | ||
| else: | ||
| from langchain.agents import create_agent |
Copilot
AI
Nov 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import statement is incorrect. For LangGraph >= 1.0.0, the correct import should be from langgraph.prebuilt import create_react_agent, not from langchain.agents import create_agent. This will cause an ImportError at runtime.
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines