refactor: optimize core engine and retrieval logic for v2.80.43

This commit is contained in:
2026-05-13 19:23:57 +09:00
parent c4260466b9
commit 089abf22db
17 changed files with 1311 additions and 88 deletions
+16 -1
View File
@@ -45,6 +45,19 @@ export interface IAgentConfig {
maxAutoContinuations: number;
/** 모델이 내부 사고만 출력하고 답변이 없으면 "최종 답변만" 지시로 1회 재생성. */
finalOnlyRetryOnThoughtLeak: boolean;
// ─── Hybrid Semantic Search ───
/**
* Embedding model name as registered in LM Studio / Ollama. Empty disables
* semantic search and the retriever falls back to TF-IDF only. The user
* must load this model in the engine before enabling it here.
*/
embeddingModel: string;
/**
* Blend between TF-IDF (sparse) and embedding cosine (dense) scoring.
* 0 = TF-IDF only (status quo), 1 = embedding only.
* Default 0.5 = equal weight, a reasonable starting point.
*/
embeddingBlendAlpha: number;
}
// ─── 경로 정규화 유틸리티 ───
@@ -125,7 +138,9 @@ export function getConfig(): IAgentConfig {
smallModelContextCap: Math.max(0, cfg.get<number>('smallModelContextCap', 0)),
autoContinueOnOutputLimit: cfg.get<boolean>('autoContinueOnOutputLimit', true),
maxAutoContinuations: Math.max(0, Math.min(10, cfg.get<number>('maxAutoContinuations', 4))),
finalOnlyRetryOnThoughtLeak: cfg.get<boolean>('finalOnlyRetryOnThoughtLeak', true)
finalOnlyRetryOnThoughtLeak: cfg.get<boolean>('finalOnlyRetryOnThoughtLeak', true),
embeddingModel: (cfg.get<string>('embeddingModel', '') || '').trim(),
embeddingBlendAlpha: Math.max(0, Math.min(1, cfg.get<number>('embeddingBlendAlpha', 0.5))),
};
}