MCPcopy Create free account
hub / github.com/MemTensor/MemOS / embedSkillAsync

Method embedSkillAsync

packages/memos-core/src/hub/server.ts:217–229  ·  view source on GitHub ↗
(skillId: string, name: string, description: string, sourceUserId: string, sourceSkillId: string)

Source from the content-addressed store, hash-verified

215 }
216
217 private embedSkillAsync(skillId: string, name: string, description: string, sourceUserId: string, sourceSkillId: string): void {
218 const embedder = this.opts.embedder;
219 if (!embedder) return;
220 const text = `${name}: ${description}`;
221 embedder.embed([text]).then((vectors) => {
222 if (vectors[0]) {
223 this.opts.store.upsertHubSkillEmbedding(skillId, Array.from(vectors[0]), sourceUserId, sourceSkillId);
224 this.opts.log.info(`hub: embedded shared skill ${skillId}`);
225 }
226 }).catch((err) => {
227 this.opts.log.warn(`hub: embedding shared skill failed: ${err}`);
228 });
229 }
230
231 private backfillMemoryEmbeddings(): void {
232 if (!this.opts.embedder) return;

Callers 1

handleMethod · 0.95

Calls 4

embedMethod · 0.65
infoMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected