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

Method process

packages/memos-core/src/skill/evolver.ts:89–115  ·  view source on GitHub ↗
(task: Task)

Source from the content-addressed store, hash-verified

87 }
88
89 private async process(task: Task): Promise<void> {
90 const chunks = this.store.getChunksByTask(task.id);
91
92 const { pass, skipReason } = this.evaluator.passesRuleFilter(chunks, task);
93 if (!pass) {
94 this.ctx.log.debug(`SkillEvolver: task ${task.id} skipped by rule filter: ${skipReason} (chunks=${chunks.length})`);
95 this.store.setTaskSkillMeta(task.id, { skillStatus: "skipped", skillReason: skipReason });
96 return;
97 }
98
99 const preferUpgrade = this.ctx.config.skillEvolution?.preferUpgradeExisting ?? DEFAULTS.skillPreferUpgrade;
100 const relatedSkill = await this.findRelatedSkill(task);
101
102 if (relatedSkill) {
103 await this.handleExistingSkill(task, chunks, relatedSkill);
104 } else if (preferUpgrade) {
105 const nameCandidate = await this.findSkillByNameSimilarity(task);
106 if (nameCandidate) {
107 this.ctx.log.info(`SkillEvolver: preferUpgrade found name-similar skill "${nameCandidate.name}" for task "${task.title}"`);
108 await this.handleExistingSkill(task, chunks, nameCandidate);
109 } else {
110 await this.handleNewSkill(task, chunks);
111 }
112 } else {
113 await this.handleNewSkill(task, chunks);
114 }
115 }
116
117 /** Max candidates to send to LLM for relevance judgment. */
118 private static readonly RELATED_SKILL_CANDIDATE_TOP = 10;

Callers 1

processOneMethod · 0.95

Calls 9

findRelatedSkillMethod · 0.95
handleExistingSkillMethod · 0.95
handleNewSkillMethod · 0.95
debugMethod · 0.65
infoMethod · 0.65
getChunksByTaskMethod · 0.45
passesRuleFilterMethod · 0.45
setTaskSkillMetaMethod · 0.45

Tested by

no test coverage detected