Semantic Kernel vs LangChain

The repo tries to compare Semantic Kernel and LangChain to show the difference and similarity between them.

LangChain Semantic Kernel Note
Chains Kernel Construct sequences of calls
Agents Planner Auto create chains to address novel needs for a user
Tools Plugins (semantic functions + native function) Custom components that can be reused across different apps
Memory Memory Store context and embeddings in memory or other storage

Initial Release Date

LangChain: Oct, 2022

Semantic Kernel: Mar, 2023

Some Numbers

Semantic Kernel: Github Stars Pip Downloads NuGet GitHub contributors

LangChain: Github Stars pip-downloads npm GitHub contributors

Top Contributors

(based on Github contribution chart, ordered by additions instead of commits)

Semantic Kernel: Github contributor insights

Devis Lucato - Principle Architect@MSFT

Lee Miller - Senior Software Engineer@MSFT

Adrian Bonar - Principle Software Engineer@MSFT

Mark Wallace - Principle Software Engineer@MSFT

Shawn Callegari - Principle Software Engineer Lead@MSFT

Roger Barreto - Senior Software Engineer@MSFT

Dmytro Struk - Senior Software Engineer@MSFT

Abby Harrison - Senior Software Engineer@MSFT

LangChain: Github contributor insights

Bagatur Askaryan - Founding Software Engineer@LangChain

Harrison Chase - Cofounder/CEO@LangChain

Erick Friis - Founding Software Engineer@LangChain

Jacob Lee - Founding Software Engineer@LangChain | Langchain.js maintainer

Davis Chase - langchain.js maintainer

Sergerdn

Nuno Campos - Founding Software Engineer@LangChain

Lance Martin - Software Engineer@LangChain

Supported languages

Language LangChain Semantic Kernel
Python
JavaScript
C#
Java

Data connection (Retrieval)

Many LLM applications require user-specific data that is not part of the model's training set. The primary way of accomplishing this is through Retrieval Augmented Generation (RAG). In this process, external data is retrieved and then passed to the LLM when doing the generation step.

Data connection

Building block LangChain Semantic Kernel
Document loaders: Load documents from many different sources Over 100 document loaders: File Loaders (CSV, Docx, EPUB, JSON, PDF, Markdown...) and Web Loaders (Azure Storage, S3, GitHub, Figma...) Web pages, PDF, Images, Word, PowerPoint, Excel, Markdown, Text, JSON (via Kernel Memory)
Document transformers: Split documents, drop redundant documents, and more Multiple Split methods
Text embedding models: Take unstructured text and turn it into a list of floating point numbers Over 25 different embedding providers: OpenAI, Azure OpenAI, Hugging Face, Cohere, Google PaLM, Google Vertex AI, TensorFlow... OpenAI, Azure OpenAI, Hugging Face
Vector stores: Store and search over embedded data Over 50 vector stores - List About 10 vector stores - List
Retrievers: Query your data Simple semantic search, Contextual compression, Time-weighted vector store retriever, Parent Document Retriever, Self Query Retriever, Ensemble Retriever, and more. Simple semantic search

Automatically orchestrate AI

Type LangChain's Agents Semantic Kernel's Planner
Conversational
Plan and execute ✅ (Handlebars Planner)
ReAct ✅ (Stepwise Planner)
Tree of Thoughts (ToT)

Supported Vector Stores

Vector Database LangChain Semantic Kernel
MongoDB Atlas
Chroma
Pinecone
DuckDB
Redis
Sqlite
PGVector
Milvus
Kusto (Azure Data Explorer)
Qdrant
Weaviate
Azure AI Search
Cloudflare Vectorize
SAP HANA Cloud Vector Engine
Supabase
Neo4j Vector Index
Cassandra
Couchbase
LanceDB
RocketSet
Voy
Zep