Semantic Kernel


Semantic Kernel is an Application Framework (SDK) by Microsoft. It is used to develop many co-pilot software e.g. github co-pilot. Other such frameworks are:

- Semantic Kernel (Microsoft)

- LangChain (Open Source) 

- FIXIE (Enterprise Grade)

- Vertex AI (Google cloud)

- griptape

- HumanLoop

- Beam

=========================================================

Semantic Kernel has (1) skill (2) prompts (3) AI Services (4) Connector (5) Kernel (6) Planner (6) Plugins

Skill is a set of functions. 

The functions are divided in two types

1. Semantic Functions : User defined functions

2. Native Functions: It has core_skills like TextMemory, ConversationSummary, 

FileIO, HTTP, Math, Text, Time, Wait (calendar etc.)

Kerenel class has RunAsync method. It has 1+ SKFunction objects

Prompt has (1) skprompt.txt (2) config.json

AI Services 

  • ChatCompletion
  • Embeddings
  • Embeddings.VectorOperations
  • ImageGenerations
  • TextGenerations

Connector has (1) AI Service Endpoint and (2) Memory

AI Service Endpoint
  • HuggingFace Interface API
  • HuggingFace Local
  • Oobabooga
  • OpenAI
  • OpenAI.Azure
Memory
  • AzureCognitiveSearch
  • Chroma
  • DuckDB
  • Kusto
  • Pinecone
  • Postgress
  • Qdrant
  • Redis
  • Sqlite
  • Weaviate
Kerenel, Planner and Plugins are part of Kernel Orchestration 

Kernel

Kernel decides model, memory (database) and planner. 

We can configure kernel using Configruing Kerel. It has following Runtime Properties
  • AI Service
  • Template Engine
  • Logger
  • Plugins
  • Kernel Config Class
Planner is about 'Plan Object Model' It has following types
  • BasicPlanner: A simplified version of SequentialPlanner that strings together a set of functions.
  • ActionPlanner: Creates a plan with a single step.
  • SequentialPlanner: Creates a plan with a series of steps that are interconnected with custom generated input and output variables.
  • StepwisePlanner: Incrementally performs steps and observes any results before performing the next step.
Plugins are for following usecases
  • MSGraph (C#)
  • Document and Data Loading (only word in C#)
  • OpenAPI (C#)
  • Web Search Engine
  • Text Chunkers
=========================================================

Issues: 

  • The memory is constructed every time during setup. 

https://medium.com/@kcwayne1219/exploring-microsoft-semantic-kernel-a-newbie-developers-journey-902f58091504

  • Loading hugging face model

https://stackoverflow.com/questions/77110608/loading-a-huggingface-model-with-microsofts-semantic-kernel-in-c-sharp-vb-net

https://github.com/microsoft/semantic-kernel/blob/3451a4ebbc9db0d049f48804c12791c681a326cb/samples/apps/hugging-face-http-server/inference_app.py

https://github.com/microsoft/semantic-kernel/blob/3451a4ebbc9db0d049f48804c12791c681a326cb/samples/apps/hugging-face-http-server/utils/create_responses.py

  • Add Support for running local models using Ollama
https://github.com/microsoft/semantic-kernel/actions/runs/6527865286/workflow

Github

https://github.com/microsoft/semantic-kernel/tree/c4ef6ab227fc967ab12291cc862852e66d6d75ae

Documentation

https://github.com/MicrosoftDocs/semantic-kernel-docs/tree/main

Reference 

https://devblogs.microsoft.com/semantic-kernel/page/5/

https://build.microsoft.com/en-US/sessions/31e11443-70d3-4020-8c8c-0a654bccd233

0 comments:

Post a Comment