修改优化
This commit is contained in:
1 parent
f80a00e211
commit
6253a2bca9
4 files changed
+237
-35
No files matched your search
@@ -530,6 +530,15 @@ function MemorySearchPanel() {
|
||||
const { t } = useI18n();
|
||||
const m = t.settings.memory;
|
||||
|
||||
// 检索范围:default 是内置助手,其余是用户的自定义专家 —— 对应
|
||||
// Hindsight 的 work bank deerflow-work-{user}-{agent}。
|
||||
const { agents: allAgents } = useAgents();
|
||||
const experts = useMemo(
|
||||
() => allAgents.filter((a) => !a.builtin),
|
||||
[allAgents],
|
||||
);
|
||||
const [searchAgent, setSearchAgent] = useState("default");
|
||||
|
||||
const [query, setQuery] = useState("");
|
||||
const [mode, setMode] = useState<MemorySearchMode>("recall");
|
||||
const [isSearching, setIsSearching] = useState(false);
|
||||
@@ -542,7 +551,7 @@ function MemorySearchPanel() {
|
||||
if (!q) return;
|
||||
setIsSearching(true);
|
||||
try {
|
||||
const result = await searchMemory(q, mode);
|
||||
const result = await searchMemory(q, mode, searchAgent);
|
||||
setUnavailable(!result.available);
|
||||
setResults(result.results);
|
||||
setReflectText(result.text);
|
||||
@@ -566,6 +575,26 @@ function MemorySearchPanel() {
|
||||
placeholder={m.searchPlaceholder}
|
||||
className="min-w-0 flex-1"
|
||||
/>
|
||||
<div className="flex items-center gap-1">
|
||||
<span className="text-muted-foreground text-sm">
|
||||
{m.workNotesAgentLabel}
|
||||
</span>
|
||||
<Select value={searchAgent} onValueChange={setSearchAgent}>
|
||||
<SelectTrigger className="w-40" size="sm">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="default">
|
||||
{m.workNotesDefaultAgent}
|
||||
</SelectItem>
|
||||
{experts.map((a) => (
|
||||
<SelectItem key={a.id} value={a.id}>
|
||||
{a.name}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
<ToggleGroup
|
||||
type="single"
|
||||
value={mode}
|
||||
|
||||
@@ -361,25 +361,25 @@ export const enUS: Translations = {
|
||||
settingsTitle: "Memory settings",
|
||||
settingsDesc: "Adjust how memory is injected and retrieved. Changes take effect immediately.",
|
||||
injectionEnabled: "Inject memory into conversations",
|
||||
injectionEnabledDesc: "When off, the assistant sees no memory during conversations.",
|
||||
injectionEnabledDesc: "The master switch for memory. When on, the assistant draws on what it remembers about you and past conversations; when off, it sees no memory at all and treats every chat as the first time. The options below only take effect when this is on.",
|
||||
includeBuiltin: "Inject local memory",
|
||||
includeBuiltinDesc: "Inject the user profile and working notes into the system prompt.",
|
||||
includeBuiltinDesc: "Give the assistant locally stored memory as background knowledge: the user profile (your identity, habits and preferences) and work notes (key points the assistant saved while working with you). Kept in local server files — no external service required.",
|
||||
includeHindsight: "Inject Hindsight recall",
|
||||
includeHindsightDesc: "Retrieve and inject relevant memories from Hindsight before each turn.",
|
||||
includeHindsightDesc: "Before each reply, automatically retrieve memories relevant to the current topic from the Hindsight long-term memory store and add them as reference. Requires a deployed, reachable Hindsight service.",
|
||||
maxTokens: "Injection token limit",
|
||||
maxTokensDesc: "Maximum tokens used for memory injection (100–8000).",
|
||||
maxTokensDesc: "How much room injected memory may take up per turn (in tokens). Higher lets the assistant see more memory but leaves less space for the conversation itself. Allowed range 100–8000.",
|
||||
memoryMode: "Hindsight tool mode",
|
||||
memoryModeDesc: "Controls whether Hindsight retrieval tools are exposed to the assistant.",
|
||||
memoryModeContext: "context — auto recall only",
|
||||
memoryModeTools: "tools — tools only",
|
||||
memoryModeHybrid: "hybrid — auto + tools",
|
||||
memoryModeDesc: "How the assistant uses the Hindsight store: automatic background retrieval, an on-demand search tool the assistant calls itself, or both.",
|
||||
memoryModeContext: "context — background auto recall only, no action needed",
|
||||
memoryModeTools: "tools — search tool only, the assistant queries on demand",
|
||||
memoryModeHybrid: "hybrid — background auto recall + search tool, both enabled",
|
||||
recallBudget: "Recall depth",
|
||||
recallBudgetDesc: "How thorough Hindsight retrieval is — higher is slower but more complete.",
|
||||
recallBudgetDesc: "How thorough each Hindsight search is. Higher finds more but is slower and more costly; lower is faster but may miss relevant memories.",
|
||||
recallBudgetLow: "Low",
|
||||
recallBudgetMid: "Mid",
|
||||
recallBudgetHigh: "High",
|
||||
bankMission: "Hindsight reflect mission",
|
||||
bankMissionDesc: "Identity/framing for reflect reasoning; leave empty to use the default.",
|
||||
bankMission: "Hindsight synthesis settings",
|
||||
bankMissionDesc: "For 'reflect' (synthesis) searches, tells Hindsight what role and perspective to take when summarizing memories. Leave empty to use the default.",
|
||||
bankMissionPlaceholder: "e.g. You are the user's long-term assistant, focused on their work preferences.",
|
||||
settingsSaved: "Settings saved",
|
||||
searchTitle: "Hindsight memory search",
|
||||
@@ -566,22 +566,22 @@ export const enUS: Translations = {
|
||||
"Saves to skill_evolution.json and hot-reloads — no restart required.",
|
||||
enabledLabel: "Enable skill evolution",
|
||||
enabledHelper:
|
||||
"When off, the agent cannot create or modify skills under custom/.",
|
||||
"The master switch for skill evolution. When on, the agent gets the skill_manage tool — it can create, modify and delete skills under custom/, and is nudged to offer saving a workflow as a skill after a complex task. When off, those skill-writing abilities are removed and the agent can only view and use existing skills. All curator settings below require this to be on.",
|
||||
curatorEnabledLabel: "Curator runs automatically",
|
||||
curatorEnabledHelper:
|
||||
"When off, the curator only runs when triggered from this page.",
|
||||
"The curator is a background skill librarian that periodically scans your skill library: it flags long-unused skills as stale, then archives them, and uses an LLM to review whether duplicate skills should be merged. When on, it runs automatically on the interval below; when off, it only runs when you click \"Run now\" on this page.",
|
||||
intervalHoursLabel: "Run interval (hours)",
|
||||
intervalHoursHelper:
|
||||
"Minimum hours between automatic curator runs.",
|
||||
"Minimum hours between automatic curator runs. Default 168 (one week). Manual runs are not subject to this limit.",
|
||||
staleAfterDaysLabel: "Stale threshold (days)",
|
||||
staleAfterDaysHelper:
|
||||
"Skills inactive for this many days are flagged stale.",
|
||||
"A skill not used for this many days is flagged stale by the curator. Stale skills are no longer injected into the agent's prompt, but the files are kept — using one again restores it to active.",
|
||||
archiveAfterDaysLabel: "Archive threshold (days)",
|
||||
archiveAfterDaysHelper:
|
||||
"Stale skills inactive for this many additional days are archived.",
|
||||
"A skill idle for this many days since its last use is archived by the curator (counted as total idle days, not added on top of the stale threshold). Archiving is a soft delete — files stay under custom/ and can be restored anytime. Must be greater than the stale threshold.",
|
||||
curatorModelLabel: "Curator review model",
|
||||
curatorModelHelper:
|
||||
"Model for the curator's LLM review and skill security moderation. Defaults to the primary model.",
|
||||
"Model used for the curator's skill review (merge/prune decisions) and skill security moderation. Leave empty to use the primary model.",
|
||||
curatorModelDefault: "Primary model (default)",
|
||||
save: "Save changes",
|
||||
saveSuccess: "Configuration updated",
|
||||
|
||||
@@ -346,25 +346,25 @@ export const zhCN: Translations = {
|
||||
settingsTitle: "记忆设置",
|
||||
settingsDesc: "调整记忆的注入与检索行为。修改即时生效。",
|
||||
injectionEnabled: "注入记忆到对话",
|
||||
injectionEnabledDesc: "关闭后,助手在对话中不会看到任何记忆。",
|
||||
injectionEnabledDesc: "记忆功能的总开关。开启后,助手回答时会参考它记住的关于你的信息和过往对话;关闭后,助手在对话中看不到任何记忆,每次都像第一次和你交流。下面几项都需要此开关开启才会生效。",
|
||||
includeBuiltin: "注入本地记忆",
|
||||
includeBuiltinDesc: "把用户画像和工作笔记注入系统提示词。",
|
||||
includeBuiltinDesc: "把保存在本机的记忆作为背景知识提供给助手,包括「用户画像」(你的身份、习惯、偏好等长期信息)和「工作笔记」(助手在协作中为你记下的要点)。这类记忆存在服务器本地文件里,不依赖任何外部服务。",
|
||||
includeHindsight: "注入 Hindsight 召回",
|
||||
includeHindsightDesc: "每轮对话前从 Hindsight 检索相关记忆并注入。",
|
||||
includeHindsightDesc: "每次回答前,自动从 Hindsight 长期记忆库中检索与当前话题相关的历史记忆,临时补充给助手参考。需要已部署并连通 Hindsight 服务才会生效。",
|
||||
maxTokens: "注入 token 上限",
|
||||
maxTokensDesc: "记忆注入占用的最大 token 数 (100–8000)。",
|
||||
maxTokensDesc: "每次注入的记忆最多占用多少篇幅(单位 token,中文大致相当于字数)。设得越大,助手能看到的记忆越多,但会挤占对话本身的可用空间。可填 100–8000。",
|
||||
memoryMode: "Hindsight 工具模式",
|
||||
memoryModeDesc: "控制是否把 Hindsight 检索工具暴露给助手。",
|
||||
memoryModeContext: "context —— 仅自动召回",
|
||||
memoryModeTools: "tools —— 仅暴露工具",
|
||||
memoryModeHybrid: "hybrid —— 自动 + 工具",
|
||||
memoryModeDesc: "决定助手如何使用 Hindsight 记忆库:由系统在后台自动检索、把检索工具交给助手按需自己调用、或两者都启用。",
|
||||
memoryModeContext: "context —— 仅后台自动召回,助手无需操作",
|
||||
memoryModeTools: "tools —— 仅提供检索工具,由助手按需自己查",
|
||||
memoryModeHybrid: "hybrid —— 后台自动召回 + 检索工具,两者都启用",
|
||||
recallBudget: "召回深度",
|
||||
recallBudgetDesc: "Hindsight 检索的彻底程度,越高越慢但越全。",
|
||||
recallBudgetDesc: "Hindsight 每次检索的彻底程度。越高找得越全面,但响应越慢、计算开销越大;越低越快,但可能漏掉相关记忆。",
|
||||
recallBudgetLow: "低",
|
||||
recallBudgetMid: "中",
|
||||
recallBudgetHigh: "高",
|
||||
bankMission: "Hindsight reflect mission",
|
||||
bankMissionDesc: "综合推理时的身份/框架描述,留空则用默认。",
|
||||
bankMission: "Hindsight 综合推理设定",
|
||||
bankMissionDesc: "使用「综合」模式检索时,告诉 Hindsight 以什么身份、从什么角度来归纳整理记忆。留空则使用默认设定。",
|
||||
bankMissionPlaceholder: "例如:你是用户的长期助手,关注其工作偏好。",
|
||||
settingsSaved: "设置已保存",
|
||||
searchTitle: "Hindsight 记忆检索",
|
||||
@@ -539,17 +539,23 @@ export const zhCN: Translations = {
|
||||
description:
|
||||
"保存后会写入 skill_evolution.json 并热更新,无需重启。",
|
||||
enabledLabel: "启用自我进化",
|
||||
enabledHelper: "关闭后 agent 不会创建或修改 custom/ 下的技能。",
|
||||
enabledHelper:
|
||||
"自我进化的总开关。开启后会给 agent 注册 skill_manage 工具 —— 它就能在对话中创建、修改、删除 custom/ 目录下的技能,并在完成复杂任务后主动提议把流程沉淀为技能。关闭后这些写技能的能力全部收起,agent 只能查看和使用已有技能。下方 curator 的所有设置都需要此开关开启才生效。",
|
||||
curatorEnabledLabel: "curator 自动运行",
|
||||
curatorEnabledHelper: "关闭后只能在此页面手动触发。",
|
||||
curatorEnabledHelper:
|
||||
"curator 是后台的技能策展程序,会定期巡检技能库:把长期不用的技能标记为陈旧、再归档,并用 LLM 评审是否该合并重复技能。开启后按下面的运行间隔自动运行;关闭后只能在本页面手动点「立即执行」触发。",
|
||||
intervalHoursLabel: "运行间隔(小时)",
|
||||
intervalHoursHelper: "两次自动运行之间至少经过的小时数。",
|
||||
intervalHoursHelper:
|
||||
"两次 curator 自动运行之间至少间隔的小时数,默认 168 小时(一周)。手动触发不受此限制。",
|
||||
staleAfterDaysLabel: "陈旧阈值(天)",
|
||||
staleAfterDaysHelper: "技能长时间不活跃后被标记为陈旧。",
|
||||
staleAfterDaysHelper:
|
||||
"一个技能连续这么多天没被使用,就会被 curator 标记为「陈旧」。陈旧技能不再注入 agent 的提示词,但文件仍保留;被重新用到时会自动恢复为活跃。",
|
||||
archiveAfterDaysLabel: "归档阈值(天)",
|
||||
archiveAfterDaysHelper: "标记陈旧后再经过这么多天会被自动归档。",
|
||||
archiveAfterDaysHelper:
|
||||
"一个技能从最后一次使用算起连续闲置这么多天,就会被 curator 自动「归档」(按总闲置天数计算,不是在标记陈旧之后再单独累加)。归档是软删除,文件仍留在 custom/ 目录、可随时手动恢复;此值需大于陈旧阈值。",
|
||||
curatorModelLabel: "技能优化模型",
|
||||
curatorModelHelper: "用于 curator 技能评审和技能安全审核的模型,为空则使用主模型。",
|
||||
curatorModelHelper:
|
||||
"curator 做技能评审(判断能否合并、精简)和技能安全审核时使用的模型。留空则使用主模型。",
|
||||
curatorModelDefault: "主模型(默认)",
|
||||
save: "保存修改",
|
||||
saveSuccess: "配置已更新",
|
||||
|
||||
Reference in new issue
Block a user