Add Python LangChain sample agent#270
Open
Yogeshp-MSFT wants to merge 6 commits intomicrosoft:mainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new Python sample agent demonstrating how to host a LangChain/LangGraph “ReAct” agent on the Microsoft Agent 365 SDK, including MCP tool discovery, auth flows, and observability patterns.
Changes:
- Introduces a runnable aiohttp-hosted agent app with Teams-friendly UX (ack + typing loop) and notification handlers.
- Adds MCP tool discovery/registration via
langchain-mcp-adaptersand A365 tooling services. - Adds project scaffolding (pyproject, env template, manifest, README) for local dev and Azure deployment.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| python/langchain/sample-agent/pyproject.toml | Defines dependencies and uv/setuptools configuration for the sample. |
| python/langchain/sample-agent/mcp_tool_registration_service.py | Implements MCP server discovery and tool registration for LangChain. |
| python/langchain/sample-agent/main.py | Boots the aiohttp server, configures optional JWT auth, enables observability. |
| python/langchain/sample-agent/hosting.py | Implements AgentApplication handlers (messages, typing loop, notifications). |
| python/langchain/sample-agent/agent_interface.py | Defines the async interface the hosted agent must implement. |
| python/langchain/sample-agent/agent.py | Creates the LLM client, loads MCP tools, invokes LangGraph ReAct agent, sets baggage. |
| python/langchain/sample-agent/ToolingManifest.json | Provides MCP server definitions for Mail and Calendar tools. |
| python/langchain/sample-agent/README.md | Documents setup, configuration, local testing, and deployment. |
| python/langchain/sample-agent/.gitignore | Ignores local secrets, build outputs, and A365 generated artifacts. |
| python/langchain/sample-agent/.env.template | Provides a starting environment configuration for local/prod scenarios. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a Python sample agent using LangChain/LangGraph with the Microsoft Agent 365 SDK, following existing Python sample patterns.
Files:
python/langchain/sample-agent/— main.py, hosting.py, agent.py,agent_interface.py,mcp_tool_registration_service.py, pyproject.toml, .env.template,ToolingManifest.json, README.mdHighlights:
create_react_agentwith MCP tools (Mail + Calendar) vialangchain-mcp-adapters/v1), and plain OpenAIBaggageBuilderTested: Locally with Agents Playground + deployed on Azure App Service + Teams.