Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/formulahendry/semantic-kernel-vs-langchain
Compare Semantic Kernel and LangChain
https://github.com/formulahendry/semantic-kernel-vs-langchain
Last synced: 6 days ago
JSON representation
Compare Semantic Kernel and LangChain
- Host: GitHub
- URL: https://github.com/formulahendry/semantic-kernel-vs-langchain
- Owner: formulahendry
- Created: 2023-08-22T07:36:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-20T21:32:45.000Z (8 months ago)
- Last Synced: 2024-10-20T08:56:56.916Z (about 2 months ago)
- Size: 709 KB
- Stars: 101
- Watchers: 9
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-semantickernel - Semantic Kernel vs LangChain
README
# 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, 2022Semantic Kernel: Mar, 2023
## Some Numbers
Semantic Kernel: [![NuGet](https://img.shields.io/nuget/dt/Microsoft.SemanticKernel?label=Nuget-downloads)](https://www.nuget.org/packages/Microsoft.SemanticKernel) [![Pip Downloads](https://static.pepy.tech/badge/semantic-kernel)](https://pepy.tech/project/semantic-kernel)LangChain: [![Downloads](https://static.pepy.tech/badge/langchain)](https://pepy.tech/project/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](./images/data_connection.jpg)
| Building block | LangChain | Semantic Kernel |
| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------- |
| Document loaders: Load documents from many different sources | Over 100 document loaders: [File Loaders](https://js.langchain.com/docs/modules/data_connection/document_loaders/integrations/file_loaders/) (CSV, Docx, EPUB, JSON, PDF, Markdown...) and [Web Loaders](https://js.langchain.com/docs/modules/data_connection/document_loaders/integrations/web_loaders/) (Azure Storage, S3, GitHub, Figma...) | Word |
| 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 | About 10 vector stores |
| 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 | ✅ | ✅ (SequentialPlanner) |
| ReAct | ✅ | ✅ (StepwisePlanner) |
| Tree of Thoughts (ToT) | ✅ | ❌ |