前言
在 Semantic Kernel(SK) 可以直接給 Prompt 來執行。
也可以透過 Prompt template
來建立可重覆使用的功能。
Hello! 我是 RM
在前幾篇文章中,從直接使用 MemoryServerless 到將 Kernel Memory 啟動為 Service ,並以 MemoryWebClient
去操作它。
接下來我們將 Embedding DB 改存到 Qdrant 並透過 TextPartitioningOptions
來設定切 Chunks 的 Token 數
在SK-Kernel Memory (KM) 初探透過 KernelMemoryBuilder
來建立 MemoryServerless
,
讓我們將一些檔案進行讀取、切段、轉成 Embeddings,最後存到資料庫。
並可以讓我們詢問問題後,再取回答案。
現在很多企業都在使用 Retrieval Augmented Generation(RAG),
先把各個文件先切一段一段(例如 利用各種 Library 將文件讀進來,再將 200 個字,每段又 overlap 50 個字)轉成 embeddings 再放到 embeddings 資料庫,
這裡會使用到 LLM 的 embeddings model ,例如 text-embedding-ada-002
。
當使用者輸入問題後,同時也將這個問題轉成 embeddings ,再與 embeddings 資料庫找相似度,例如使用 BM25 來比較。
取得相似度高的內容後,再呼叫 GPT-3.5 Turbo
轉成較口語化的回答內容。
這麼多的 Task ,現在可以透過 kernel-memory 來達成,
以下就來看看它有多簡單 ^_^
tag:
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent: meta: false pages: false posts: title: true date: true path: true text: false raw: false content: false slug: false updated: false comments: false link: false permalink: false excerpt: false categories: false tags: true