Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions dashboard/src/api/modules/memoryDashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,24 @@ export interface ListRawEventsBody {
}

export type ExtractTriggerMode = "idle" | "interval";
export type MemoryOverrideMode = "inherit" | "custom";

export interface GlobalMemoryDefaults {
aux_model: string | null;
aux_model_usable?: boolean;
extract_keep_rules: string;
extract_skip_rules: string;
supported_call_options?: string[];
affected_agent_count?: number;
}

export interface EffectiveMemoryExtractConfig {
aux_model: string | null;
aux_model_configured?: string | null;
aux_model_usable?: boolean;
extract_keep_rules: string;
extract_skip_rules: string;
}

export interface ExtractConfig {
/** Missing on older Octop API processes; absence keeps the historical enabled default. */
Expand All @@ -111,11 +129,21 @@ export interface ExtractConfig {
extract_trigger_mode: ExtractTriggerMode;
extract_idle_seconds: number;
extract_interval_seconds: number;
/** Whether extraction model inherits global defaults or uses an expert override. */
aux_model_mode?: MemoryOverrideMode;
/**
* "provider/model" ref used for extraction / promotion. null/absent = AUTO
* (follow the chat model); send "" to reset back to AUTO.
*/
aux_model?: string | null;
/** Whether memory keep/skip rules inherit global defaults or use an expert override. */
extract_rules_mode?: MemoryOverrideMode;
extract_keep_rules?: string;
extract_skip_rules?: string;
/** Read-only global default summary for display in the expert settings UI. */
global_defaults?: GlobalMemoryDefaults;
/** Read-only effective values resolved from expert override + global defaults. */
effective?: EffectiveMemoryExtractConfig;
/**
* Read timeout (seconds) for light memory calls (extraction). null/absent =
* harness default (120s); send 0 to reset back to the default.
Expand Down Expand Up @@ -749,6 +777,23 @@ export const memoryDashboardApi = {
method: "PUT",
body: JSON.stringify(body),
}),

// global default memory settings (Admin → Memory)
getGlobalMemoryDefaults: () =>
request<GlobalMemoryDefaults>("/settings/memory-defaults"),

putGlobalMemoryDefaults: (
body: Partial<
Pick<
GlobalMemoryDefaults,
"aux_model" | "extract_keep_rules" | "extract_skip_rules"
>
>,
) =>
request<GlobalMemoryDefaults>("/settings/memory-defaults", {
method: "PUT",
body: JSON.stringify(body),
}),
};

export default memoryDashboardApi;
11 changes: 11 additions & 0 deletions dashboard/src/layouts/sidebarNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Link2,
Database,
Cpu,
Brain,
Users as UsersIcon,
Activity,
Share2,
Expand Down Expand Up @@ -80,6 +81,7 @@ export const SIDEBAR_NAV_KEYS = [
"acp",
"admin-users",
"models",
"admin-memory",
"admin-storage",
"admin-plugins",
"admin-security",
Expand Down Expand Up @@ -134,6 +136,7 @@ export const SIDEBAR_GROUPED_NAV_KEYS = [
"acp",
"admin-users",
"models",
"admin-memory",
"admin-storage",
"admin-plugins",
"admin-security",
Expand Down Expand Up @@ -297,6 +300,14 @@ export function buildNavSections(
labelKey: "nav.models",
});
}
if (navAllowed(user, "admin-memory")) {
adminItems.push({
key: "admin-memory",
path: "/admin/memory",
icon: <Brain size={iconSize} strokeWidth={iconStroke} />,
labelKey: "nav.adminMemory",
});
}
if (navAllowed(user, "admin-storage")) {
adminItems.push({
key: "admin-storage",
Expand Down
44 changes: 43 additions & 1 deletion dashboard/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@
"admin": "Admin",
"adminUsers": "User Management",
"adminSso": "Single sign-on",
"adminMemory": "Memory Settings",
"adminStorage": "Storage Management",
"adminAudit": "Audit log",
"adminAgents": "Agents",
Expand Down Expand Up @@ -5418,8 +5419,27 @@
"distillTitle": "Distillation timing",
"distillDescription": "Choose when conversation material is organized into recallable long-term memory.",
"extractModelTitle": "Extraction model",
"extractModelDescription": "The model used to distill memories. \"Auto\" follows the chat default model; you can also pin a cheaper or faster model for extraction.",
"extractModelDescription": "The model used to distill memories. Inherits global defaults by default, or override per expert to pin a model or follow this expert's chat model.",
"extractModelAuto": "Auto (follow chat model)",
"extractModelSource": "Extraction model source",
"inheritGlobal": "Inherit global",
"customOverride": "Custom",
"restoreInherit": "Restore global inheritance",
"manageGlobalMemory": "Manage global defaults",
"inheritModelValue": "Inheriting global default: {{model}}",
"inheritModelUnavailable": "Inheriting global default: {{model}} (currently unavailable; falling back to this expert's chat model)",
"inheritModelUnset": "Inheriting global default: Not set (follows this expert's chat model)",
"rulesTitle": "Memory rules",
"rulesDescription": "Define what information is worth keeping as long-term memory and what should be skipped. Inherits global rules by default, or override per expert.",
"rulesSource": "Memory rules source",
"rulesUnsupported": "Rules are saved and will take effect when both octop-harness and octop-memory support custom memory rules.",
"inheritRulesUnset": "Inheriting global default: No custom rules configured (uses built-in defaults)",
"keepRulesLabel": "Information worth keeping as long-term memory",
"keepRulesHint": "For example: domain-specific decisions, stable preferences, client constraints, and reusable context.",
"keepRulesPlaceholder": "Describe what should be prioritized for long-term memory (leave blank for built-in defaults)",
"skipRulesLabel": "Information to skip",
"skipRulesHint": "For example: draft notes, one-off questions, or transient context not worth keeping.",
"skipRulesPlaceholder": "Describe what should be ignored during extraction (leave blank for built-in defaults)",
"reloadHint": "Saving reloads the agent automatically. Current conversations are retained.",
"loadFailed": "Failed to load memory settings",
"saved": "Saved — the agent will reload automatically",
Expand Down Expand Up @@ -8574,5 +8594,27 @@
"nameRequired": "Enter a name first",
"failed": "Polish failed. Please try again later.",
"emptyResult": "The model returned an empty result"
},
"adminMemory": {
"title": "Global Memory Settings",
"subtitle": "Configure the default memory extraction model and memory rules for new and uncustomized experts. Experts can override each independently while memory data stays isolated per expert.",
"loadFailed": "Failed to load global memory defaults",
"saved": "Global memory defaults saved",
"savedWithAffected": "Saved global memory settings. This change affects {{count}} inheriting experts.",
"saveFailed": "Failed to save global memory defaults",
"extractModelTitle": "Default extraction model",
"extractModelDescription": "Used in the background by all experts set to \"Inherit global\". When unset, each expert follows its own chat model.",
"extractModelUnset": "Not set (follow each expert's chat model)",
"extractModelUnavailable": "The configured global extraction model is currently unavailable (its provider may be disabled or removed). Inheriting experts have fallen back to their chat models. Choose an enabled model or clear the default.",
"rulesTitle": "Default memory rules",
"rulesDescription": "Define what information is worth retaining as long-term memory and what should be skipped. Leave blank to keep built-in defaults.",
"rulesUnsupported": "Rules are saved and will take effect when both octop-harness and octop-memory support custom memory rules.",
"keepRulesLabel": "Information worth keeping as long-term memory",
"keepRulesHint": "For example: stable user preferences, long-term project decisions, and recurring collaboration context.",
"keepRulesPlaceholder": "Describe what should be prioritized for long-term memory (leave blank for built-in defaults)",
"skipRulesLabel": "Information to skip",
"skipRulesHint": "For example: one-off queries, casual small talk, temporary drafts, or noisy debugging output.",
"skipRulesPlaceholder": "Describe what should be skipped during extraction (leave blank for built-in defaults)",
"saveHint": "Saving applies immediately to experts set to \"Inherit global\" without affecting experts with custom overrides."
}
}
44 changes: 43 additions & 1 deletion dashboard/src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@
"admin": "管理",
"adminUsers": "用户管理",
"adminSso": "单点登录",
"adminMemory": "记忆设置",
"adminStorage": "存储管理",
"adminAudit": "审计日志",
"adminAgents": "智能体",
Expand Down Expand Up @@ -5332,8 +5333,27 @@
"distillTitle": "记忆提炼时机",
"distillDescription": "选择何时把对话记忆整理为可召回的长期记忆。",
"extractModelTitle": "记忆提取模型",
"extractModelDescription": "提炼记忆时调用的模型。选择“自动”跟随对话使用的默认模型;也可以指定一个更便宜或更快的模型专门做提炼。",
"extractModelDescription": "提炼记忆时调用的模型。默认继承全局设置,也可为当前专家单独指定模型或跟随其对话模型。",
"extractModelAuto": "自动(跟随对话模型)",
"extractModelSource": "记忆提取模型来源",
"inheritGlobal": "继承全局",
"customOverride": "自定义",
"restoreInherit": "恢复继承全局",
"manageGlobalMemory": "管理全局默认",
"inheritModelValue": "当前继承全局:{{model}}",
"inheritModelUnavailable": "当前继承全局:{{model}}(该模型当前不可用,已自动回退到本专家对话模型)",
"inheritModelUnset": "当前继承全局:未设置(沿用本专家对话模型)",
"rulesTitle": "记忆规则",
"rulesDescription": "定义哪些信息值得保留为长期记忆、哪些信息应跳过。默认继承全局规则,也可为当前专家单独覆盖。",
"rulesSource": "记忆规则来源",
"rulesUnsupported": "当前运行环境尚不支持自定义记忆规则。规则会保存,升级 octop-harness 和 octop-memory 后生效。",
"inheritRulesUnset": "当前继承全局:未设置自定义规则(沿用内置默认策略)",
"keepRulesLabel": "值得保留为长期记忆的信息",
"keepRulesHint": "例如:该专家专属领域的长期决策、客户约束、偏好与后续必用信息。",
"keepRulesPlaceholder": "描述需要优先记住的信息,留空表示不额外指定",
"skipRulesLabel": "应当跳过的信息",
"skipRulesHint": "例如:临时草稿、一次性问答或无需长期留存的上下文。",
"skipRulesPlaceholder": "描述应跳过的信息,留空表示不额外指定",
"reloadHint": "保存后专家会自动重载,当前对话不会被删除。",
"loadFailed": "记忆设置加载失败",
"saved": "已保存,专家将自动重载",
Expand Down Expand Up @@ -8574,5 +8594,27 @@
"nameRequired": "请先填写名称",
"failed": "润色失败,请稍后重试",
"emptyResult": "模型未返回结果"
},
"adminMemory": {
"title": "全局记忆设置",
"subtitle": "统一配置新建专家与未单独设置专家的默认记忆提取模型和记忆规则;专家可在各自记忆设置中单独覆盖。记忆内容仍按专家隔离。",
"loadFailed": "全局记忆默认设置加载失败",
"saved": "已保存全局记忆设置",
"savedWithAffected": "已保存全局记忆设置,此次变更影响 {{count}} 个继承设置的专家",
"saveFailed": "保存全局记忆设置失败",
"extractModelTitle": "默认记忆提取模型",
"extractModelDescription": "所有选择「继承全局」的专家将统一使用该模型在后台提取记忆;未设置时沿用各专家自己的对话模型。",
"extractModelUnset": "未设置(沿用各专家对话模型)",
"extractModelUnavailable": "当前配置的全局提取模型不可用(对应服务商可能已禁用或删除),继承该配置的专家已自动回退到各自对话模型。请重新选择可用模型或恢复未设置。",
"rulesTitle": "默认记忆规则",
"rulesDescription": "定义哪些信息值得保留为长期记忆、哪些信息应跳过。留空时沿用内置默认规则。",
"rulesUnsupported": "当前运行环境尚不支持自定义记忆规则。规则会保存,升级 octop-harness 和 octop-memory 后生效。",
"keepRulesLabel": "值得保留为长期记忆的信息",
"keepRulesHint": "例如:稳定的个人偏好、长期项目架构决策、后续协作会反复用到的约定与背景。",
"keepRulesPlaceholder": "描述需要优先记住的信息类型,留空表示仅使用内置默认规则",
"skipRulesLabel": "应当跳过的信息",
"skipRulesHint": "例如:一次性查询问答、寒暄闲聊、临时草稿或不需要沉淀的中间调试内容。",
"skipRulesPlaceholder": "描述不需要沉淀为长期记忆的信息类型,留空表示仅使用内置默认规则",
"saveHint": "修改后,采用「继承全局」的专家会自动采用新配置;已显式自定义相应项目的专家不受影响。"
}
}
103 changes: 103 additions & 0 deletions dashboard/src/pages/Admin/Memory/index.module.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
.page {
display: flex;
flex-direction: column;
gap: 16px;
width: 100%;
max-width: 900px;
padding-bottom: 24px;
}

.settingCard {
border-radius: 12px;

:global(.ant-card-body) {
padding: 20px;
}
}

.sectionHeading {
display: flex;
align-items: center;
gap: 12px;
}

.settingIcon {
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
width: 34px;
height: 34px;
border-radius: 10px;
color: var(--fn-color-brand);
background: color-mix(in srgb, var(--fn-color-brand) 10%, transparent);
}

.settingTitle {
color: var(--fn-text-primary);
font-size: 15px;
font-weight: 600;
}

.settingDescription {
margin-top: 3px;
color: var(--fn-text-tertiary);
font-size: 12px;
line-height: 1.5;
}

.fields {
display: flex;
flex-direction: column;
gap: 16px;
margin: 18px 0 0 46px;
}

.fieldBlock {
display: flex;
flex-direction: column;
gap: 6px;
}

.fieldLabel {
color: var(--fn-text-primary);
font-size: 13px;
font-weight: 500;
}

.fieldHint {
color: var(--fn-text-tertiary);
font-size: 12px;
line-height: 1.5;
}

.saveBar {
position: sticky;
bottom: 12px;
z-index: 2;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 12px 16px;
border: 1px solid var(--fn-border-primary);
border-radius: 12px;
background: color-mix(in srgb, var(--fn-bg-elevated) 94%, transparent);
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
backdrop-filter: blur(10px);

> span {
color: var(--fn-text-tertiary);
font-size: 12px;
}
}

@media (max-width: 767px) {
.fields {
margin-left: 0;
}

.saveBar {
bottom: 8px;
}
}
Loading
Loading