<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mykhailo Galushko on Medium]]></title>
        <description><![CDATA[Stories by Mykhailo Galushko on Medium]]></description>
        <link>https://medium.com/@mykhailogalushko?source=rss-dd3da6427317------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*vRkuJaIA3iCi8L5b.jpg</url>
            <title>Stories by Mykhailo Galushko on Medium</title>
            <link>https://medium.com/@mykhailogalushko?source=rss-dd3da6427317------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 04:22:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mykhailogalushko/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Semantic Kernel: empower your LLM apps]]></title>
            <link>https://medium.com/devrain/semantic-kernel-empower-your-llm-apps-51d8d488cf84?source=rss-dd3da6427317------2</link>
            <guid isPermaLink="false">https://medium.com/p/51d8d488cf84</guid>
            <category><![CDATA[semantic-kernel]]></category>
            <category><![CDATA[langchain]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Mykhailo Galushko]]></dc:creator>
            <pubDate>Sat, 17 Jun 2023 11:40:57 GMT</pubDate>
            <atom:updated>2023-06-18T11:02:07.860Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is Semantic Kernel?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vZY92QOf6gmCuxG800ngGw.png" /><figcaption>Semantic Kernel flow</figcaption></figure><p><strong>Semantic Kernel (SK)</strong> is an innovative and lightweight software development kit (SDK) that facilitates the integration of AI Large Language Models (LLMs) with conventional programming languages. The SK extensible programming model combines natural language <strong>semantic functions</strong> with traditional code <strong>native functions</strong>, and <strong>embeddings-based memory</strong>. This powerful combination unlocks new potential and adds value to applications with AI.</p><p>The concept of SK has emerged from the need to combine the capabilities of AI Large Language Models (LLMs) with conventional programming languages, without compromising the expressiveness of either. The SK SDK provides developers with a set of tools that allows them to leverage the capabilities of LLMs in their applications, while still being able to write traditional code.</p><p><strong>Why do you need Semantic Kernel?</strong></p><p>The Semantic Kernel platform is the perfect solution for developers looking to integrate AI into their existing applications. With its flexible architecture, SK makes it easy for developers to add new AI features without worrying about managing the underlying infrastructure. By leveraging the power of SK, developers can focus on building out their business logic and creating new features, while the platform takes care of the rest. Whether you’re looking to add natural language processing, computer vision, or other cutting-edge AI capabilities to your application, SK has you covered. It is open-source.</p><p><strong>Key features of Semantic Kernel</strong></p><p>The key features of SK include its extensibility, which allows developers to add new natural language semantic functions to the system; its embeddings-based memory, which enables the system to remember context and relationships between concepts; and its support for chaining, which allows multiple semantic functions to be combined in a single operation.</p><p>Core features:</p><ul><li>Planner: automatically generates and execute complex tasks based on a user’s goals</li><li>Skills/Plugins: custom components that can be reused across different apps</li><li>Memory: store context and embeddings in memory or other storage</li><li>Connectors: out-of-the-box connectors for data sources (like Microsoft Graph)</li><li>Custom functions: custom logic</li><li>Chaining: chaining requests to build a pipeline</li></ul><p>Semantic Kernel supports C# and Python.</p><p><strong>Use cases</strong><br>SK has a lot of use cases and scenarios, like building complex user flows and pipelines powered with LLMs.</p><p>Common use cases:</p><ul><li>Chatbot that allows the organization to query their own data</li><li>Summarization of the documents</li><li>Customer service automation</li></ul><p>The most powerful SK alternative is LangChain (<a href="https://python.langchain.com/en/latest/index.html">Welcome to LangChain — 🦜🔗 LangChain 0.0.194</a>). LangChain has many more integrations and plugins for now. But if you focus on .NET area — Semantic Kernel is a great solution for you to build LLM applications.</p><p><strong>Sample</strong></p><p>Let’s build an app that allows to ask questions to our PDF files. We will use a popular test sample for querying PDF files — <a href="https://bitcoin.org/bitcoin.pdf">bitcoin.pdf</a>.</p><ol><li>Initialize Semantic Kernel</li></ol><pre>var configBuilder = new ConfigurationBuilder()<br> .AddJsonFile(“appsettings.json”, optional: true, reloadOnChange: true)<br> .AddJsonFile(“appsettings.development.json”, optional: true, reloadOnChange: true)<br> .Build();<br><br>//Initialize SK<br>var embeddingOptions = configBuilder.GetSection(&quot;Embedding&quot;).Get&lt;AzureOpenAIOptions&gt;();<br>var completionOptions = configBuilder.GetSection(&quot;Completion&quot;).Get&lt;AzureOpenAIOptions&gt;();<br><br>var kernel = Kernel.Builder<br> .WithAzureTextEmbeddingGenerationService(embeddingOptions.DeploymentId, embeddingOptions.Endpoint,<br> embeddingOptions.Key)<br> .WithAzureChatCompletionService(completionOptions.DeploymentId, completionOptions.Endpoint, completionOptions.Key)<br> .WithMemoryStorage(new VolatileMemoryStore())<br> .Build();</pre><p>2. Parse PDF files and initialize SK memory</p><pre>//Parse PDF files and initialize SK memory<br>var pdfFiles = Directory.GetFiles(Directory.GetCurrentDirectory(), “*.pdf”);<br><br>foreach (var pdfFileName in pdfFiles)<br>{<br>   using var pdfDocument = UglyToad.PdfPig.PdfDocument.Open(pdfFileName);<br>   foreach (var pdfPage in pdfDocument.GetPages())<br>   {<br>      var pageText = ContentOrderTextExtractor.GetText(pdfPage);<br>      var paragraphs = new List&lt;string&gt;();<br><br>      //We need to break long content to smaller pieces<br>      if (pageText.Length &gt; MAX_CONTENT_ITEM_SIZE)<br>      {<br>         var lines = TextChunker.SplitPlainTextLines(pageText, MAX_CONTENT_ITEM_SIZE);<br>         paragraphs = TextChunker.SplitPlainTextParagraphs(lines, MAX_CONTENT_ITEM_SIZE);<br>      }<br>      else<br>      {<br>         paragraphs.Add(pageText);<br>      }<br>      foreach (var paragraph in paragraphs)<br>      {<br>        var id = pdfFileName + pdfPage.Number + paragraphs.IndexOf(paragraph);<br>        await kernel.Memory.SaveInformationAsync(memoryCollectionName, paragraph, id);<br>      }<br>    }<br>}<br><br>kernel.ImportSkill(new TextMemorySkill(), nameof(TextMemorySkill));<br><br>//Initialize skill that will be used for prompt<br><br>var promptTemplate = await File.ReadAllTextAsync(&quot;prompt.txt&quot;);<br><br>kernel.CreateSemanticFunction(promptTemplate,<br>    &quot;Query&quot;,<br>    &quot;QuerySkill&quot;,<br>    maxTokens: 2048);</pre><p>3. Ask question</p><p>Prompt:</p><pre>{{textmemoryskill.recall $input}}<br> — -<br>You are an intelligent assistant helping Contoso Inc employee.<br>Use ‘you’ to refer to the individual asking the questions even if they ask with ‘I’.<br>Answer the following question using only the data provided in the sources below.<br>If you cannot answer using the sources below, say you don’t know.<br><br>Question: {{$input}}</pre><pre>var query = “How is the work by \”R.C. Merkle\” used in this paper?”;<br><br>//Set memory for query<br>var contextVariables = new ContextVariables(query);<br>contextVariables.Set(&quot;collection&quot;, memoryCollectionName);<br><br>var result = await kernel.RunAsync(contextVariables, kernel.Skills.GetFunction(&quot;QuerySkill&quot;, &quot;Query&quot;));<br><br>if (result.ErrorOccurred)<br>{<br>   Console.WriteLine($&quot;Error: {result.LastErrorDescription}&quot;);<br>}<br>else<br>{<br>   Console.WriteLine(result.Result);<br>}</pre><p>4. Response</p><pre>The work by R.C. Merkle is referenced in the paper as “Protocols for public key cryptosystems” <br>and is mentioned as a source in the list of references. <br>However, it is not specified how it is used in the paper.</pre><p>Potential improvements:</p><ul><li>Store SK memory in DB: <a href="https://learn.microsoft.com/en-us/semantic-kernel/memories/vector-db">Vector Database | Microsoft Learn</a></li><li>Improve document parsing to handle complex structures (tables, images etc) with services like Form Recognizer (<a href="https://azure.microsoft.com/en-us/products/form-recognizer/">Form Recognizer — Automated Data Processing Systems | Microsoft Azure</a>).</li></ul><p>Source code: <a href="https://github.com/DevRainSolutions/semantic-kernel-chat-demo">DevRainSolutions/semantic-kernel-chat-demo (github.com)</a></p><p><strong>Resources</strong></p><ul><li>Github: <a href="https://github.com/microsoft/semantic-kernel">semantic-kernel</a></li><li>LinkedIn Learning (free): <a href="https://www.linkedin.com/learning/building-skills-with-semantic-kernel/building-skills">https://www.linkedin.com/learning/building-skills-with-semantic-kernel/building-skills</a></li><li>Microsoft DevBlogs: <a href="https://devblogs.microsoft.com/semantic-kernel/">Semantic Kernel | The latest news from the Semantic Kernel team for developers (microsoft.com)</a></li><li>Microsoft Docs: <a href="https://learn.microsoft.com/en-us/semantic-kernel/overview/">What is Semantic Kernel? | Microsoft Learn</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51d8d488cf84" width="1" height="1" alt=""><hr><p><a href="https://medium.com/devrain/semantic-kernel-empower-your-llm-apps-51d8d488cf84">Semantic Kernel: empower your LLM apps</a> was originally published in <a href="https://medium.com/devrain">The DevRain Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>