refactor: Complete migration from Semantic Kernel to LangChain framework#5
Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Open
Conversation
- Replace semantic-kernel dependency with langchain ecosystem packages - Migrate core framework: KernelBuilder → ChainBuilder, @kernel_function → @tool - Convert agent execution from ChatCompletionAgent to AgentExecutor/Chain patterns - Update chat completion factories to use LangChain providers - Migrate plugin system from Semantic Kernel to LangChain tools - Replace ChatHistory with BaseChatMessageHistory/InMemoryChatMessageHistory - Update all orchestrator components and demo configurations - Maintain API contract compatibility and external interface consistency - All 162 tests passing with new LangChain implementation - Zero lint errors remaining after comprehensive code cleanup Migration scope: - src/sk-agents/: Core agent framework and utilities - src/orchestrators/: All orchestrator examples and plugins - shared/ska_utils/: Shared utility components - tests/: Complete test suite updated for LangChain patterns Technical mappings: - semantic_kernel.kernel.Kernel → LangChain Chain composition - @kernel_function → @tool decorator - ChatCompletionAgent → AgentExecutor - ChatHistory → BaseChatMessageHistory - KernelBaseModel → Standard Pydantic BaseModel - Plugin execution → Tool invocation patterns Co-Authored-By: michael.turnbach@merck.com <michael.turnbach@merck.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Convert all demo configs from apiVersion: skagents/v1 to langchain/v1 - Update University agent config to use LangChain AgentExecutor pattern - Migrate plugin references and model configurations - Maintain compatibility with existing input/output types - Complete configuration schema migration across all demos Co-Authored-By: michael.turnbach@merck.com <michael.turnbach@merck.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.
Description
This PR delivers a comprehensive migration of the entire Teal Agents repository from Semantic Kernel to LangChain framework. The migration preserves functional parity while adopting LangChain's architectural patterns and best practices for agent development. All existing tests pass with the new implementation.
Changes
Core Framework Migration:
semantic-kernel==1.33.0with LangChain ecosystem packages (langchain,langchain-openai,langchain-community,langserve)KernelBuildertoChainBuilderusing LangChain chain compositionChatCompletionAgenttoAgentExecutor/ChainpatternsChatHistoryto use LangChain'sBaseChatMessageHistoryPlugin System Migration:
@kernel_functiondecorators to LangChain@tooldecoratorsIntegration & Services:
Testing & Quality:
Type of Change
Human Review Checklist
Additional Comments
This migration represents a significant architectural shift while maintaining functional parity. The key technical mappings implemented:
semantic_kernel.kernel.Kernel→ LangChainChaincomposition@kernel_function→@tooldecoratorChatCompletionAgent→ LangChainAgentExecutorChatHistory→ LangChainBaseChatMessageHistoryKernelBaseModel→ Standard PydanticBaseModelLink to Devin run: https://app.devin.ai/sessions/1f2f4889f09e42028180bdc02dbccbea
Requested by: michael.turnbach@merck.com