├── images
└── data_connection.jpg
└── README.md
/images/data_connection.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/formulahendry/semantic-kernel-vs-langchain/HEAD/images/data_connection.jpg
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Semantic Kernel vs LangChain
2 |
3 | The repo tries to compare Semantic Kernel and LangChain to show the difference and similarity between them.
4 |
5 | | LangChain | Semantic Kernel | Note |
6 | | --------- | ---------------------------------------------- | ---------------------------------------------------------- |
7 | | Chains | Kernel | Construct sequences of calls |
8 | | Agents | Planner | Auto create chains to address novel needs for a user |
9 | | Tools | Plugins (semantic functions + native function) | Custom components that can be reused across different apps |
10 | | Memory | Memory | Store context and embeddings in memory or other storage |
11 |
12 | ## Initial Release Date
13 | LangChain: Oct, 2022
14 |
15 | Semantic Kernel: Mar, 2023
16 |
17 | ## Some Numbers
18 | Semantic Kernel:
[](https://www.nuget.org/packages/Microsoft.SemanticKernel) [](https://pepy.tech/project/semantic-kernel)
19 |
20 | LangChain:
[](https://pepy.tech/project/langchain)
21 |
22 |
23 | ## Supported languages
24 |
25 | | Language | LangChain | Semantic Kernel |
26 | | ---------- | --------- | --------------- |
27 | | Python | ✅ | ✅ |
28 | | JavaScript | ✅ | ❌ |
29 | | C# | ❌ | ✅ |
30 | | Java | ✅ | ✅ |
31 |
32 | ## Data connection (Retrieval)
33 |
34 | 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.
35 |
36 | 
37 |
38 | | Building block | LangChain | Semantic Kernel |
39 | | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------- |
40 | | 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 |
41 | | Document transformers: Split documents, drop redundant documents, and more | Multiple Split methods | ❌ |
42 | | 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 |
43 | | Vector stores: Store and search over embedded data | Over 50 vector stores | About 10 vector stores |
44 | | 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 |
45 |
46 |
47 | ## Automatically orchestrate AI
48 |
49 | | Type | LangChain's Agents | Semantic Kernel's Planner |
50 | | ---------------------- | ------------------ | ------------------------- |
51 | | Conversational | ✅ | ❌ |
52 | | Plan and execute | ✅ | ✅ (SequentialPlanner) |
53 | | ReAct | ✅ | ✅ (StepwisePlanner) |
54 | | Tree of Thoughts (ToT) | ✅ | ❌ |
55 |
--------------------------------------------------------------------------------