OpenAIEmbeddingSample
An example that shows how to use Semantic Kernel and Kernel Memory to work with embeddings in a .NET application using SQL Server as Vector Database.
Install / Use
/learn @marcominerva/OpenAIEmbeddingSampleREADME
OpenAI Embeddings Sample
An example that shows how to use Semantic Kernel and Kernel Memory to work with embeddings in a .NET application using SQL Server as Vector Database.
The embeddings are stored in a SQL Server database and the Vector Search is efficiently performed thanks to COLUMNSTORE indexes.
To execute the application:
- Create a database in SQL Server
- Open the AppCostants.cs file and set the connection string to the database and the other required parameters. This example assumes you're using Azure OpenAI, but you can easily update it to use OpenAI or whatever LLM you want. Take a look to Kernel and KernelMemoryBuilder configurations in the Program.cs file
- Import some documents into the memory (search for
await kernelMemory.ImportDocumentAsyncin the Program.cs file
Refer to Program.cs to see how document chunking is performed and how embeddings are calculated, stored and retrieved from the database using Kernel Memory.
If you want to see a manual (explicit) approach to embedding and Vector Search using SQL Server, refer to the manual-approach branch.
Related Skills
feishu-drive
339.5k|
things-mac
339.5kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
339.5kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
yu-ai-agent
2.0k编程导航 2025 年 AI 开发实战新项目,基于 Spring Boot 3 + Java 21 + Spring AI 构建 AI 恋爱大师应用和 ReAct 模式自主规划智能体YuManus,覆盖 AI 大模型接入、Spring AI 核心特性、Prompt 工程和优化、RAG 检索增强、向量数据库、Tool Calling 工具调用、MCP 模型上下文协议、AI Agent 开发(Manas Java 实现)、Cursor AI 工具等核心知识。用一套教程将程序员必知必会的 AI 技术一网打尽,帮你成为 AI 时代企业的香饽饽,给你的简历和求职大幅增加竞争力。
