feat(memory): add a Memory On/Off switch and private chats

Memory now has one switch, On or Off, in the Memory tab of the account
settings. Off means nothing from the notes is put in the prompt, the
model has no memory skill, tool or note kind, nothing is proposed or
saved (also by triggers and other runs that start by themselves), and
the model is told in one line that memory is off. The notes stay and can
still be read, exported and deleted.

A chat can be private: the Memory row of its Tools menu is the memory
switch group, stored with the chat. The narrowest level wins: chat,
agent, person, server. A saved agent cannot widen the choice of the
person. The tools list says which level is off (memory.code, blocked_by,
fix); the chat shows a chip and one line, and the agent form shows the
person's switch as a read-only line.

New API: GET and PUT /api/chats/memory for the switch and the save level,
and GET /api/chats/memory/export for a zip of the notes. The Memory tab
gains the switch, the three save levels, Export and Forget everything.

Assisted-by: Claude:claude-sonnet-5-5
This commit is contained in:
Ettore Di Giacinto committed 2026-11-04 17:50:26 +00:00
1 parent cde3a2d6d9
commit 2316e14632
55 files changed
+2255 -80

No files matched your search

+3
View File
@@ -107,6 +107,9 @@ var RouteFeatureRegistry = []RouteFeature{
{"PUT", "/api/chats/shared-pages/:folder/:name/file", FeatureChats},
{"POST", "/api/chats/shared-pages/:folder/:name/chat", FeatureChats},
{"GET", "/api/chats/context-files", FeatureChats},
{"GET", "/api/chats/memory", FeatureChats},
{"PUT", "/api/chats/memory", FeatureChats},
{"GET", "/api/chats/memory/export", FeatureChats},
{"GET", "/api/chats/changes", FeatureChats},
{"GET", "/api/chats/changes/audit", FeatureChats},
{"GET", "/api/chats/changes/:id", FeatureChats},
File diff suppressed because one or more lines are too long.
+3 -2
View File
@@ -217,6 +217,7 @@ func writeToolsPanel(c echo.Context, p studiosvc.ToolsPanel) error {
Usable: g.Usable, Reason: g.Reason, Provider: g.Provider, Providers: g.Providers,
Title: g.Title, Description: g.Description, WhenOff: g.WhenOff})
}
out.Memory = memoryStateOut(p.Memory)
for _, a := range p.Addons {
out.Addons = append(out.Addons, addonOut(a))
}
@@ -234,7 +235,7 @@ func writeToolsPanel(c echo.Context, p studiosvc.ToolsPanel) error {
// ListChatTools lists what a chat can use besides its built-in tools.
// @Summary List the tools a chat can switch on and off.
// @Description The groups of built-in tools (shell, web, files, media, collections, subagents, triggers and saved_agents; a group the server does not offer is absent, and shell is listed even when nothing can run commands, not usable with the reason), add-ons, the MCP servers of the chat's model and your MCP connectors, each with the chat's switch and whether it can be used now (with the reason when not). A chat with a saved agent lists only what the agent grants. fallbacks lists the built-in tools (bash, web_search, web_fetch) that an installed add-on replaces but that no add-on serves in this chat now, with the add-on and whether the built-in serves instead.
// @Description The groups of built-in tools (shell, web, files, media, collections, subagents, triggers, memory and saved_agents; a group the server does not offer is absent, and shell is listed even when nothing can run commands, not usable with the reason), add-ons, the MCP servers of the chat's model and your MCP connectors, each with the chat's switch and whether it can be used now (with the reason when not). A chat with a saved agent lists only what the agent grants. memory says whether memory works in the chat and, when it does not, the level that turned it off (code, blocked_by) and where to turn it on (fix). fallbacks lists the built-in tools (bash, web_search, web_fetch) that an installed add-on replaces but that no add-on serves in this chat now, with the add-on and whether the built-in serves instead.
// @Tags chats
// @Param id path string true "conversation id"
// @Success 200 {object} schema.ChatsToolsPanel "The tools and their switches"
@@ -246,7 +247,7 @@ func (h *Handlers) ListChatTools(c echo.Context) error { return toolsPanel(c, h)
// SetChatBuiltins sets the groups of built-in tools a chat has switched off,
// and the opt-in groups it has switched on.
// @Summary Switch groups of built-in tools on and off for a chat.
// @Description off replaces the earlier list of groups that are off. The groups are shell (bash, whether the Sandbox add-on or the built-in bash on this machine serves it), web (web_search and web_fetch), files (list_files, read_file, write_file, edit_file, move_file, delete_file, search_files and read_document), media (describe_image and transcribe_audio), collections (list_collections and search_collection), subagents (spawn_agent), triggers (propose_trigger, list_triggers, update_trigger and delete_trigger) and saved_agents. A sub-agent follows the switches of its parent chat. An opt-in group (opt_in in the list, such as saved_agents: list_agents and the agent argument of spawn_agent) is off until on names it; on replaces the earlier list of opt-in groups that are on, and an opt-in group in off is ignored. Omit on to keep it. A switch never adds what the administrator has off or the user may not use. The next turn of the chat gets the tools that are on.
// @Description off replaces the earlier list of groups that are off. The groups are shell (bash, whether the Sandbox add-on or the built-in bash on this machine serves it), web (web_search and web_fetch), files (list_files, read_file, write_file, edit_file, move_file, delete_file, search_files and read_document), media (describe_image and transcribe_audio), collections (list_collections and search_collection), subagents (spawn_agent), triggers (propose_trigger, list_triggers, update_trigger and delete_trigger), memory (your notes: off makes the chat a private chat that neither reads nor saves memory) and saved_agents. A sub-agent follows the switches of its parent chat. An opt-in group (opt_in in the list, such as saved_agents: list_agents and the agent argument of spawn_agent) is off until on names it; on replaces the earlier list of opt-in groups that are on, and an opt-in group in off is ignored. Omit on to keep it. A switch never adds what the administrator has off or the user may not use. The next turn of the chat gets the tools that are on.
// @Tags chats
// @Param id path string true "conversation id"
// @Param request body schema.ChatsBuiltinSwitches true "the groups that are off"
+86
View File
@@ -0,0 +1,86 @@
package studio
import (
"bytes"
"net/http"
"github.com/labstack/echo/v4"
"github.com/mudler/LocalAI/core/schema"
studiosvc "github.com/mudler/LocalAI/core/services/studio"
)
var memoryRules = []errRule{
fixed(http.StatusServiceUnavailable, "unavailable", "the memory settings cannot be stored on this server", studiosvc.ErrMemorySettings),
fixed(http.StatusNotFound, typeNotFound, "there are no notes to export", studiosvc.ErrNoNotes),
}
func failMemory(c echo.Context, err error) error { return mapErr(c, err, memoryRules, failFor) }
func memorySettingsOut(m studiosvc.MemorySettings) schema.ChatsMemorySettings {
return schema.ChatsMemorySettings{Enabled: m.Enabled, EnabledSet: m.EnabledSet, SaveMode: m.SaveMode,
SaveModeSet: m.SaveModeSet, Provider: m.Provider, Available: m.Available}
}
func memoryStateOut(m studiosvc.MemoryReason) schema.ChatsMemoryState {
out := schema.ChatsMemoryState{On: m.On, Code: m.Code, BlockedBy: m.By, Reason: m.Reason}
if m.Fix != nil {
out.Fix = &schema.ChatsMemoryFix{Kind: m.Fix.Kind, Target: m.Fix.Target, Field: m.Fix.Field}
}
return out
}
// GetMemory reads your memory choices.
// @Summary Read your memory settings.
// @Description Memory is the short notes the assistant reads before it answers and may save. enabled is the switch for all your chats and agents: a private chat (the memory group of a chat, see PUT /api/chats/{id}/builtins), an agent that turns memory off, or this switch off each make memory off in a chat, and the narrowest wins; a saved agent cannot widen your choice. enabled_set is false until you choose; before that memory is on, unless you had disabled the Memory add-on to stop it. save_mode is how a note is saved (ask, auto or never) and applies as the strictest rule with the rules of the host; a chat from a messaging app always asks. Your notes stay and can be listed, exported and deleted while memory is off.
// @Tags chats
// @Success 200 {object} schema.ChatsMemorySettings "Your memory settings"
// @Router /api/chats/memory [get]
func (h *Handlers) GetMemory(c echo.Context) error {
m, err := h.svc.MemorySettings(c.Request().Context(), userID(c))
if err != nil {
return failMemory(c, err)
}
return c.JSON(http.StatusOK, memorySettingsOut(m))
}
// PutMemory changes your memory choices.
// @Summary Change your memory settings.
// @Description Sets enabled (memory On or Off for every chat and agent) and save_mode (ask, auto or never). A field left out stays as it is. Off means nothing is put in the prompt, the model has no tool or skill for notes, nothing is proposed or saved (also by triggers and other runs that start by themselves) and the model is told in one line that memory is off. The settings are kept per person with the account, so every frontend of a cluster reads the same answer. 400 for a value that is not allowed.
// @Tags chats
// @Accept json
// @Param request body schema.ChatsMemoryRequest true "the choices to change"
// @Success 200 {object} schema.ChatsMemorySettings "Your memory settings now in force"
// @Failure 400 {object} schema.ErrorResponse "A value is not allowed"
// @Failure 503 {object} schema.ErrorResponse "The settings cannot be stored on this server"
// @Router /api/chats/memory [put]
func (h *Handlers) PutMemory(c echo.Context) error {
req, ok := bind[schema.ChatsMemoryRequest](c, "the body must be {enabled, save_mode}")
if !ok {
return nil
}
m, err := h.svc.SetMemory(c.Request().Context(), userID(c), studiosvc.MemoryUpdate{Enabled: req.Enabled, SaveMode: req.SaveMode})
if err != nil {
return failMemory(c, err)
}
return c.JSON(http.StatusOK, memorySettingsOut(m))
}
// ExportMemory downloads your notes.
// @Summary Download your memory notes as a zip file.
// @Description The Markdown files of your memory folders (yours, each agent's and each messaging conversation's) with their paths. scope (user, agent or channel) and key (the agent ID or the conversation folder name, as GET /api/chats/context-files lists them) narrow it to one group. It works while memory is off. 404 when there is nothing to export.
// @Tags chats
// @Produce application/zip
// @Param scope query string false "user, agent or channel"
// @Param key query string false "the agent ID or the conversation folder, with scope"
// @Success 200 {file} file "A zip file of the notes"
// @Failure 404 {object} schema.ErrorResponse "No notes"
// @Router /api/chats/memory/export [get]
func (h *Handlers) ExportMemory(c echo.Context) error {
var buf bytes.Buffer
if _, err := h.svc.ExportMemory(c.Request().Context(), userID(c), &buf, c.QueryParam("scope"), c.QueryParam("key")); err != nil {
return failMemory(c, err)
}
c.Response().Header().Set(echo.HeaderContentDisposition, `attachment; filename="memory-notes.zip"`)
return c.Blob(http.StatusOK, "application/zip", buf.Bytes())
}
+251
View File
@@ -0,0 +1,251 @@
import { test, expect } from './coverage-fixtures.js'
import { mockChat } from './chat-fixtures.js'
import { installAgents } from './agents-fixtures.js'
// Memory On or Off: the switch and the save levels of the Memory tab of Your
// settings, and the memory row of the chat Tools menu (a private chat). The API
// is stubbed by a small model of what the server keeps.
const SHOTS = process.env.MEMORY_SHOTS || ''
async function shot(page, name, options = {}) {
if (!SHOTS) return
for (const theme of ['light', 'dark']) {
await page.evaluate((t) => document.documentElement.setAttribute('data-theme', t), theme)
await page.waitForTimeout(500)
await page.screenshot({ path: `${SHOTS}/${name}-${theme}-${page.viewportSize().width}.png`, ...options })
}
await page.evaluate(() => document.documentElement.setAttribute('data-theme', 'light'))
}
const LIMITS = { index_lines: 40, index_bytes: 2048, profile_bytes: 4096, turn_bytes: 6144 }
const NOTES = { 'Memory/index.md': '- home: lives in Rome -> home.md\n- units: metric, 24-hour clock -> units.md\n', 'Memory/home.md': 'Rome.\n', 'Memory/units.md': 'Metric.\n' }
async function serveAccount(page, { enabled = true, save = 'ask', fail = false } = {}) {
const s = { enabled, save, puts: [], exports: 0, removed: [] }
await mockChat(page)
await page.route('**/api/chats/memory', (route) => {
const req = route.request()
if (req.method() === 'PUT') {
const body = req.postDataJSON()
s.puts.push(body)
if (fail) return route.fulfill({ status: 503, json: { error: { message: 'the memory settings cannot be stored on this server' } } })
if (typeof body.enabled === 'boolean') s.enabled = body.enabled
if (body.save_mode) s.save = body.save_mode
}
return route.fulfill({ json: { enabled: s.enabled, enabled_set: s.puts.length > 0, save_mode: s.save, save_mode_set: false, provider: 'builtin', available: true } })
})
await page.route('**/api/chats/memory/export*', (route) => { s.exports++; return route.fulfill({ status: 200, contentType: 'application/zip', body: 'PK' }) })
await page.route('**/api/chats/context-files', route => route.fulfill({ json: {
limits: LIMITS,
groups: [{ source: 'memory', scope: 'user', max_bytes: 2048, max_lines: 40, files: Object.entries(NOTES).map(([p, t]) => ({ path: p, name: p.split('/').pop(), size: t.length, ...(p.endsWith('index.md') ? { index: true, lines: 2 } : {}) })) }],
} }))
await page.route('**/api/chats/files?*', route => route.fulfill({ json: [] }))
await page.route('**/api/chats/files/content*', (route) => {
if (route.request().method() === 'DELETE') s.removed.push(1)
return route.fulfill({ status: 200, body: '' })
})
await page.route(/\/api\/chats\/files(\?.*)?$/, (route) => {
if (route.request().method() === 'DELETE') { s.removed.push(new URL(route.request().url()).searchParams.get('path')); return route.fulfill({ json: { moved: 1 } }) }
return route.fulfill({ json: [] })
})
return s
}
test.describe('Settings, Memory: the switch and how a note is saved', () => {
test('puts the On or Off switch first and stores a change at once', async ({ page }) => {
const s = await serveAccount(page)
await page.goto('/app/account?tab=memory')
const card = page.getByTestId('memory-switch-card')
await expect(card).toHaveAttribute('data-state', 'on')
await expect(card.getByRole('heading', { name: 'Memory is on' })).toBeVisible()
const sw = page.getByRole('switch', { name: 'Memory is on' })
await expect(sw).toHaveAttribute('aria-checked', 'true')
// The switch is above everything else on the page.
const top = async (id) => (await page.getByTestId(id).boundingBox()).y
expect(await top('memory-switch-card')).toBeLessThan(await top('memory-save-card'))
expect(await top('memory-save-card')).toBeLessThan(await top('memory-notes-section'))
await shot(page, 'settings-memory-on', { fullPage: true })
await sw.click()
await expect.poll(() => s.puts).toEqual([{ enabled: false }])
await expect(card).toHaveAttribute('data-state', 'off')
await expect(page.getByRole('switch', { name: 'Memory is off' })).toHaveAttribute('aria-checked', 'false')
await expect(page.getByText('Your notes stay, and you can still read, export and delete them.')).toBeVisible()
// The notes stay viewable while memory is off.
await expect(page.getByTestId('memory-group')).toBeVisible()
await expect(page.getByTestId('memory-export')).toBeEnabled()
await shot(page, 'settings-memory-off', { fullPage: true })
await page.getByRole('switch', { name: 'Memory is off' }).click()
await expect.poll(() => s.puts.at(-1)).toEqual({ enabled: true })
await expect(card).toHaveAttribute('data-state', 'on')
})
test('lists the three save levels, marks the default and stores the one picked', async ({ page }) => {
const s = await serveAccount(page)
await page.goto('/app/account?tab=memory')
const radios = page.getByRole('radio')
await expect(radios).toHaveCount(3)
await expect(page.getByRole('radio', { name: /Ask me first/ })).toBeChecked()
await expect(page.getByTestId('memory-save-ask')).toContainText('Default')
await page.getByRole('radio', { name: /Save it and tell me/ }).click()
await expect.poll(() => s.puts).toEqual([{ save_mode: 'auto' }])
await expect(page.getByRole('radio', { name: /Save it and tell me/ })).toBeChecked()
await page.getByRole('radio', { name: /Never/ }).click()
await expect.poll(() => s.puts.at(-1)).toEqual({ save_mode: 'never' })
})
test('a choice the server did not store is not shown as stored', async ({ page }) => {
const s = await serveAccount(page, { fail: true })
await page.goto('/app/account?tab=memory')
await page.getByRole('switch', { name: 'Memory is on' }).click()
await expect(page.getByTestId('memory-settings-save-error')).toContainText('cannot be stored')
await expect(page.getByTestId('memory-switch-card')).toHaveAttribute('data-state', 'on')
expect(s.puts).toEqual([{ enabled: false }])
})
test('exports the notes, and forgets everything only after a confirm step', async ({ page }) => {
const s = await serveAccount(page)
await page.goto('/app/account?tab=memory')
const download = page.waitForEvent('download')
await page.getByTestId('memory-export').click()
expect((await download).url()).toMatch(/\/api\/chats\/memory\/export$/)
await page.getByTestId('memory-clear').click()
await expect(page.getByTestId('memory-clear-confirm')).toBeVisible()
expect(s.removed).toEqual([])
await shot(page, 'settings-memory-forget', { fullPage: true })
await page.getByTestId('memory-clear-yes').click()
await expect.poll(() => s.removed.length).toBe(3)
})
test('has no horizontal scroll and keeps the switch reachable on a phone', async ({ page }) => {
await page.setViewportSize({ width: 390, height: 800 })
await serveAccount(page)
await page.goto('/app/account?tab=memory')
await expect(page.getByRole('switch', { name: 'Memory is on' })).toBeVisible()
expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth)).toBe(true)
await shot(page, 'settings-memory-on', { fullPage: true })
})
})
const chat = { id: 'c1', title: 'Quotes', model: 'qwen3-8b', kind: 'chat', created: '2026-10-25T10:00:00Z', updated: '2026-10-25T10:00:00Z', running: false, last_turn: '', pending: [] }
const MEMORY_ROW = { group: 'memory', tools: ['context_read'], off: false, usable: true, provider: 'builtin', providers: { context_read: 'builtin' },
title: 'Memory', description: 'The model can read your notes before it answers and save new ones. Turn it off to make this a private chat: nothing is read from your notes or saved to them. Your other chats are not affected.',
when_off: 'This is a private chat. The model neither reads nor saves your notes.' }
async function serveChat(page, { user = false, agent = false } = {}) {
const state = { off: false, puts: [] }
const memory = () => {
if (state.off) return { on: false, code: 'memory_off_chat', blocked_by: 'chat', reason: 'Memory is off in this chat: it is a private chat.', fix: { kind: 'open_tools_menu', target: 'memory' } }
if (user) return { on: false, code: 'memory_off_user', blocked_by: 'user', reason: 'Memory is off in your settings.', fix: { kind: 'open_memory_settings', target: 'memory' } }
if (agent) return { on: false, code: 'memory_off_agent', blocked_by: 'agent', reason: 'Memory is off for the agent of this chat.' }
return { on: true }
}
const tools = () => ({ addons: [], builtins: [
{ group: 'web', tools: ['web_search'], off: false, usable: true, provider: 'builtin', providers: { web_search: 'builtin' } },
{ ...MEMORY_ROW, off: state.off, usable: !user, reason: user ? 'memory is off in your settings' : undefined },
], off: [], servers: [], connectors: [], memory: memory() })
await mockChat(page)
await page.route('**/api/chats/c1/events', route => route.abort())
await page.route(/\/api\/chats\/c1\/messages(\?.*)?$/, route => route.fulfill({ json: { messages: [] } }))
await page.route(/\/api\/chats\/c1(\?.*)?$/, route => route.fulfill({ json: chat }))
await page.route('**/api/chats/c1/addons', route => route.fulfill({ json: { addons: [] } }))
await page.route('**/api/chats/c1/tools', route => route.fulfill({ json: tools() }))
await page.route('**/api/chats/c1/builtins', (route) => {
const body = route.request().postDataJSON()
state.puts.push(body)
state.off = (body.off || []).includes('memory')
return route.fulfill({ json: tools() })
})
return state
}
const open = async (page) => {
await page.goto('/app/chats/c1')
await page.getByTestId('chat-tools-button').click()
await expect(page.getByTestId('chat-tools-menu')).toBeVisible()
}
test.describe('Chat Tools menu: memory and the private chat', () => {
test('a Memory row with a plain effect line, on by default', async ({ page }) => {
await serveChat(page)
await open(page)
const sw = page.getByRole('switch', { name: 'Memory', exact: true })
await expect(sw).toHaveAttribute('aria-checked', 'true')
await expect(page.getByTestId('chat-tools-item').filter({ has: sw })).toContainText('Turn it off to make this a private chat')
await expect(page.getByTestId('chat-memory-line')).toHaveCount(0)
await expect(page.getByTestId('chat-memory-chip')).toHaveCount(0)
await shot(page, 'chat-tools-memory-on')
})
test('switching it off makes a private chat, remembered by the server, with a chip and one line', async ({ page }) => {
const s = await serveChat(page)
await open(page)
await page.getByRole('switch', { name: 'Memory', exact: true }).click()
await expect.poll(() => s.puts).toEqual([{ off: ['memory'] }])
await expect(page.getByRole('switch', { name: 'Memory', exact: true })).toHaveAttribute('aria-checked', 'false')
await expect(page.getByTestId('chat-tools-item').filter({ has: page.getByRole('switch', { name: 'Memory', exact: true }) })).toContainText('This is a private chat')
await expect(page.getByTestId('chat-memory-line')).toContainText('Memory is off here.')
await expect(page.getByTestId('chat-memory-line')).toContainText('private chat')
await expect(page.getByTestId('chat-memory-line')).toContainText('Turn it on in the Tools menu')
await expect(page.getByTestId('chat-memory-chip')).toHaveText('Private chat')
await shot(page, 'chat-tools-memory-private')
await page.getByRole('switch', { name: 'Memory', exact: true }).click()
await expect.poll(() => s.puts.at(-1)).toEqual({ off: [] })
await expect(page.getByTestId('chat-memory-chip')).toHaveCount(0)
})
test('when memory is off in the settings the row cannot be used and the line says where to turn it on', async ({ page }) => {
await serveChat(page, { user: true })
await open(page)
const sw = page.getByRole('switch', { name: 'Memory', exact: true })
await expect(sw).toBeDisabled()
await expect(sw).toHaveAccessibleDescription(/Off in your settings/)
const line = page.getByTestId('chat-memory-line')
await expect(line).toHaveAttribute('data-code', 'user')
await expect(line).toContainText('Memory is off here.')
await expect(line.getByRole('link', { name: 'Settings, Memory' })).toHaveAttribute('href', /\/app\/account\?tab=memory/)
await expect(page.getByTestId('chat-memory-chip')).toHaveText('Memory off')
await shot(page, 'chat-tools-memory-user-off')
})
test('a chat of an agent that turned memory off says so', async ({ page }) => {
await serveChat(page, { agent: true })
await open(page)
await expect(page.getByTestId('chat-memory-line')).toContainText('The agent of this chat has memory switched off.')
})
test('fits a phone: the line, the chip and the switch stay inside the screen', async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 })
await serveChat(page, { user: true })
await page.goto('/app/chats/c1')
await page.getByTestId('chat-tools-button').click()
await expect(page.getByTestId('chat-memory-line')).toBeVisible()
expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth)).toBe(true)
await shot(page, 'chat-tools-memory-user-off')
})
})
test.describe('Agent form: the memory switch of the person', () => {
const memory = (page, enabled) => page.route('**/api/chats/memory', route => route.fulfill({ json: { enabled, enabled_set: true, save_mode: 'ask', save_mode_set: false, provider: 'builtin', available: true } }))
test('says, read only, that memory is off in the settings of the person', async ({ page }) => {
await installAgents(page)
await memory(page, false)
await page.goto('/app/agents/new')
await page.locator('[data-section="Tools"] .ag-fold__button').click()
const line = page.getByTestId('agent-memory-off')
await expect(line).toContainText('Memory is off in your settings')
await expect(line.getByRole('link', { name: 'Settings, Memory' })).toHaveAttribute('href', /\/app\/account\?tab=memory/)
await shot(page, 'agent-form-memory-off', { fullPage: true })
})
test('says nothing while memory is on', async ({ page }) => {
await installAgents(page)
await memory(page, true)
await page.goto('/app/agents/new')
await page.locator('[data-section="Tools"] .ag-fold__button').click()
await expect(page.getByTestId('agent-tools-panel')).toBeVisible()
await expect(page.getByTestId('agent-memory-off')).toHaveCount(0)
})
})
@@ -148,7 +148,9 @@
"triggers_run": "Trigger aus Messaging-Apps starten lassen",
"talkback_channels": "Auf bekannten Kanälen antworten",
"files_upload": "Dateien aus Messaging-Apps empfangen"
}
},
"memoryOffUser": "Das Gedächtnis ist in deinen Einstellungen aus. Dieser Agent liest und speichert deshalb keine Notizen, egal was du hier einstellst.",
"memoryOffFix": "Einstellungen, Gedächtnis"
},
"run": {
"workingLine": "Working"
@@ -328,7 +328,8 @@
"media": "Bilder und Audio",
"collections": "Wissen",
"subagents": "Sub-Agenten",
"changes": "Vorgeschlagene Änderungen"
"changes": "Vorgeschlagene Änderungen",
"memory": "Gedächtnis"
},
"builtinBy": "{{tools}} · eingebaut",
"builtinByAddon": "{{tools}} · bedient von {{provider}}",
@@ -350,7 +351,8 @@
"subagents": "Das Modell kann für eine Aufgabe einen Sub-Agenten starten und dessen Bericht erhalten.",
"saved_agents": "Das Modell kann einen deiner gespeicherten Agenten als Sub-Agenten starten.",
"triggers": "Das Modell kann Trigger vorschlagen, auflisten, ändern und löschen. Du bestätigst jeden neuen Trigger und jede Änderung.",
"changes": "Das Modell kann Änderungen an deinen Notizen, seinen Regeln, Skills, Seiten und am Dashboard vorschlagen. Du bestätigst jede einzelne."
"changes": "Das Modell kann Änderungen an deinen Notizen, seinen Regeln, Skills, Seiten und am Dashboard vorschlagen. Du bestätigst jede einzelne.",
"memory": "Das Modell kann deine Notizen lesen, bevor es antwortet, und neue speichern. Schalte es aus, um den Chat privat zu machen: nichts wird aus deinen Notizen gelesen oder darin gespeichert. Deine anderen Chats bleiben unberührt."
},
"whenOff": {
"shell": "Das Modell kann Dateien schreiben, aber nichts ausführen.",
@@ -361,7 +363,8 @@
"subagents": "Das Modell arbeitet allein.",
"saved_agents": "Das Modell kann deine gespeicherten Agenten weder sehen noch starten.",
"triggers": "Das Modell kann keine Trigger vorschlagen oder verwalten.",
"changes": "Das Modell kann keine Änderungen an deinen Notizen, seinen Regeln, Skills, Seiten oder am Dashboard vorschlagen."
"changes": "Das Modell kann keine Änderungen an deinen Notizen, seinen Regeln, Skills, Seiten oder am Dashboard vorschlagen.",
"memory": "Das ist ein privater Chat. Das Modell liest und speichert deine Notizen nicht."
},
"addonDescribe_one": "Gibt dem Modell {{count}} Werkzeug dieses Add-ons.",
"addonDescribe_other": "Gibt dem Modell {{count}} Werkzeuge dieses Add-ons.",
@@ -817,7 +820,7 @@
"deleteYes": "Löschen",
"confirmDelete": "{{name}} löschen?",
"deleted": "{{name}} in den Papierkorb verschoben.",
"clear": "Alle Notizen löschen",
"clear": "Alles vergessen",
"clearAsk_one": "{{count}} Datei löschen? Sie kommt in den Papierkorb und lässt sich unter Dateien wiederherstellen.",
"clearAsk_other": "{{count}} Dateien löschen? Sie kommen in den Papierkorb und lassen sich unter Dateien wiederherstellen.",
"clearYes_one": "{{count}} Datei löschen",
@@ -846,5 +849,50 @@
"declared": "Er wurde so eingerichtet, dass er nur liest und berichtet. Nichts, was hier angehakt wird, ändert das.",
"binding": "Eine Verbindung im Nur-Lesen-Modus hat ihn erstellt. Nichts, was hier angehakt wird, ändert das."
}
},
"memorySettings": {
"titleOn": "Gedächtnis ist an",
"titleOff": "Gedächtnis ist aus",
"ledeOn": "Deine Chats führen kurze Notizen über dich und lesen sie, bevor sie antworten. Schalte es aus, damit nirgends mehr gelesen oder gespeichert wird. Deine Notizen bleiben, wo sie sind.",
"ledeOff": "Aus deinen Notizen wird nichts gelesen und nichts darin gespeichert, in keinem Chat und bei keinem Agenten. Der Assistent sagt, dass das Gedächtnis aus ist, wenn du ihn bittest, sich etwas zu merken. Deine Notizen bleiben, und du kannst sie weiter lesen, exportieren und löschen.",
"on": "An",
"off": "Aus",
"unavailable": "Notizen sind Dateien, und Dateien sind auf diesem Server aus. Das Gedächtnis kann hier nicht arbeiten.",
"saveTitle": "Eine Notiz speichern",
"saveLede": "Was passiert, wenn der Assistent etwas behalten will. Die strengste Regel gilt immer.",
"save": {
"ask": {
"title": "Erst fragen",
"body": "Eine Karte wartet im Chat. Du bestätigst, bearbeitest oder verwirfst sie."
},
"auto": {
"title": "Speichern und Bescheid geben",
"body": "In deinen eigenen Chats wird die Notiz sofort gespeichert. Der Chat zeigt „Im Gedächtnis gespeichert“ mit Rückgängig. Bis zu 5 Notizen pro Antwort. Eine lange Notiz oder eine, die wie ein Geheimnis aussieht, wartet trotzdem auf dich."
},
"never": {
"title": "Nie",
"body": "Der Assistent kann keine Notizen speichern. Er sagt dir, dass das Speichern aus ist."
}
},
"default": "Standard",
"saveNote": "Chats aus Messaging-Apps fragen immer zuerst. Hintergrundläufe und Trigger speichern nie eine Notiz. Ein gespeicherter Agent darf mehr fragen, aber nie weniger als du hier gewählt hast.",
"saveFailed": "Deine Auswahl konnte nicht gespeichert werden.",
"loadError": "Die Gedächtnis-Einstellungen konnten nicht geladen werden.",
"notesTitle": "Notizen verwalten",
"notesLede": "Lesen, bearbeiten, exportieren oder löschen. Das geht auch, wenn das Gedächtnis aus ist.",
"export": "Exportieren"
},
"memoryOff": {
"title": "Das Gedächtnis ist hier aus.",
"line": {
"chat": "Das ist ein privater Chat: nichts wird gelesen oder gespeichert. Deine Notizen bleiben unberührt. Schalte es im Werkzeugmenü an.",
"user": "Kein Chat und kein Agent liest oder speichert Notizen, und deine Notizen bleiben unberührt.",
"agent": "Beim Agenten dieses Chats ist das Gedächtnis ausgeschaltet.",
"files": "Notizen sind Dateien, und Dateien sind auf diesem Server aus."
},
"chip": "Gedächtnis aus",
"chipPrivate": "Privater Chat",
"fixUser": "Einstellungen, Gedächtnis",
"userRow": "In deinen Einstellungen aus. Schalte es unter Einstellungen, Gedächtnis an."
}
}
@@ -251,7 +251,9 @@
"triggers_run": "Let triggers start from messaging apps",
"talkback_channels": "Reply on known channels",
"files_upload": "Receive files from messaging apps"
}
},
"memoryOffUser": "Memory is off in your settings, so this agent reads and saves no notes, whatever you set here.",
"memoryOffFix": "Settings, Memory"
},
"status": {
"title": "Status",
@@ -376,7 +376,8 @@
"media": "Images and audio",
"collections": "Knowledge",
"subagents": "Sub-agents",
"changes": "Suggested changes"
"changes": "Suggested changes",
"memory": "Memory"
},
"builtinBy": "{{tools}} · built-in",
"builtinByAddon": "{{tools}} · served by {{provider}}",
@@ -452,7 +453,8 @@
"subagents": "Lets the model start a sub-agent for one task and get its report.",
"saved_agents": "Lets the model start one of your saved agents as a sub-agent.",
"triggers": "Lets the model propose, list, change and delete triggers. You confirm each new trigger or change.",
"changes": "Lets the model propose edits to your notes, its rules, skills, pages and dashboard. You confirm each one."
"changes": "Lets the model propose edits to your notes, its rules, skills, pages and dashboard. You confirm each one.",
"memory": "The model can read your notes before it answers and save new ones. Turn it off to make this a private chat: nothing is read from your notes or saved to them. Your other chats are not affected."
},
"whenOff": {
"shell": "The model can write files but cannot run anything.",
@@ -463,7 +465,8 @@
"subagents": "The model works alone.",
"saved_agents": "The model cannot see or start your saved agents.",
"triggers": "The model cannot propose or manage triggers.",
"changes": "The model cannot propose edits to your notes, its rules, skills, pages or dashboard."
"changes": "The model cannot propose edits to your notes, its rules, skills, pages or dashboard.",
"memory": "This is a private chat. The model neither reads nor saves your notes."
},
"addonDescribe_one": "Gives the model {{count}} tool from this add-on.",
"addonDescribe_other": "Gives the model {{count}} tools from this add-on.",
@@ -1139,7 +1142,7 @@
"deleteYes": "Delete",
"confirmDelete": "Delete {{name}}?",
"deleted": "Moved {{name}} to the Trash.",
"clear": "Clear all notes",
"clear": "Forget everything",
"clearAsk_one": "Delete {{count}} file? It moves to the Trash and you can restore it from Files.",
"clearAsk_other": "Delete {{count}} files? They move to the Trash and you can restore them from Files.",
"clearYes_one": "Delete {{count}} file",
@@ -1168,5 +1171,50 @@
"declared": "It was set up to read and report only. Nothing ticked here changes that.",
"binding": "A connection in read only mode made it. Nothing ticked here changes that."
}
},
"memorySettings": {
"titleOn": "Memory is on",
"titleOff": "Memory is off",
"ledeOn": "Your chats keep short notes about you and read them before they answer. Turn it off to stop reading and saving everywhere. Your notes stay where they are.",
"ledeOff": "Nothing is read from your notes or saved to them, in any chat or agent. The assistant says that memory is off if you ask it to remember something. Your notes stay, and you can still read, export and delete them.",
"on": "On",
"off": "Off",
"unavailable": "Notes are files, and files are off on this server, so memory cannot work here.",
"saveTitle": "Saving a note",
"saveLede": "What happens when the assistant wants to keep something. The strictest rule always wins.",
"save": {
"ask": {
"title": "Ask me first",
"body": "A card waits in the chat. You confirm, edit or dismiss it."
},
"auto": {
"title": "Save it and tell me",
"body": "In your own chats the note is saved at once. The chat shows \"Saved to memory\" with an Undo. Up to 5 notes a reply. A long note, or one that looks like a secret, still waits for you."
},
"never": {
"title": "Never",
"body": "The assistant cannot save notes. It tells you that saving is off."
}
},
"default": "Default",
"saveNote": "Chats from messaging apps always ask first. Background runs and triggers never save a note. A saved agent can ask more, never less, than you chose here.",
"saveFailed": "Could not store your choice.",
"loadError": "Could not load your memory settings.",
"notesTitle": "Manage your notes",
"notesLede": "Read, edit, export or delete them. This works while memory is off.",
"export": "Export"
},
"memoryOff": {
"title": "Memory is off here.",
"line": {
"chat": "This is a private chat: nothing is read or saved. Your notes are untouched. Turn it on in the Tools menu.",
"user": "No chat or agent reads or saves notes, and your notes are untouched.",
"agent": "The agent of this chat has memory switched off.",
"files": "Notes are files, and files are off on this server."
},
"chip": "Memory off",
"chipPrivate": "Private chat",
"fixUser": "Settings, Memory",
"userRow": "Off in your settings. Turn it on in Settings, Memory."
}
}
@@ -148,7 +148,9 @@
"triggers_run": "Dejar que los disparadores empiecen desde aplicaciones de mensajería",
"talkback_channels": "Responder en canales conocidos",
"files_upload": "Recibir archivos de aplicaciones de mensajería"
}
},
"memoryOffUser": "La memoria está desactivada en tus ajustes, así que este agente no lee ni guarda notas, hagas lo que hagas aquí.",
"memoryOffFix": "Ajustes, Memoria"
},
"run": {
"workingLine": "Working"
@@ -328,7 +328,8 @@
"media": "Imágenes y audio",
"collections": "Conocimiento",
"subagents": "Subagentes",
"changes": "Cambios sugeridos"
"changes": "Cambios sugeridos",
"memory": "Memoria"
},
"builtinBy": "{{tools}} · integradas",
"builtinByAddon": "{{tools}} · servidas por {{provider}}",
@@ -350,7 +351,8 @@
"subagents": "El modelo puede iniciar un subagente para una tarea y recibir su informe.",
"saved_agents": "El modelo puede iniciar uno de tus agentes guardados como subagente.",
"triggers": "El modelo puede proponer, listar, cambiar y borrar disparadores. Tú confirmas cada disparador nuevo o cambio.",
"changes": "El modelo puede proponer cambios en tus notas, sus reglas, skills, páginas y el panel. Tú confirmas cada uno."
"changes": "El modelo puede proponer cambios en tus notas, sus reglas, skills, páginas y el panel. Tú confirmas cada uno.",
"memory": "El modelo puede leer tus notas antes de responder y guardar otras nuevas. Desactívala para hacer de este un chat privado: no se lee nada de tus notas ni se guarda nada en ellas. Tus otros chats no cambian."
},
"whenOff": {
"shell": "El modelo puede escribir archivos pero no puede ejecutar nada.",
@@ -361,7 +363,8 @@
"subagents": "El modelo trabaja solo.",
"saved_agents": "El modelo no puede ver ni iniciar tus agentes guardados.",
"triggers": "El modelo no puede proponer ni gestionar disparadores.",
"changes": "El modelo no puede proponer cambios en tus notas, sus reglas, skills, páginas ni el panel."
"changes": "El modelo no puede proponer cambios en tus notas, sus reglas, skills, páginas ni el panel.",
"memory": "Es un chat privado. El modelo ni lee ni guarda tus notas."
},
"addonDescribe_one": "Da al modelo {{count}} herramienta de este add-on.",
"addonDescribe_other": "Da al modelo {{count}} herramientas de este add-on.",
@@ -817,7 +820,7 @@
"deleteYes": "Eliminar",
"confirmDelete": "¿Eliminar {{name}}?",
"deleted": "{{name}} movido a la Papelera.",
"clear": "Borrar todas las notas",
"clear": "Olvidar todo",
"clearAsk_one": "¿Eliminar {{count}} archivo? Va a la Papelera y puedes restaurarlo desde Archivos.",
"clearAsk_other": "¿Eliminar {{count}} archivos? Van a la Papelera y puedes restaurarlos desde Archivos.",
"clearYes_one": "Eliminar {{count}} archivo",
@@ -846,5 +849,50 @@
"declared": "Se creó para leer e informar solamente. Nada de lo que marques aquí lo cambia.",
"binding": "La creó una conexión en modo de solo lectura. Nada de lo que marques aquí lo cambia."
}
},
"memorySettings": {
"titleOn": "La memoria está activada",
"titleOff": "La memoria está desactivada",
"ledeOn": "Tus chats guardan notas breves sobre ti y las leen antes de responder. Desactívala para dejar de leer y guardar en todas partes. Tus notas se quedan donde están.",
"ledeOff": "No se lee nada de tus notas ni se guarda nada en ellas, en ningún chat ni agente. El asistente dice que la memoria está desactivada si le pides que recuerde algo. Tus notas se quedan y puedes seguir leyéndolas, exportándolas y borrándolas.",
"on": "Sí",
"off": "No",
"unavailable": "Las notas son archivos, y los archivos están desactivados en este servidor, así que la memoria no puede funcionar aquí.",
"saveTitle": "Guardar una nota",
"saveLede": "Qué pasa cuando el asistente quiere conservar algo. Siempre gana la regla más estricta.",
"save": {
"ask": {
"title": "Preguntarme antes",
"body": "Una tarjeta espera en el chat. Tú la confirmas, la editas o la descartas."
},
"auto": {
"title": "Guardar y avisarme",
"body": "En tus propios chats la nota se guarda al instante. El chat muestra «Guardado en la memoria» con Deshacer. Hasta 5 notas por respuesta. Una nota larga, o una que parece un secreto, sigue esperando tu confirmación."
},
"never": {
"title": "Nunca",
"body": "El asistente no puede guardar notas. Te dice que guardar está desactivado."
}
},
"default": "Predeterminado",
"saveNote": "Los chats de apps de mensajería siempre preguntan antes. Las ejecuciones en segundo plano y los disparadores nunca guardan una nota. Un agente guardado puede preguntar más, nunca menos, de lo que elijas aquí.",
"saveFailed": "No se pudo guardar tu elección.",
"loadError": "No se pudieron cargar los ajustes de memoria.",
"notesTitle": "Gestionar tus notas",
"notesLede": "Léelas, edítalas, expórtalas o bórralas. Funciona aunque la memoria esté desactivada.",
"export": "Exportar"
},
"memoryOff": {
"title": "La memoria está desactivada aquí.",
"line": {
"chat": "Es un chat privado: no se lee ni se guarda nada. Tus notas no se tocan. Actívala en el menú de herramientas.",
"user": "Ningún chat ni agente lee o guarda notas, y tus notas no se tocan.",
"agent": "El agente de este chat tiene la memoria desactivada.",
"files": "Las notas son archivos, y los archivos están desactivados en este servidor."
},
"chip": "Memoria off",
"chipPrivate": "Chat privado",
"fixUser": "Ajustes, Memoria",
"userRow": "Desactivada en tus ajustes. Actívala en Ajustes, Memoria."
}
}
@@ -148,7 +148,9 @@
"triggers_run": "Laisser les déclencheurs démarrer depuis les applications de messagerie",
"talkback_channels": "Répondre sur les canaux connus",
"files_upload": "Recevoir des fichiers des applications de messagerie"
}
},
"memoryOffUser": "La mémoire est désactivée dans vos réglages : cet agent ne lit ni n'enregistre de notes, quoi que vous choisissiez ici.",
"memoryOffFix": "Réglages, Mémoire"
},
"run": {
"workingLine": "Working"
@@ -328,7 +328,8 @@
"media": "Images et audio",
"collections": "Connaissances",
"subagents": "Sous-agents",
"changes": "Modifications suggérées"
"changes": "Modifications suggérées",
"memory": "Mémoire"
},
"builtinBy": "{{tools}} · intégrés",
"builtinByAddon": "{{tools}} · fournis par {{provider}}",
@@ -350,7 +351,8 @@
"subagents": "Le modèle peut lancer un sous-agent pour une tâche et recevoir son rapport.",
"saved_agents": "Le modèle peut lancer l'un de vos agents enregistrés comme sous-agent.",
"triggers": "Le modèle peut proposer, lister, modifier et supprimer des déclencheurs. Vous confirmez chaque nouveau déclencheur ou changement.",
"changes": "Le modèle peut proposer des modifications de vos notes, de ses règles, des skills, des pages et du tableau de bord. Vous confirmez chacune."
"changes": "Le modèle peut proposer des modifications de vos notes, de ses règles, des skills, des pages et du tableau de bord. Vous confirmez chacune.",
"memory": "Le modèle peut lire vos notes avant de répondre et en enregistrer de nouvelles. Désactivez-la pour rendre cette conversation privée : rien n'est lu dans vos notes ni enregistré dedans. Vos autres conversations ne changent pas."
},
"whenOff": {
"shell": "Le modèle peut écrire des fichiers mais ne peut rien exécuter.",
@@ -361,7 +363,8 @@
"subagents": "Le modèle travaille seul.",
"saved_agents": "Le modèle ne peut ni voir ni lancer vos agents enregistrés.",
"triggers": "Le modèle ne peut ni proposer ni gérer de déclencheurs.",
"changes": "Le modèle ne peut pas proposer de modifications de vos notes, de ses règles, des skills, des pages ou du tableau de bord."
"changes": "Le modèle ne peut pas proposer de modifications de vos notes, de ses règles, des skills, des pages ou du tableau de bord.",
"memory": "C'est une conversation privée. Le modèle ne lit ni n'enregistre vos notes."
},
"addonDescribe_one": "Donne au modèle {{count}} outil de cet add-on.",
"addonDescribe_other": "Donne au modèle {{count}} outils de cet add-on.",
@@ -817,7 +820,7 @@
"deleteYes": "Supprimer",
"confirmDelete": "Supprimer {{name}} ?",
"deleted": "{{name}} déplacé dans la corbeille.",
"clear": "Effacer toutes les notes",
"clear": "Tout oublier",
"clearAsk_one": "Supprimer {{count}} fichier ? Il va dans la corbeille et se restaure depuis Fichiers.",
"clearAsk_other": "Supprimer {{count}} fichiers ? Ils vont dans la corbeille et se restaurent depuis Fichiers.",
"clearYes_one": "Supprimer {{count}} fichier",
@@ -846,5 +849,50 @@
"declared": "Il a été créé pour lire et rendre compte seulement. Rien de ce qui est coché ici ne change cela.",
"binding": "Une connexion en lecture seule l'a créé. Rien de ce qui est coché ici ne change cela."
}
},
"memorySettings": {
"titleOn": "La mémoire est activée",
"titleOff": "La mémoire est désactivée",
"ledeOn": "Vos conversations gardent de courtes notes sur vous et les lisent avant de répondre. Désactivez-la pour ne plus rien lire ni enregistrer nulle part. Vos notes restent où elles sont.",
"ledeOff": "Rien n'est lu dans vos notes ni enregistré dedans, dans aucune conversation ni aucun agent. L'assistant dit que la mémoire est désactivée si vous lui demandez de retenir quelque chose. Vos notes restent, et vous pouvez toujours les lire, les exporter et les supprimer.",
"on": "Oui",
"off": "Non",
"unavailable": "Les notes sont des fichiers, et les fichiers sont désactivés sur ce serveur : la mémoire ne peut pas fonctionner ici.",
"saveTitle": "Enregistrer une note",
"saveLede": "Ce qui se passe quand l'assistant veut retenir quelque chose. La règle la plus stricte l'emporte toujours.",
"save": {
"ask": {
"title": "Me demander d'abord",
"body": "Une carte attend dans la conversation. Vous la confirmez, la modifiez ou l'écartez."
},
"auto": {
"title": "Enregistrer et me prévenir",
"body": "Dans vos propres conversations, la note est enregistrée tout de suite. La conversation affiche « Enregistré dans la mémoire » avec Annuler. Jusqu'à 5 notes par réponse. Une note longue, ou qui ressemble à un secret, attend quand même votre accord."
},
"never": {
"title": "Jamais",
"body": "L'assistant ne peut pas enregistrer de notes. Il vous dit que l'enregistrement est désactivé."
}
},
"default": "Par défaut",
"saveNote": "Les conversations des applications de messagerie demandent toujours d'abord. Les exécutions en arrière-plan et les déclencheurs n'enregistrent jamais de note. Un agent enregistré peut demander plus, jamais moins, que ce que vous choisissez ici.",
"saveFailed": "Impossible d'enregistrer votre choix.",
"loadError": "Impossible de charger vos réglages de mémoire.",
"notesTitle": "Gérer vos notes",
"notesLede": "Lisez, modifiez, exportez ou supprimez-les. Cela marche même quand la mémoire est désactivée.",
"export": "Exporter"
},
"memoryOff": {
"title": "La mémoire est désactivée ici.",
"line": {
"chat": "C'est une conversation privée : rien n'est lu ni enregistré. Vos notes ne sont pas touchées. Activez-la dans le menu des outils.",
"user": "Aucune conversation ni aucun agent ne lit ou n'enregistre de notes, et vos notes ne sont pas touchées.",
"agent": "L'agent de cette conversation a désactivé la mémoire.",
"files": "Les notes sont des fichiers, et les fichiers sont désactivés sur ce serveur."
},
"chip": "Mémoire off",
"chipPrivate": "Conversation privée",
"fixUser": "Réglages, Mémoire",
"userRow": "Désactivée dans vos réglages. Activez-la dans Réglages, Mémoire."
}
}
@@ -148,7 +148,9 @@
"triggers_run": "Biarkan pemicu dimulai dari aplikasi pesan",
"talkback_channels": "Membalas di kanal yang dikenal",
"files_upload": "Menerima file dari aplikasi pesan"
}
},
"memoryOffUser": "Memori nonaktif di pengaturan Anda, jadi agen ini tidak membaca atau menyimpan catatan, apa pun yang Anda atur di sini.",
"memoryOffFix": "Pengaturan, Memori"
},
"run": {
"workingLine": "Working"
@@ -328,7 +328,8 @@
"media": "Gambar dan audio",
"collections": "Pengetahuan",
"subagents": "Sub-agen",
"changes": "Perubahan yang disarankan"
"changes": "Perubahan yang disarankan",
"memory": "Memori"
},
"builtinBy": "{{tools}} · bawaan",
"builtinByAddon": "{{tools}} · dilayani oleh {{provider}}",
@@ -350,7 +351,8 @@
"subagents": "Model dapat memulai sub-agen untuk satu tugas dan menerima laporannya.",
"saved_agents": "Model dapat memulai salah satu agen tersimpan Anda sebagai sub-agen.",
"triggers": "Model dapat mengusulkan, mencantumkan, mengubah, dan menghapus pemicu. Anda mengonfirmasi setiap pemicu atau perubahan baru.",
"changes": "Model dapat mengusulkan perubahan pada catatan Anda, aturannya, skill, halaman, dan dasbor. Anda mengonfirmasi setiap perubahan."
"changes": "Model dapat mengusulkan perubahan pada catatan Anda, aturannya, skill, halaman, dan dasbor. Anda mengonfirmasi setiap perubahan.",
"memory": "Model dapat membaca catatan Anda sebelum menjawab dan menyimpan yang baru. Matikan untuk menjadikan ini obrolan pribadi: tidak ada yang dibaca dari catatan Anda atau disimpan ke dalamnya. Obrolan Anda yang lain tidak terpengaruh."
},
"whenOff": {
"shell": "Model dapat menulis berkas tetapi tidak dapat menjalankan apa pun.",
@@ -361,7 +363,8 @@
"subagents": "Model bekerja sendiri.",
"saved_agents": "Model tidak dapat melihat atau memulai agen tersimpan Anda.",
"triggers": "Model tidak dapat mengusulkan atau mengelola pemicu.",
"changes": "Model tidak dapat mengusulkan perubahan pada catatan Anda, aturannya, skill, halaman, atau dasbor."
"changes": "Model tidak dapat mengusulkan perubahan pada catatan Anda, aturannya, skill, halaman, atau dasbor.",
"memory": "Ini obrolan pribadi. Model tidak membaca maupun menyimpan catatan Anda."
},
"addonDescribe_one": "Memberi model {{count}} alat dari add-on ini.",
"addonDescribe_other": "Memberi model {{count}} alat dari add-on ini.",
@@ -817,7 +820,7 @@
"deleteYes": "Hapus",
"confirmDelete": "Hapus {{name}}?",
"deleted": "{{name}} dipindahkan ke Tempat Sampah.",
"clear": "Hapus semua catatan",
"clear": "Lupakan semuanya",
"clearAsk_one": "Hapus {{count}} berkas? Berkas dipindahkan ke Tempat Sampah dan dapat dipulihkan dari Berkas.",
"clearAsk_other": "Hapus {{count}} berkas? Berkas dipindahkan ke Tempat Sampah dan dapat dipulihkan dari Berkas.",
"clearYes_one": "Hapus {{count}} berkas",
@@ -846,5 +849,50 @@
"declared": "Ini dibuat untuk hanya membaca dan melapor. Centangan di sini tidak mengubahnya.",
"binding": "Dibuat oleh koneksi dalam mode hanya baca. Centangan di sini tidak mengubahnya."
}
},
"memorySettings": {
"titleOn": "Memori aktif",
"titleOff": "Memori nonaktif",
"ledeOn": "Obrolan Anda menyimpan catatan singkat tentang Anda dan membacanya sebelum menjawab. Matikan untuk berhenti membaca dan menyimpan di mana pun. Catatan Anda tetap di tempatnya.",
"ledeOff": "Tidak ada yang dibaca dari catatan Anda atau disimpan ke dalamnya, di obrolan atau agen mana pun. Asisten akan mengatakan bahwa memori nonaktif jika Anda memintanya mengingat sesuatu. Catatan Anda tetap ada, dan Anda masih bisa membaca, mengekspor, dan menghapusnya.",
"on": "Aktif",
"off": "Mati",
"unavailable": "Catatan adalah berkas, dan berkas dinonaktifkan di server ini, jadi memori tidak dapat bekerja di sini.",
"saveTitle": "Menyimpan catatan",
"saveLede": "Apa yang terjadi saat asisten ingin menyimpan sesuatu. Aturan yang paling ketat selalu menang.",
"save": {
"ask": {
"title": "Tanya saya dulu",
"body": "Sebuah kartu menunggu di obrolan. Anda mengonfirmasi, mengedit, atau menolaknya."
},
"auto": {
"title": "Simpan dan beri tahu saya",
"body": "Di obrolan Anda sendiri, catatan langsung disimpan. Obrolan menampilkan \"Disimpan ke memori\" dengan Urungkan. Hingga 5 catatan per balasan. Catatan yang panjang, atau yang tampak seperti rahasia, tetap menunggu Anda."
},
"never": {
"title": "Jangan pernah",
"body": "Asisten tidak dapat menyimpan catatan. Ia akan memberi tahu bahwa penyimpanan nonaktif."
}
},
"default": "Bawaan",
"saveNote": "Obrolan dari aplikasi pesan selalu bertanya dulu. Proses latar belakang dan pemicu tidak pernah menyimpan catatan. Agen tersimpan boleh bertanya lebih banyak, tidak pernah lebih sedikit, daripada pilihan Anda di sini.",
"saveFailed": "Pilihan Anda tidak dapat disimpan.",
"loadError": "Pengaturan memori Anda tidak dapat dimuat.",
"notesTitle": "Kelola catatan Anda",
"notesLede": "Baca, edit, ekspor, atau hapus. Ini berfungsi saat memori nonaktif.",
"export": "Ekspor"
},
"memoryOff": {
"title": "Memori nonaktif di sini.",
"line": {
"chat": "Ini obrolan pribadi: tidak ada yang dibaca atau disimpan. Catatan Anda tidak disentuh. Aktifkan di menu Alat.",
"user": "Tidak ada obrolan atau agen yang membaca atau menyimpan catatan, dan catatan Anda tidak disentuh.",
"agent": "Agen obrolan ini menonaktifkan memori.",
"files": "Catatan adalah berkas, dan berkas dinonaktifkan di server ini."
},
"chip": "Memori mati",
"chipPrivate": "Obrolan pribadi",
"fixUser": "Pengaturan, Memori",
"userRow": "Nonaktif di pengaturan Anda. Aktifkan di Pengaturan, Memori."
}
}
@@ -148,7 +148,9 @@
"triggers_run": "Lascia partire i trigger dalle app di messaggistica",
"talkback_channels": "Rispondere sui canali noti",
"files_upload": "Ricevere file dalle app di messaggistica"
}
},
"memoryOffUser": "La memoria è disattivata nelle tue impostazioni, quindi questo agente non legge né salva note, qualunque cosa imposti qui.",
"memoryOffFix": "Impostazioni, Memoria"
},
"run": {
"workingLine": "Working"
@@ -328,7 +328,8 @@
"media": "Immagini e audio",
"collections": "Conoscenza",
"subagents": "Sotto-agenti",
"changes": "Modifiche suggerite"
"changes": "Modifiche suggerite",
"memory": "Memoria"
},
"builtinBy": "{{tools}} · integrati",
"builtinByAddon": "{{tools}} · servito da {{provider}}",
@@ -350,7 +351,8 @@
"subagents": "Il modello può avviare un sotto-agente per un compito e ricevere il suo rapporto.",
"saved_agents": "Il modello può avviare uno dei tuoi agenti salvati come sotto-agente.",
"triggers": "Il modello può proporre, elencare, modificare ed eliminare trigger. Confermi tu ogni nuovo trigger o modifica.",
"changes": "Il modello può proporre modifiche alle tue note, alle sue regole, alle skill, alle pagine e alla dashboard. Confermi tu ognuna."
"changes": "Il modello può proporre modifiche alle tue note, alle sue regole, alle skill, alle pagine e alla dashboard. Confermi tu ognuna.",
"memory": "Il modello può leggere le tue note prima di rispondere e salvarne di nuove. Disattivala per rendere questa una chat privata: non si legge nulla dalle tue note e non si salva nulla in esse. Le altre chat non cambiano."
},
"whenOff": {
"shell": "Il modello può scrivere file ma non può eseguire nulla.",
@@ -361,7 +363,8 @@
"subagents": "Il modello lavora da solo.",
"saved_agents": "Il modello non può vedere né avviare i tuoi agenti salvati.",
"triggers": "Il modello non può proporre né gestire trigger.",
"changes": "Il modello non può proporre modifiche alle tue note, alle sue regole, alle skill, alle pagine o alla dashboard."
"changes": "Il modello non può proporre modifiche alle tue note, alle sue regole, alle skill, alle pagine o alla dashboard.",
"memory": "È una chat privata. Il modello non legge né salva le tue note."
},
"addonDescribe_one": "Dà al modello {{count}} strumento di questo add-on.",
"addonDescribe_other": "Dà al modello {{count}} strumenti di questo add-on.",
@@ -817,7 +820,7 @@
"deleteYes": "Elimina",
"confirmDelete": "Eliminare {{name}}?",
"deleted": "{{name}} spostato nel Cestino.",
"clear": "Cancella tutte le note",
"clear": "Dimentica tutto",
"clearAsk_one": "Eliminare {{count}} file? Va nel Cestino e puoi ripristinarlo da File.",
"clearAsk_other": "Eliminare {{count}} file? Vanno nel Cestino e puoi ripristinarli da File.",
"clearYes_one": "Elimina {{count}} file",
@@ -846,5 +849,50 @@
"declared": "È stato creato per leggere e riferire soltanto. Nulla di ciò che spunti qui lo cambia.",
"binding": "L'ha creato una connessione in sola lettura. Nulla di ciò che spunti qui lo cambia."
}
},
"memorySettings": {
"titleOn": "La memoria è attiva",
"titleOff": "La memoria è disattivata",
"ledeOn": "Le tue chat conservano brevi note su di te e le leggono prima di rispondere. Disattivala per smettere di leggere e salvare ovunque. Le tue note restano dove sono.",
"ledeOff": "Non si legge nulla dalle tue note e non si salva nulla in esse, in nessuna chat o agente. L'assistente dice che la memoria è disattivata se gli chiedi di ricordare qualcosa. Le tue note restano e puoi ancora leggerle, esportarle ed eliminarle.",
"on": "Sì",
"off": "No",
"unavailable": "Le note sono file, e i file sono disattivati su questo server, quindi la memoria qui non può funzionare.",
"saveTitle": "Salvare una nota",
"saveLede": "Cosa succede quando l'assistente vuole conservare qualcosa. Vince sempre la regola più severa.",
"save": {
"ask": {
"title": "Chiedimi prima",
"body": "Una scheda aspetta nella chat. Tu la confermi, la modifichi o la scarti."
},
"auto": {
"title": "Salva e avvisami",
"body": "Nelle tue chat la nota viene salvata subito. La chat mostra «Salvato in memoria» con Annulla. Fino a 5 note per risposta. Una nota lunga, o che sembra un segreto, aspetta comunque te."
},
"never": {
"title": "Mai",
"body": "L'assistente non può salvare note. Ti dice che il salvataggio è disattivato."
}
},
"default": "Predefinito",
"saveNote": "Le chat delle app di messaggistica chiedono sempre prima. Le esecuzioni in background e i trigger non salvano mai una nota. Un agente salvato può chiedere di più, mai di meno, di quanto scegli qui.",
"saveFailed": "Non è stato possibile salvare la tua scelta.",
"loadError": "Non è stato possibile caricare le impostazioni della memoria.",
"notesTitle": "Gestisci le tue note",
"notesLede": "Leggile, modificale, esportale o eliminale. Funziona anche con la memoria disattivata.",
"export": "Esporta"
},
"memoryOff": {
"title": "La memoria è disattivata qui.",
"line": {
"chat": "È una chat privata: non si legge né si salva nulla. Le tue note non vengono toccate. Attivala nel menu degli strumenti.",
"user": "Nessuna chat o agente legge o salva note, e le tue note non vengono toccate.",
"agent": "L'agente di questa chat ha disattivato la memoria.",
"files": "Le note sono file, e i file sono disattivati su questo server."
},
"chip": "Memoria off",
"chipPrivate": "Chat privata",
"fixUser": "Impostazioni, Memoria",
"userRow": "Disattivata nelle tue impostazioni. Attivala in Impostazioni, Memoria."
}
}
@@ -148,7 +148,9 @@
"triggers_run": "메신저 앱에서 트리거 시작 허용",
"talkback_channels": "알려진 채널에 답장",
"files_upload": "메신저 앱에서 파일 받기"
}
},
"memoryOffUser": "설정에서 메모리가 꺼져 있어 여기서 어떻게 정하든 이 에이전트는 메모를 읽거나 저장하지 않습니다.",
"memoryOffFix": "설정, 메모리"
},
"run": {
"workingLine": "Working"
@@ -328,7 +328,8 @@
"media": "이미지와 오디오",
"collections": "지식",
"subagents": "하위 에이전트",
"changes": "제안된 변경"
"changes": "제안된 변경",
"memory": "메모리"
},
"builtinBy": "{{tools}} · 기본 제공",
"builtinByAddon": "{{tools}} · {{provider}}이(가) 제공",
@@ -350,7 +351,8 @@
"subagents": "모델이 작업 하나를 위해 하위 에이전트를 시작하고 보고를 받을 수 있습니다.",
"saved_agents": "모델이 저장된 에이전트 중 하나를 하위 에이전트로 시작할 수 있습니다.",
"triggers": "모델이 트리거를 제안하고, 나열하고, 변경하고, 삭제할 수 있습니다. 새 트리거나 변경은 매번 직접 확인합니다.",
"changes": "모델이 내 노트, 모델 자신의 규칙, 스킬, 페이지, 대시보드의 변경을 제안할 수 있습니다. 매번 직접 확인합니다."
"changes": "모델이 내 노트, 모델 자신의 규칙, 스킬, 페이지, 대시보드의 변경을 제안할 수 있습니다. 매번 직접 확인합니다.",
"memory": "모델이 답하기 전에 메모를 읽고 새 메모를 저장할 수 있습니다. 끄면 이 채팅은 비공개가 되어 메모를 읽거나 저장하지 않습니다. 다른 채팅에는 영향이 없습니다."
},
"whenOff": {
"shell": "모델이 파일은 쓸 수 있지만 아무것도 실행할 수 없습니다.",
@@ -361,7 +363,8 @@
"subagents": "모델이 혼자 일합니다.",
"saved_agents": "모델이 저장된 에이전트를 보거나 시작할 수 없습니다.",
"triggers": "모델이 트리거를 제안하거나 관리할 수 없습니다.",
"changes": "모델이 노트, 모델 자신의 규칙, 스킬, 페이지, 대시보드의 변경을 제안할 수 없습니다."
"changes": "모델이 노트, 모델 자신의 규칙, 스킬, 페이지, 대시보드의 변경을 제안할 수 없습니다.",
"memory": "비공개 채팅입니다. 모델이 메모를 읽거나 저장하지 않습니다."
},
"addonDescribe_one": "이 애드온의 도구 {{count}}개를 모델에 제공합니다.",
"addonDescribe_other": "이 애드온의 도구 {{count}}개를 모델에 제공합니다.",
@@ -817,7 +820,7 @@
"deleteYes": "삭제",
"confirmDelete": "{{name}}을(를) 삭제할까요?",
"deleted": "{{name}}을(를) 휴지통으로 옮겼습니다.",
"clear": "모든 메모 지우기",
"clear": "모두 잊기",
"clearAsk_one": "파일 {{count}}개를 삭제할까요? 휴지통으로 이동하며 파일에서 복원할 수 있습니다.",
"clearAsk_other": "파일 {{count}}개를 삭제할까요? 휴지통으로 이동하며 파일에서 복원할 수 있습니다.",
"clearYes_one": "파일 {{count}}개 삭제",
@@ -846,5 +849,50 @@
"declared": "읽고 보고만 하도록 만들어졌습니다. 여기서 선택해도 바뀌지 않습니다.",
"binding": "읽기 전용 모드의 연결이 만들었습니다. 여기서 선택해도 바뀌지 않습니다."
}
},
"memorySettings": {
"titleOn": "메모리가 켜져 있습니다",
"titleOff": "메모리가 꺼져 있습니다",
"ledeOn": "채팅이 나에 대한 짧은 메모를 보관하고 답하기 전에 읽습니다. 끄면 어디서도 읽거나 저장하지 않습니다. 메모는 그대로 남습니다.",
"ledeOff": "어떤 채팅이나 에이전트에서도 메모를 읽거나 저장하지 않습니다. 기억해 달라고 하면 어시스턴트가 메모리가 꺼져 있다고 말합니다. 메모는 남아 있고, 계속 읽고 내보내고 삭제할 수 있습니다.",
"on": "켬",
"off": "끔",
"unavailable": "메모는 파일이며 이 서버에서는 파일이 꺼져 있어 메모리가 동작할 수 없습니다.",
"saveTitle": "메모 저장",
"saveLede": "어시스턴트가 무언가를 남기려 할 때 일어나는 일입니다. 가장 엄격한 규칙이 항상 우선합니다.",
"save": {
"ask": {
"title": "먼저 물어보기",
"body": "채팅에 카드가 대기합니다. 확인하거나 수정하거나 취소할 수 있습니다."
},
"auto": {
"title": "저장하고 알려주기",
"body": "내 채팅에서는 메모가 바로 저장됩니다. 채팅에 \"메모리에 저장됨\"과 실행 취소가 표시됩니다. 답변당 최대 5개. 긴 메모나 비밀처럼 보이는 메모는 여전히 확인을 기다립니다."
},
"never": {
"title": "안 함",
"body": "어시스턴트가 메모를 저장할 수 없습니다. 저장이 꺼져 있다고 알려줍니다."
}
},
"default": "기본값",
"saveNote": "메시징 앱의 채팅은 항상 먼저 묻습니다. 백그라운드 실행과 트리거는 메모를 저장하지 않습니다. 저장된 에이전트는 여기서 고른 것보다 더 물어볼 수는 있어도 덜 묻지는 않습니다.",
"saveFailed": "선택을 저장하지 못했습니다.",
"loadError": "메모리 설정을 불러오지 못했습니다.",
"notesTitle": "메모 관리",
"notesLede": "읽고, 수정하고, 내보내고, 삭제할 수 있습니다. 메모리가 꺼져 있어도 동작합니다.",
"export": "내보내기"
},
"memoryOff": {
"title": "여기서는 메모리가 꺼져 있습니다.",
"line": {
"chat": "비공개 채팅입니다. 아무것도 읽거나 저장하지 않으며 메모는 그대로입니다. 도구 메뉴에서 켤 수 있습니다.",
"user": "어떤 채팅이나 에이전트도 메모를 읽거나 저장하지 않으며 메모는 그대로입니다.",
"agent": "이 채팅의 에이전트는 메모리를 껐습니다.",
"files": "메모는 파일이며 이 서버에서는 파일이 꺼져 있습니다."
},
"chip": "메모리 꺼짐",
"chipPrivate": "비공개 채팅",
"fixUser": "설정, 메모리",
"userRow": "설정에서 꺼져 있습니다. 설정, 메모리에서 켜세요."
}
}
@@ -148,7 +148,9 @@
"triggers_run": "Deixar gatilhos começarem de aplicativos de mensagens",
"talkback_channels": "Responder em canais conhecidos",
"files_upload": "Receber arquivos de aplicativos de mensagens"
}
},
"memoryOffUser": "A memória está desativada nas suas configurações, então este agente não lê nem salva notas, não importa o que você defina aqui.",
"memoryOffFix": "Configurações, Memória"
},
"run": {
"workingLine": "Working"
@@ -328,7 +328,8 @@
"media": "Imagens e áudio",
"collections": "Conhecimento",
"subagents": "Subagentes",
"changes": "Alterações sugeridas"
"changes": "Alterações sugeridas",
"memory": "Memória"
},
"builtinBy": "{{tools}} · integradas",
"builtinByAddon": "{{tools}} · servidas por {{provider}}",
@@ -350,7 +351,8 @@
"subagents": "O modelo pode iniciar um subagente para uma tarefa e receber o relatório dele.",
"saved_agents": "O modelo pode iniciar um dos seus agentes salvos como subagente.",
"triggers": "O modelo pode propor, listar, alterar e excluir gatilhos. Você confirma cada novo gatilho ou alteração.",
"changes": "O modelo pode propor alterações nas suas notas, nas regras dele, em skills, páginas e no painel. Você confirma cada uma."
"changes": "O modelo pode propor alterações nas suas notas, nas regras dele, em skills, páginas e no painel. Você confirma cada uma.",
"memory": "O modelo pode ler suas notas antes de responder e salvar novas. Desative para tornar este um chat privado: nada é lido das suas notas nem salvo nelas. Seus outros chats não mudam."
},
"whenOff": {
"shell": "O modelo pode escrever arquivos, mas não pode executar nada.",
@@ -361,7 +363,8 @@
"subagents": "O modelo trabalha sozinho.",
"saved_agents": "O modelo não pode ver nem iniciar seus agentes salvos.",
"triggers": "O modelo não pode propor nem gerenciar gatilhos.",
"changes": "O modelo não pode propor alterações nas suas notas, nas regras dele, em skills, páginas ou no painel."
"changes": "O modelo não pode propor alterações nas suas notas, nas regras dele, em skills, páginas ou no painel.",
"memory": "Este é um chat privado. O modelo não lê nem salva suas notas."
},
"addonDescribe_one": "Dá ao modelo {{count}} ferramenta deste add-on.",
"addonDescribe_other": "Dá ao modelo {{count}} ferramentas deste add-on.",
@@ -817,7 +820,7 @@
"deleteYes": "Excluir",
"confirmDelete": "Excluir {{name}}?",
"deleted": "{{name}} movido para a Lixeira.",
"clear": "Limpar todas as notas",
"clear": "Esquecer tudo",
"clearAsk_one": "Excluir {{count}} arquivo? Ele vai para a Lixeira e você pode restaurá-lo em Arquivos.",
"clearAsk_other": "Excluir {{count}} arquivos? Eles vão para a Lixeira e você pode restaurá-los em Arquivos.",
"clearYes_one": "Excluir {{count}} arquivo",
@@ -846,5 +849,50 @@
"declared": "Foi criado para apenas ler e relatar. Nada que você marque aqui muda isso.",
"binding": "Foi criado por uma conexão em modo somente leitura. Nada que você marque aqui muda isso."
}
},
"memorySettings": {
"titleOn": "A memória está ativada",
"titleOff": "A memória está desativada",
"ledeOn": "Seus chats guardam notas curtas sobre você e as leem antes de responder. Desative para parar de ler e salvar em qualquer lugar. Suas notas ficam onde estão.",
"ledeOff": "Nada é lido das suas notas nem salvo nelas, em nenhum chat ou agente. O assistente diz que a memória está desativada se você pedir para ele lembrar de algo. Suas notas ficam, e você ainda pode lê-las, exportá-las e excluí-las.",
"on": "Sim",
"off": "Não",
"unavailable": "As notas são arquivos, e os arquivos estão desativados neste servidor, então a memória não pode funcionar aqui.",
"saveTitle": "Salvar uma nota",
"saveLede": "O que acontece quando o assistente quer guardar algo. A regra mais rígida sempre vence.",
"save": {
"ask": {
"title": "Perguntar antes",
"body": "Um cartão espera no chat. Você confirma, edita ou descarta."
},
"auto": {
"title": "Salvar e me avisar",
"body": "Nos seus próprios chats a nota é salva na hora. O chat mostra \"Salvo na memória\" com Desfazer. Até 5 notas por resposta. Uma nota longa, ou que parece um segredo, ainda espera por você."
},
"never": {
"title": "Nunca",
"body": "O assistente não pode salvar notas. Ele diz que salvar está desativado."
}
},
"default": "Padrão",
"saveNote": "Chats de apps de mensagens sempre perguntam antes. Execuções em segundo plano e gatilhos nunca salvam uma nota. Um agente salvo pode perguntar mais, nunca menos, do que você escolheu aqui.",
"saveFailed": "Não foi possível salvar sua escolha.",
"loadError": "Não foi possível carregar suas configurações de memória.",
"notesTitle": "Gerenciar suas notas",
"notesLede": "Leia, edite, exporte ou exclua. Funciona com a memória desativada.",
"export": "Exportar"
},
"memoryOff": {
"title": "A memória está desativada aqui.",
"line": {
"chat": "Este é um chat privado: nada é lido nem salvo. Suas notas não são tocadas. Ative no menu de ferramentas.",
"user": "Nenhum chat ou agente lê ou salva notas, e suas notas não são tocadas.",
"agent": "O agente deste chat desativou a memória.",
"files": "As notas são arquivos, e os arquivos estão desativados neste servidor."
},
"chip": "Memória off",
"chipPrivate": "Chat privado",
"fixUser": "Configurações, Memória",
"userRow": "Desativada nas suas configurações. Ative em Configurações, Memória."
}
}
@@ -148,7 +148,9 @@
"triggers_run": "允许触发器从消息应用启动",
"talkback_channels": "在已知频道回复",
"files_upload": "从消息应用接收文件"
}
},
"memoryOffUser": "你的设置中记忆已关闭,因此无论这里如何设置,此智能体都不会读取或保存笔记。",
"memoryOffFix": "设置,记忆"
},
"run": {
"workingLine": "Working"
@@ -328,7 +328,8 @@
"media": "图片和音频",
"collections": "知识库",
"subagents": "子代理",
"changes": "建议的更改"
"changes": "建议的更改",
"memory": "记忆"
},
"builtinBy": "{{tools}} · 内置",
"builtinByAddon": "{{tools}} · 由 {{provider}} 提供",
@@ -350,7 +351,8 @@
"subagents": "模型可以为一项任务启动子智能体并获取其报告。",
"saved_agents": "模型可以把你已保存的智能体之一作为子智能体启动。",
"triggers": "模型可以提议、列出、修改和删除触发器。每个新触发器或修改都由你确认。",
"changes": "模型可以提议修改你的笔记、它自己的规则、技能、页面和仪表板。每一项都由你确认。"
"changes": "模型可以提议修改你的笔记、它自己的规则、技能、页面和仪表板。每一项都由你确认。",
"memory": "模型可以在回答前读取你的笔记并保存新的笔记。关闭后此聊天为私密聊天:不读取也不保存你的笔记。你的其他聊天不受影响。"
},
"whenOff": {
"shell": "模型可以写文件,但不能运行任何东西。",
@@ -361,7 +363,8 @@
"subagents": "模型独自工作。",
"saved_agents": "模型看不到也无法启动你保存的智能体。",
"triggers": "模型无法提议或管理触发器。",
"changes": "模型无法提议修改你的笔记、它自己的规则、技能、页面或仪表板。"
"changes": "模型无法提议修改你的笔记、它自己的规则、技能、页面或仪表板。",
"memory": "这是私密聊天。模型不会读取或保存你的笔记。"
},
"addonDescribe_one": "向模型提供此附加组件的 {{count}} 个工具。",
"addonDescribe_other": "向模型提供此附加组件的 {{count}} 个工具。",
@@ -817,7 +820,7 @@
"deleteYes": "删除",
"confirmDelete": "删除 {{name}}?",
"deleted": "已将 {{name}} 移到回收站。",
"clear": "清除所有笔记",
"clear": "全部忘记",
"clearAsk_one": "删除 {{count}} 个文件?文件会移到回收站,可在“文件”中恢复。",
"clearAsk_other": "删除 {{count}} 个文件?文件会移到回收站,可在“文件”中恢复。",
"clearYes_one": "删除 {{count}} 个文件",
@@ -846,5 +849,50 @@
"declared": "它被设置为只读取并汇报。在此勾选不会改变这一点。",
"binding": "它由只读模式的连接创建。在此勾选不会改变这一点。"
}
},
"memorySettings": {
"titleOn": "记忆已开启",
"titleOff": "记忆已关闭",
"ledeOn": "你的聊天会保留关于你的简短笔记,并在回答前读取。关闭后,任何地方都不再读取或保存。笔记保持原样。",
"ledeOff": "在任何聊天或智能体中,都不会读取或保存你的笔记。如果你让助手记住某事,它会说明记忆已关闭。笔记仍然保留,你仍可查看、导出和删除。",
"on": "开",
"off": "关",
"unavailable": "笔记是文件,而此服务器已关闭文件,因此记忆无法在这里工作。",
"saveTitle": "保存笔记",
"saveLede": "助手想要保留某些内容时会发生什么。始终以最严格的规则为准。",
"save": {
"ask": {
"title": "先问我",
"body": "聊天中会出现一张卡片。你可以确认、编辑或忽略。"
},
"auto": {
"title": "保存并告知我",
"body": "在你自己的聊天中,笔记会立即保存。聊天会显示“已保存到记忆”和撤销。每次回复最多 5 条。过长或看起来像机密的笔记仍需你确认。"
},
"never": {
"title": "从不",
"body": "助手不能保存笔记,并会告诉你保存已关闭。"
}
},
"default": "默认",
"saveNote": "来自消息应用的聊天总是先询问。后台运行和触发器从不保存笔记。已保存的智能体可以比这里的选择问得更多,但不会更少。",
"saveFailed": "无法保存你的选择。",
"loadError": "无法加载你的记忆设置。",
"notesTitle": "管理你的笔记",
"notesLede": "可以查看、编辑、导出或删除。记忆关闭时同样可用。",
"export": "导出"
},
"memoryOff": {
"title": "此处记忆已关闭。",
"line": {
"chat": "这是私密聊天:不读取也不保存任何内容,你的笔记不受影响。可在工具菜单中开启。",
"user": "没有任何聊天或智能体会读取或保存笔记,你的笔记不受影响。",
"agent": "此聊天的智能体已关闭记忆。",
"files": "笔记是文件,而此服务器已关闭文件。"
},
"chip": "记忆已关",
"chipPrivate": "私密聊天",
"fixUser": "设置,记忆",
"userRow": "已在你的设置中关闭。请在“设置,记忆”中开启。"
}
}
@@ -0,0 +1,85 @@
/* eslint-disable no-unused-vars -- components used only inside JSX look unused to this config, which has no eslint-plugin-react */
import { useId } from 'react'
import { useTranslation } from 'react-i18next'
import { useMemorySettings } from '../hooks/useMemorySettings'
import Icon from './Icon'
import { Callout, LoadError, SkeletonRows, Switch } from './ui'
import './memorysettings.css'
// The ways a note is saved, in the order they are listed. The value is what the
// server stores; the default is the one a person who never chose gets.
export const SAVE_LEVELS = [
{ value: 'ask', isDefault: true },
{ value: 'auto' },
{ value: 'never' },
]
// Settings > Memory, the controls: the On or Off switch first, then how a note
// is saved. The notes themselves (MemoryTab) sit below. The page is laid out in
// sections that share one card, so the provider choice, the rule for messaging
// apps and the scope of an agent can take their place later without a new
// page.
export default function MemorySettings({ addToast, children }) {
const { t } = useTranslation('chats')
const { settings, error, saving, reload, change } = useMemorySettings()
const titleId = useId()
const ledeId = useId()
const saveId = useId()
const notesId = useId()
const notes = (
<section className="ms-notes" aria-labelledby={notesId} data-testid="memory-notes-section">
<div className="ms-notes-head">
<h3 className="ms-h" id={notesId}>{t('memorySettings.notesTitle')}</h3>
<p className="ms-p">{t('memorySettings.notesLede')}</p>
</div>
{children}
</section>
)
if (error && !settings) return <div className="ms-page" data-testid="memory-settings"><LoadError title={t('memorySettings.loadError')} error={error} onRetry={reload} testId="memory-settings-error" />{notes}</div>
if (!settings) return <div className="ms-page" data-testid="memory-settings"><SkeletonRows count={2} />{notes}</div>
const on = settings.enabled
const store = async (body) => {
if (!(await change(body))) addToast?.(t('memorySettings.saveFailed'), 'error')
}
return (
<div className="ms-page" data-testid="memory-settings">
<section className={`ms-card ms-switch${on ? '' : ' ms-switch--off'}`} aria-labelledby={titleId} data-testid="memory-switch-card" data-state={on ? 'on' : 'off'}>
<div className="ms-switch__text">
<h3 className="ms-h" id={titleId}>{on ? t('memorySettings.titleOn') : t('memorySettings.titleOff')}</h3>
<p className="ms-p" id={ledeId}>{on ? t('memorySettings.ledeOn') : t('memorySettings.ledeOff')}</p>
{!settings.available && <p className="ms-p ms-p--warn" data-testid="memory-unavailable">{t('memorySettings.unavailable')}</p>}
</div>
<div className="ms-switch__ctl">
<span className="ms-switch__word" aria-hidden="true">{t('memorySettings.off')}</span>
<Switch checked={on} disabled={saving} labelledBy={titleId} describedBy={ledeId} testId="memory-switch" onChange={(next) => store({ enabled: next })} />
<span className="ms-switch__word" aria-hidden="true">{t('memorySettings.on')}</span>
</div>
</section>
{error && <Callout tone="error" role="alert" testId="memory-settings-save-error">{error.message}</Callout>}
<section className="ms-card" aria-labelledby={saveId} data-testid="memory-save-card">
<h3 className="ms-h" id={saveId}>{t('memorySettings.saveTitle')}</h3>
<p className="ms-p">{t('memorySettings.saveLede')}</p>
<div className="ms-levels" role="radiogroup" aria-labelledby={saveId}>
{SAVE_LEVELS.map((lv) => {
const checked = settings.save_mode === lv.value
return (
<label key={lv.value} className={`ms-level${checked ? ' ms-level--on' : ''}`} data-testid={`memory-save-${lv.value}`}>
<input type="radio" name="memory-save-mode" value={lv.value} checked={checked} disabled={saving} onChange={() => store({ save_mode: lv.value })} />
<span className="ms-level__text">
<span className="ms-level__title">{t(`memorySettings.save.${lv.value}.title`)}{lv.isDefault && <span className="ms-tag">{t('memorySettings.default')}</span>}</span>
<span className="ms-level__body">{t(`memorySettings.save.${lv.value}.body`)}</span>
</span>
</label>
)
})}
</div>
<p className="ms-p ms-p--note"><Icon name="info" />{' '}{t('memorySettings.saveNote')}</p>
</section>
{notes}
</div>
)
}
@@ -2,7 +2,8 @@
import { useCallback, useEffect, useId, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { Link } from 'react-router-dom'
import { chatChangesApi, filesApi } from '../utils/api'
import { chatChangesApi, chatMemoryApi, filesApi } from '../utils/api'
import { downloadFrom } from '../utils/chatThread'
import { byteText } from '../utils/changeProposal'
import { allFiles, groupId, groupKind, indexFits, indexUse } from '../utils/memoryFiles'
import Icon from './Icon'
@@ -120,7 +121,7 @@ function groupTitle(g, t) {
// every source the host knows (the user's, each agent's, each connector
// conversation's) and the agent profiles. The owner can read, edit and delete
// them here; a model changes them only through a confirmed proposal.
export default function MemoryTab({ addToast }) {
export default function MemoryTab({ addToast, embedded = false }) {
const { t } = useTranslation('chats')
const [data, setData] = useState(null)
const [error, setError] = useState(null)
@@ -168,7 +169,7 @@ export default function MemoryTab({ addToast }) {
const lim = data.limits || {}
return (
<div className="mt-tab" data-testid="memory-tab">
<p className="mt-lede">{t('memoryPage.lede')}</p>
{!embedded && <p className="mt-lede">{t('memoryPage.lede')}</p>}
<p className="mt-limits" data-testid="memory-limits">
{t('memoryPage.limits', { lines: lim.index_lines, index: byteText(lim.index_bytes), profile: byteText(lim.profile_bytes), turn: byteText(lim.turn_bytes) })}
</p>
@@ -192,6 +193,7 @@ export default function MemoryTab({ addToast }) {
</section>
))}
<div className="mt-foot">
<Button variant="secondary" size="sm" icon="download" data-testid="memory-export" onClick={() => downloadFrom(chatMemoryApi.exportUrl())}>{t('memorySettings.export')}</Button>
{clear ? (
<Callout tone="warn" role="alertdialog" testId="memory-clear-confirm"
actions={(
@@ -18,6 +18,8 @@ import AgentPicker from './AgentPicker'
import SkillsMenu from './SkillsMenu'
import SwitchMenu from './SwitchMenu'
import VisionNotice from './VisionNotice'
import { MemoryChip, MemoryLine } from './MemoryNotice'
import { memoryOff, MEMORY_GROUP } from '../../utils/memoryState'
import { ChatToolsControls } from '../../addons/hostControlComponents'
import AgentFolderChip from './AgentFolderChip'
import { agentFolderLine } from '../../utils/chatAgents'
@@ -132,6 +134,7 @@ export default function ChatComposer({
const grants = useChatGrants(pickedAgent)
const toolGroups = useToolGroups({ ...switches, grants }, { commandsInfo: commands.info })
const network = egress && networkMode(egress) !== 'hidden'
const memoryIsOff = !!memoryOff(switches.memory, switches.builtins.find((b) => b.group === MEMORY_GROUP))
// A chat whose agent has a folder reaches only that folder with its file tools.
const scopeLine = agentFolderLine(pickedAgent, t)
const tools = (
@@ -140,14 +143,15 @@ export default function ChatComposer({
icon="plug" label={t('tools.label')} title={t('tools.title')} heading={t('tools.heading')}
note={chatId ? t('tools.note') : t('tools.draftNote')}
groups={toolGroups} error={switches.error} testId="chat-tools"
notice={scopeLine || commands.info || network || switches.fallbacks.length > 0
? <>{scopeLine ? <p className="cmd-notice__line" data-testid="chat-tools-scope">{scopeLine}</p> : null}{commands.info ? <CommandsNotice notice={commands} /> : null}<ToolFallbacks fallbacks={switches.fallbacks} />{network ? <ChatToolsControls egress={egress} /> : null}</>
notice={scopeLine || commands.info || network || switches.fallbacks.length > 0 || memoryIsOff
? <><MemoryLine memory={switches.memory} builtins={switches.builtins} />{scopeLine ? <p className="cmd-notice__line" data-testid="chat-tools-scope">{scopeLine}</p> : null}{commands.info ? <CommandsNotice notice={commands} /> : null}<ToolFallbacks fallbacks={switches.fallbacks} />{network ? <ChatToolsControls egress={egress} /> : null}</>
: null}
footer={switches.connectors.length > 0 || switches.servers.length > 0
? <Button size="sm" variant="ghost" iconEnd="arrow-right" to="/app/mcp-connectors" data-testid="chat-tools-manage">{tc('tools.manage')}</Button>
: null}
/>
<CommandsChip notice={commands} />
<MemoryChip memory={switches.memory} builtins={switches.builtins} />
<SkillsMenu skills={switches.skills} replaced={switches.replacedSkills} onSet={switches.setSkillsOn} error={switches.skillsError} />
{toolsExtra}
</>
@@ -0,0 +1,38 @@
/* eslint-disable no-unused-vars -- components used only inside JSX look unused to this config, which has no eslint-plugin-react */
import { Link } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
import Icon from '../Icon'
import { memoryFix, memoryOff, MEMORY_GROUP } from '../../utils/memoryState'
import './memorynotice.css'
// The one line that says memory is off here, and why, and where to turn it on.
// It sits at the top of the Tools menu while memory is off.
export function MemoryLine({ memory, builtins }) {
const { t } = useTranslation('chats')
const off = memoryOff(memory, (builtins || []).find((b) => b.group === MEMORY_GROUP))
if (!off) return null
const fix = memoryFix(off)
return (
<p className="mem-line" data-testid="chat-memory-line" data-code={off.kind}>
<Icon name="eye-off" className="mem-line__icon" />
<span>
<strong>{t('memoryOff.title')}</strong>{' '}{t(`memoryOff.line.${off.kind}`)}
{fix ? <>{' '}<Link className="cs-link" to={fix.to}>{t(`memoryOff.${fix.key}`)}</Link></> : null}
</span>
</p>
)
}
// A small pill next to the Tools menu of the composer: "Private chat" for a
// chat that switched memory off, "Memory off" for the levels above.
export function MemoryChip({ memory, builtins }) {
const { t } = useTranslation('chats')
const off = memoryOff(memory, (builtins || []).find((b) => b.group === MEMORY_GROUP))
if (!off) return null
const text = off.kind === 'chat' ? t('memoryOff.chipPrivate') : t('memoryOff.chip')
return (
<span className="mem-chip" data-testid="chat-memory-chip" data-code={off.kind} title={t(`memoryOff.line.${off.kind}`)}>
<Icon name="eye-off" />{text}
</span>
)
}
@@ -0,0 +1,4 @@
/* The line and the chip that say memory is off in a chat. */
.mem-line { display: flex; align-items: flex-start; gap: var(--sp-2); margin: 0; padding: var(--sp-2) var(--sp-3); border-radius: var(--dk-radius-2); background: var(--dk-inset); color: var(--dk-text); font-size: var(--text-xs); line-height: 1.4; }
.mem-line__icon { flex: none; margin-top: 2px; color: var(--dk-muted); }
.mem-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--dk-radius-3); background: var(--dk-inset); box-shadow: inset 0 0 0 1px var(--dk-edge); color: var(--dk-text); font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
@@ -0,0 +1,27 @@
/* Settings > Memory: the switch and how a note is saved. */
.ms-page { display: grid; gap: var(--sp-4); max-width: 720px; }
.ms-card { display: grid; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--dk-radius-2); background: var(--dk-card); box-shadow: inset 0 0 0 1px var(--dk-edge); }
.ms-h { margin: 0; font-size: var(--text-md, 15px); color: var(--dk-text); }
.ms-p { margin: 0; font-size: var(--text-sm); color: var(--dk-muted); max-width: 60ch; }
.ms-p--warn { color: var(--dk-warning-text, var(--dk-text)); }
.ms-p--note { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--text-xs); }
.ms-switch { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-4); }
.ms-switch--off { background: var(--dk-inset); }
.ms-switch__text { display: grid; gap: var(--sp-1); min-width: 0; }
.ms-switch__ctl { display: flex; align-items: center; gap: var(--sp-2); }
.ms-switch__word { font-size: var(--text-sm); font-weight: 600; color: var(--dk-text); }
.ms-levels { display: grid; gap: var(--sp-2); }
.ms-level { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--dk-radius-2); box-shadow: inset 0 0 0 1px var(--dk-edge); cursor: pointer; }
.ms-level--on { background: var(--dk-accent-wash); box-shadow: inset 0 0 0 1px var(--dk-accent); }
.ms-level input { margin-top: 3px; accent-color: var(--dk-accent); flex: none; }
.ms-level:focus-within { outline: 2px solid var(--focus-ring-color); outline-offset: 2px; }
.ms-level__text { display: grid; gap: 2px; min-width: 0; }
.ms-level__title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); font-weight: 600; color: var(--dk-text); }
.ms-level__body { font-size: var(--text-sm); color: var(--dk-muted); overflow-wrap: anywhere; }
.ms-tag { padding: 0 6px; border-radius: var(--dk-radius-3); background: var(--dk-inset); color: var(--dk-muted); font-size: var(--text-xs); font-weight: 400; }
.ms-notes { display: grid; gap: var(--sp-3); }
.ms-notes-head { display: grid; gap: var(--sp-1); }
@media (max-width: 560px) {
.ms-switch { grid-template-columns: minmax(0, 1fr); }
.ms-switch__ctl { justify-self: start; }
}
@@ -19,7 +19,7 @@
.mt-panel { display: grid; gap: var(--sp-2); padding: 0 0 var(--sp-3); }
.mt-text { margin: 0; padding: var(--sp-3); max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: var(--dk-radius-2); background: var(--dk-inset); font-family: var(--font-mono); font-size: var(--text-xs); }
.mt-edit { width: 100%; font-family: var(--font-mono); font-size: var(--text-xs); resize: vertical; }
.mt-foot { display: flex; }
.mt-foot { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.mt-edit { height: auto; padding: var(--sp-2) var(--sp-3); }
.mt-help { margin: var(--sp-1) 0 var(--sp-2); font-size: var(--text-xs); color: var(--dk-muted); }
.mt-help--err { color: var(--dk-error-text, var(--dk-error)); }
+8 -3
View File
@@ -44,6 +44,9 @@ export function useChatSwitches(chatId, filesOn, draft = null, actorSession = ''
const builtinsRef = useRef(builtins)
// The built-in tools an installed add-on replaces but cannot serve here now.
const [fallbacks, setFallbacks] = useState([])
// Whether memory works in the chat and which level turned it off (the memory
// object of the tools list), or null before the list is read.
const [memory, setMemory] = useState(null)
const [skills, setSkills] = useState([])
// The built-in skills an add-on replaces now: shown dimmed, with no switch.
const [replaced, setReplaced] = useState([])
@@ -63,7 +66,7 @@ export function useChatSwitches(chatId, filesOn, draft = null, actorSession = ''
useEffect(() => {
setError('')
setSkillsError('')
if (!chatId && !draftOn) { setAddons([]); setCommands(noCommands); setMcp(noMCP); setBuiltins([]); setFallbacks([]); setSkills([]); setReplaced([]); return undefined }
if (!chatId && !draftOn) { setAddons([]); setCommands(noCommands); setMcp(noMCP); setBuiltins([]); setFallbacks([]); setMemory(null); setSkills([]); setReplaced([]); return undefined }
let live = true
const epoch = ++commandEpoch.current
setCommands(noCommands)
@@ -80,8 +83,9 @@ export function useChatSwitches(chatId, filesOn, draft = null, actorSession = ''
setMcp(draftOn ? { servers: got.servers, connectors: got.connectors, off: got.mcpOff } : m)
setBuiltins(got.builtins)
setFallbacks(res.fallbacks || [])
setMemory(res.memory || null)
})
.catch(() => { if (live) { setMcp(noMCP); setBuiltins([]); setFallbacks([]) } })
.catch(() => { if (live) { setMcp(noMCP); setBuiltins([]); setFallbacks([]); setMemory(null) } })
return () => { live = false }
}, [chatId, filesOn, draftOn, draftModel, draftAgent, actorSession])
@@ -252,6 +256,7 @@ export function useChatSwitches(chatId, filesOn, draft = null, actorSession = ''
putBuiltins(res.builtins || [])
putMcp(mcpOf(res))
setFallbacks(res.fallbacks || [])
setMemory(res.memory || null)
} catch (e) {
if (epoch !== commandEpoch.current) return
setCommands(noCommands)
@@ -309,7 +314,7 @@ export function useChatSwitches(chatId, filesOn, draft = null, actorSession = ''
return {
draftSwitches, resetDraft, draft: draftOn, commandsRev,
addons, builtins, fallbacks, commands: commands.context === context ? commands : noCommands, servers: mcp.servers, connectors: mcp.connectors, skills, replacedSkills: replaced, error, skillsError, skillsBusy: skillsBusy > 0,
addons, builtins, fallbacks, memory, commands: commands.context === context ? commands : noCommands, servers: mcp.servers, connectors: mcp.connectors, skills, replacedSkills: replaced, error, skillsError, skillsBusy: skillsBusy > 0,
counts: toolsCounts({ builtins, addons, servers: mcp.servers, connectors: mcp.connectors }),
toggleAddon, toggleBuiltin, toggleMCP, toggleSkill, setSkillsOn, setAddonsOn, setBuiltinsOn, setMCPOn, setConnections,
}
+39
View File
@@ -0,0 +1,39 @@
import { useCallback, useEffect, useState } from 'react'
import { chatMemoryApi } from '../utils/api'
// Your memory choices (GET and PUT /api/chats/memory): the switch for all
// chats and how a note is saved. A change goes to the server first and the
// screen shows what the server answers, so the page never shows a choice that
// was not stored.
export function useMemorySettings() {
const [settings, setSettings] = useState(null)
const [error, setError] = useState(null)
const [saving, setSaving] = useState(false)
const load = useCallback(async () => {
try {
setSettings(await chatMemoryApi.get())
setError(null)
} catch (e) {
setError(e)
}
}, [])
useEffect(() => { load() }, [load])
// Returns true when the change was stored.
const change = useCallback(async (body) => {
setSaving(true)
try {
setSettings(await chatMemoryApi.set(body))
setError(null)
return true
} catch (e) {
setError(e)
return false
} finally {
setSaving(false)
}
}, [])
return { settings, error, saving, reload: load, change }
}
+11 -2
View File
@@ -25,7 +25,8 @@ import { GRANT_SECTIONS, connectionsMissing, grantKey, placeGrants } from '../ut
export const SAVED_AGENTS = 'saved_agents'
export const SHELL = 'shell'
export const SUBAGENTS = 'subagents'
const BUILTIN_ORDER = [SHELL, 'files', 'web', 'media', 'collections', SUBAGENTS, SAVED_AGENTS, 'triggers', 'changes']
export const MEMORY = 'memory'
const BUILTIN_ORDER = [SHELL, 'files', 'web', 'media', 'collections', MEMORY, SUBAGENTS, SAVED_AGENTS, 'triggers', 'changes']
export const builtinRank = (g) => {
const i = BUILTIN_ORDER.indexOf(g)
return i < 0 ? BUILTIN_ORDER.length : i
@@ -72,6 +73,14 @@ export function useToolGroups(switches, { commandsInfo = null, commandState = tr
return { chip, note: tc(`tools.commands.${unknownTextKey(selected.code)}`) }
}
// The memory row: while the person's own switch is off the row cannot be
// used and says where to turn it on; a chat that switched it off is a
// private chat.
const memoryNote = (b) => {
if (b.usable !== false) return b.off ? { chip: tc('memoryOff.chipPrivate') } : {}
return { reason: tc('memoryOff.userRow') }
}
const builtinRow = (b) => ({
key: `b-${b.group}`, id: b.group, optIn: !!b.opt_in,
label: tc(`tools.builtin.${b.group}`, { defaultValue: b.title || b.group }),
@@ -79,7 +88,7 @@ export function useToolGroups(switches, { commandsInfo = null, commandState = tr
whenOff: tc(`tools.whenOff.${b.group}`, { defaultValue: b.when_off || '' }),
title: tc('tools.builtinBy', { tools: (b.tools || []).join(', ') }),
on: !b.off, usable: b.usable, reason: b.reason, onToggle: (on) => switches.toggleBuiltin(b.group, on),
...(b.group === SHELL ? shellNote(b) : builtinNote(b)),
...(b.group === SHELL ? shellNote(b) : b.group === MEMORY ? memoryNote(b) : builtinNote(b)),
})
// A built-in row with the options that refine it.
const withOptions = (row) => {
+2 -1
View File
@@ -10,6 +10,7 @@ import { Button, Callout, EmptyState, LoadError, PageHeader, SkeletonRows, useLo
import ApiKeysPanel from '../components/users/ApiKeysPanel'
import { AboutYouTab, AppearanceTab } from '../components/wellknown/SettingsTabs'
import MemoryTab from '../components/MemoryTab'
import MemorySettings from '../components/MemorySettings'
import './access.css'
const TABS = [
@@ -300,7 +301,7 @@ export default function Account() {
{tab === 'keys' && <ApiKeysPanel addToast={addToast} intro={t('keys.accountIntro')} />}
{tab === 'usage' && <UsageTab />}
{tab === 'about' && <AboutYouTab />}
{tab === 'memory' && <MemoryTab addToast={addToast} />}
{tab === 'memory' && <MemorySettings addToast={addToast}><MemoryTab addToast={addToast} embedded /></MemorySettings>}
{tab === 'appearance' && <AppearanceTab />}
</div>
</div>
@@ -6,6 +6,7 @@ import { useTranslation } from 'react-i18next'
import { agentCollectionsApi, chatAgentsApi, modelMCPServersApi } from '../utils/api'
import { useAgentTools } from '../hooks/useAgentTools'
import { useToolGroups } from '../hooks/useToolGroups'
import { useMemorySettings } from '../hooks/useMemorySettings'
import { AGENT_TEMPLATES, diffConfig, displayValue, maskSecrets, summarise } from '../utils/agentConfigTools'
import { agentPayload, effectiveModes, emptyAgent, folderRows, folderState, foldersUnchosen, MAX_FOLDERS, missingConnectorGrants, setGrant } from '../utils/chatAgents'
import { downloadAgentFile } from '../utils/agentFiles'
@@ -131,6 +132,8 @@ export default function AgentCreate() {
// The Tools and Skills lists are the ones the Tools menu of a chat draws
// (SwitchPanel), with the agent's grants and switches applied to them.
const tools = useAgentTools(form, updateField)
// The person's own memory switch, read only here: an agent cannot widen it.
const memoryUser = useMemorySettings()
const toolGroups = useToolGroups(tools, { commandState: false, forAgent: true })
// The definition exactly as it is saved. The preview shows this object and
@@ -332,6 +335,11 @@ export default function AgentCreate() {
return (
<>
<p className="ag-note">{t('create.toolsHelp')}</p>
{memoryUser.settings && memoryUser.settings.enabled === false && (
<Callout tone="info" icon="eye-off" testId="agent-memory-off">
{t('create.memoryOffUser')}{' '}<Link className="cs-link" to="/app/account?tab=memory">{t('create.memoryOffFix')}</Link>
</Callout>
)}
{missingGrants.length > 0 && (
<Callout
tone="warn" testId="agent-grants-notice"
+8
View File
@@ -566,6 +566,14 @@ export const chatChangesApi = {
contextFiles: () => fetchJSON('/api/chats/context-files'),
}
// Your memory choices: the On or Off switch for all chats, and how a note is
// saved. exportUrl is the address that downloads the notes as a zip file.
export const chatMemoryApi = {
get: () => fetchJSON('/api/chats/memory'),
set: (body) => fetchJSON('/api/chats/memory', { method: 'PUT', body: JSON.stringify(body) }),
exportUrl: (scope, key) => apiUrl(`/api/chats/memory/export${q({ scope, key })}`),
}
// The inbox: what ended while the user was elsewhere.
export const chatNotificationsApi = {
list: (unread, limit = 50) => fetchJSON(`/api/chats/notifications${q({ unread: unread ? 1 : undefined, limit })}`),
+25
View File
@@ -0,0 +1,25 @@
// Whether memory works in a chat, for the screen. The server says it in the
// memory object of the tools list ({ on, code, blocked_by, fix }); the memory
// group of the list is the chat's own switch, which a draft changes before the
// server hears of it. The narrowest level that is off wins, as on the server:
// this chat, then the agent, then the person's switch, then the server.
export const MEMORY_GROUP = 'memory'
// null while memory works, else { kind, by } with kind one of chat, agent,
// user or files.
export function memoryOff(memory, group) {
if (group?.off) return { kind: 'chat', by: 'chat' }
if (!memory || memory.on !== false) return null
const kind = { memory_off_chat: 'chat', memory_off_agent: 'agent', memory_off_user: 'user', memory_off_files: 'files' }[memory.code] || 'user'
return { kind, by: memory.blocked_by || kind }
}
// Where to turn memory on again: a link for the levels the person can reach
// from the page that shows the line, or none (the chat's own switch is in the
// Tools menu right there).
export function memoryFix(off) {
if (!off) return null
if (off.kind === 'user') return { to: '/app/account?tab=memory', key: 'fixUser' }
return null
}
@@ -23,6 +23,7 @@ const scope = {
HomeComposer: props => { captured = props; return React.createElement('textarea', { defaultValue: props.message }) },
useToolGroups: () => [], useChatGrants: () => null, SAVED_AGENTS: 'saved_agents', SUBAGENTS: 'subagents',
CommandsChip: leaf, CommandsNotice: leaf, ToolFallbacks: leaf, ChatToolsControls: leaf,
MemoryChip: leaf, MemoryLine: leaf, memoryOff: () => null, MEMORY_GROUP: 'memory',
}
const compiled = ts.transpileModule(source.replace(/^import .*\n/gm, '').replace('export default function', 'function'), {
compilerOptions: { jsx: ts.JsxEmit.React, target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.None }, fileName: 'ChatComposer.jsx',
@@ -0,0 +1,27 @@
import test from 'node:test'
import assert from 'node:assert/strict'
import { memoryFix, memoryOff } from '../../src/utils/memoryState.js'
test('memory state: memory that works is not off', () => {
assert.equal(memoryOff({ on: true }, { group: 'memory', off: false }), null)
assert.equal(memoryOff(null, undefined), null)
})
test('memory state: a chat that switched the group off is a private chat, whatever else says', () => {
assert.deepEqual(memoryOff({ on: true }, { group: 'memory', off: true }), { kind: 'chat', by: 'chat' })
assert.deepEqual(memoryOff({ on: false, code: 'memory_off_user', blocked_by: 'user' }, { group: 'memory', off: true }), { kind: 'chat', by: 'chat' })
})
test('memory state: the level the server names is the one shown', () => {
assert.equal(memoryOff({ on: false, code: 'memory_off_user', blocked_by: 'user' }, undefined).kind, 'user')
assert.equal(memoryOff({ on: false, code: 'memory_off_agent', blocked_by: 'agent' }, undefined).kind, 'agent')
assert.equal(memoryOff({ on: false, code: 'memory_off_files', blocked_by: 'server' }, undefined).kind, 'files')
assert.equal(memoryOff({ on: false, code: 'memory_off_chat', blocked_by: 'chat' }, undefined).kind, 'chat')
assert.equal(memoryOff({ on: false, code: 'something_new' }, undefined).kind, 'user', 'an unknown code reads as the safe, widest level')
})
test('memory state: only the level above the chat has a link', () => {
assert.deepEqual(memoryFix({ kind: 'user' }), { to: '/app/account?tab=memory', key: 'fixUser' })
assert.equal(memoryFix({ kind: 'chat' }), null)
assert.equal(memoryFix(null), null)
})
+3
View File
@@ -181,6 +181,9 @@ func RegisterStudioRoutes(e *echo.Echo, svc *studiosvc.Service, models studioend
// files are the chats' workspace.
e.GET("/api/workspace/events", h.WorkspaceEvents)
e.GET(base+"/context-files", h.ListContextFiles)
e.GET(base+"/memory", h.GetMemory)
e.PUT(base+"/memory", h.PutMemory)
e.GET(base+"/memory/export", h.ExportMemory)
e.GET(base+"/changes", h.ListChanges)
e.GET(base+"/changes/audit", h.ChangeAudit)
e.GET(base+"/changes/:id", h.GetChange)
+52
View File
@@ -1900,6 +1900,58 @@ type ChatsToolsPanel struct {
// that no add-on serves in this chat now: the add-on is stopped, off for
// the chat, not granted by its agent, or cannot run.
Fallbacks []ChatsToolFallback `json:"fallbacks,omitempty"`
// Memory says whether memory works in this chat and, when it does not,
// which level turned it off and where to turn it on again.
Memory ChatsMemoryState `json:"memory"`
}
// ChatsMemoryState is whether memory works in one chat. The narrowest level
// that is off wins: this chat (a private chat), the agent of the chat, your
// memory switch, then the server.
type ChatsMemoryState struct {
// On is true when the chat reads and may save notes.
On bool `json:"on" example:"false"`
// Code names the level that is off: memory_off_chat, memory_off_agent,
// memory_off_user or memory_off_files. Absent when on.
Code string `json:"code,omitempty" example:"memory_off_chat"`
// BlockedBy is who holds that switch: chat, agent, user or server.
BlockedBy string `json:"blocked_by,omitempty" example:"chat"`
// Reason is an English sentence for logs; the interface words it by Code.
Reason string `json:"reason,omitempty"`
// Fix says where to turn memory on again: kind open_tools_menu,
// open_memory_settings, open_agent or open_server_setting.
Fix *ChatsMemoryFix `json:"fix,omitempty"`
}
// ChatsMemoryFix points at the one place that turns memory on again.
type ChatsMemoryFix struct {
Kind string `json:"kind" example:"open_memory_settings"`
Target string `json:"target" example:"memory"`
Field string `json:"field,omitempty"`
}
// ChatsMemorySettings is your memory choices.
type ChatsMemorySettings struct {
// Enabled is memory On or Off for all your chats and agents.
Enabled bool `json:"enabled" example:"true"`
// EnabledSet is true once you chose. Before that memory is on, unless you
// had disabled the Memory add-on to stop it.
EnabledSet bool `json:"enabled_set" example:"false"`
// SaveMode is how a note is saved: ask, auto or never.
SaveMode string `json:"save_mode" example:"ask"`
// SaveModeSet is true once you chose in this setting.
SaveModeSet bool `json:"save_mode_set" example:"false"`
// Provider is what serves memory: builtin.
Provider string `json:"provider" example:"builtin"`
// Available is false when the server has no files, which notes need.
Available bool `json:"available" example:"true"`
}
// ChatsMemoryRequest changes your memory choices. A field left out stays as
// it is.
type ChatsMemoryRequest struct {
Enabled *bool `json:"enabled,omitempty" example:"false"`
SaveMode *string `json:"save_mode,omitempty" example:"ask"`
}
// ChatsToolFallback is one built-in tool whose replacing add-on cannot serve
+5
View File
@@ -54,6 +54,11 @@ func (s *Service) describeGroups() {
"A new trigger or a change waits on a card in the chat until you confirm it; pausing or resuming a trigger applies at once and you can undo it.",
WhenOff: "The model cannot create or manage triggers. A run that a trigger or a connector started never has them.",
},
builtins.GroupMemory: {
Title: "Memory",
Description: "The model can read your notes before it answers and save new ones. Turn it off to make this a private chat: nothing is read from your notes or saved to them. Your other chats are not affected.",
WhenOff: "This is a private chat. The model neither reads nor saves your notes.",
},
builtins.GroupChanges: {
Title: "Suggested changes",
Description: "The model can propose an edit to your notes, its standing rules, skills, pages and dashboard, and undo an edit you confirmed. " +
+4 -1
View File
@@ -110,6 +110,9 @@ type ToolsPanel struct {
// Fallbacks are the built-in tools an installed add-on replaces but no
// add-on serves in this chat now.
Fallbacks []ToolFallback
// Memory says whether memory works in this chat and, when it does not,
// which level turned it off and where to turn it on.
Memory MemoryReason
}
// Tools lists what a chat can use, with its switches.
@@ -135,7 +138,7 @@ func (s *Service) toolsFor(ctx context.Context, user string, rec session.ChatRec
return ToolsPanel{}, err
}
}
p := ToolsPanel{Off: append([]string{}, rec.McpOff...), Builtins: s.builtinGroups(ctx, rec, shadowing)}
p := ToolsPanel{Off: append([]string{}, rec.McpOff...), Builtins: s.builtinGroups(ctx, rec, shadowing), Memory: s.ChatMemory(ctx, rec)}
if s.d.AddonTools != nil && (sc == nil || !sc.deleted) {
p.Fallbacks, err = s.toolFallbacks(ctx, rec, shadowing, s.shadowersFor(ctx, principal(user)))
if err != nil {
+94 -2
View File
@@ -121,14 +121,19 @@ func memoryOff(code, by string) MemoryState { return MemoryState{Code: code, By:
// is the Memory add-on, for the person who never chose.
func (s *Service) memoryState(ctx context.Context, rec session.ChatRecord, legacy legacyMemory) MemoryState {
switch {
case !s.d.Files.Available():
return memoryOff(MemoryOffFiles, "server")
case slices.Contains(rec.BuiltinsOff, builtins.GroupMemory):
// A private chat.
return memoryOff(MemoryOffChat, "chat")
case slices.Contains(rec.AddonsOff, MemoryAddonID):
// The chat switched the Memory add-on off: the same switch, in the
// words it had before memory was built in.
return memoryOff(MemoryOffChat, "chat")
case slices.Contains(s.agentOff(ctx, rec), builtins.GroupMemory):
return memoryOff(MemoryOffAgent, "agent")
case !s.memoryUserOn(ctx, rec.Principal, legacy):
return memoryOff(MemoryOffUser, "user")
case !s.d.Files.Available():
return memoryOff(MemoryOffFiles, "server")
}
return MemoryState{On: true}
}
@@ -203,3 +208,90 @@ func (s *Service) memoryWritable(ctx context.Context, c builtins.Chat) bool {
legacy := legacyMemoryOf(s.addonContextSets(ctx, c.Actor.Principal))
return s.memoryState(ctx, rec, legacy).On && !slices.Contains(c.GroupsOff, builtins.GroupMemory)
}
// memoryOffLine is the one line the model reads while memory is off for a
// chat: it hears that nothing is read or saved and what to say when asked.
func memoryOffLine(st MemoryState) string {
where := "in the user's settings"
switch st.By {
case "chat":
where = "for this chat, which is private"
case "agent":
where = "for this agent"
}
return "Memory is off " + where + ", so notes are neither read nor saved. If asked to remember something, say that memory is off and that the user can turn it on again; do not try to save it any other way."
}
// MemoryReason is a memory state worded for a person, with where to fix it.
type MemoryReason struct {
On bool `json:"on"`
// Code is a stable name of the level that is off: memory_off_chat,
// memory_off_agent, memory_off_user or memory_off_files. Empty when on.
Code string `json:"code,omitempty"`
// By is who holds that switch: chat, agent, user or server.
By string `json:"blocked_by,omitempty"`
// Reason is an English sentence for logs and tests.
Reason string `json:"reason,omitempty"`
// Fix says where to turn it on again.
Fix *Fix `json:"fix,omitempty"`
}
// The fixes of a memory switch that is off.
const (
// FixOpenMemorySettings points at the Memory tab of the account settings.
FixOpenMemorySettings = "open_memory_settings"
// FixOpenToolsMenu points at the Tools menu of the chat.
FixOpenToolsMenu = "open_tools_menu"
)
// memoryReason words a state.
func memoryReason(st MemoryState, rec session.ChatRecord) MemoryReason {
out := MemoryReason{On: st.On, Code: st.Code, By: st.By}
switch st.Code {
case MemoryOffChat:
out.Reason = "Memory is off in this chat: it is a private chat."
out.Fix = &Fix{Kind: FixOpenToolsMenu, Target: "memory"}
case MemoryOffAgent:
out.Reason = "Memory is off for the agent of this chat."
out.Fix = &Fix{Kind: FixOpenAgent, Target: rec.AgentID, Field: "tools:" + builtins.GroupMemory}
case MemoryOffUser:
out.Reason = "Memory is off in your settings."
out.Fix = &Fix{Kind: FixOpenMemorySettings, Target: "memory"}
case MemoryOffFiles:
out.Reason = "Memory needs files, and files are off on this server."
out.Fix = &Fix{Kind: FixOpenServerSetting, Target: "files"}
}
return out
}
// ChatMemory says whether memory works in a chat and, when it does not, which
// level turned it off.
func (s *Service) ChatMemory(ctx context.Context, rec session.ChatRecord) MemoryReason {
legacy := legacyMemoryOf(s.addonContextSets(ctx, rec.Principal))
return memoryReason(s.memoryState(ctx, rec, legacy), rec)
}
// registerMemoryGroup puts memory in the Tools menu as one switch group. The
// group has no tool of its own to build: the host reads the switch when it
// builds the prompt, so a private chat has no notes in it and no context_read.
// Build only says whether the switch can work now, and why not.
func (s *Service) registerMemoryGroup() error {
if !s.d.Files.Available() {
return nil // notes are files: without them there is no switch to show
}
return s.builtins.Register(builtins.Tool{
ID: contextfiles.ToolName, Group: builtins.GroupMemory, Label: "Memory", External: true, Unlisted: true,
Description: "Read the notes of the user's memory.",
Build: func(ctx context.Context, c builtins.Chat) (session.Tool, bool, string) {
switch {
case !s.d.Files.Available():
return session.Tool{}, false, "memory needs files, and files are off on this server"
case c.SubAgent:
return session.Tool{}, false, "a sub-agent follows the memory of its parent chat"
case !s.memoryUserOn(ctx, c.Actor.Principal, legacyMemoryOf(s.addonContextSets(ctx, c.Actor.Principal))):
return session.Tool{}, false, "memory is off in your settings"
}
return session.Tool{}, true, ""
},
})
}
@@ -1,6 +1,8 @@
package studio
import (
"archive/zip"
"bytes"
"context"
"encoding/json"
"path/filepath"
@@ -141,6 +143,12 @@ var _ = Describe("memory served by the host", func() {
ag, _ := agents.NewJSON("")
br = &memBroker{}
svc, err = New(Deps{Store: st, Provider: provider.New(), StateDir: GinkgoT().TempDir(), Files: f, Agents: ag, AddonTools: br,
SetUserSetting: func(_ context.Context, _, addon, key, value string) error {
smu.Lock()
defer smu.Unlock()
stored[addon+"/"+key] = value
return nil
},
UserSetting: func(_ context.Context, _, addon, key string) (string, bool, error) {
smu.Lock()
defer smu.Unlock()
@@ -268,4 +276,173 @@ var _ = Describe("memory served by the host", func() {
Expect(mode()).To(Equal(SaveNever), "an unknown value is not a choice")
})
})
Describe("Off and private chats", func() {
hasTool := func(tt session.TurnTools, name string) bool {
for _, t := range tt.Tools {
if t.Name == name {
return true
}
}
return false
}
offLine := "Memory is off"
expectOff := func(tt session.TurnTools, why string) {
GinkgoHelper()
Expect(tt.Prompt).NotTo(ContainSubstring("lives in Rome"), why)
Expect(tt.Prompt).NotTo(ContainSubstring(contextfiles.Header), why)
Expect(tt.Prompt).To(ContainSubstring(offLine), why)
Expect(strings.Count(tt.Prompt, offLine)).To(Equal(1), why)
Expect(hasTool(tt, contextfiles.ToolName)).To(BeFalse(), why)
for _, t := range tt.Tools {
if t.Name == "propose_change" {
// The other kinds of change stay; the memory kind goes.
Expect(string(t.Schema)).NotTo(ContainSubstring(`"memory"`), why+": no note is proposed")
}
}
}
It("offers notes and the save tool while memory is on", func() {
tt := turn(CreateInput{Model: "m"})
Expect(tt.Prompt).To(ContainSubstring("lives in Rome"))
Expect(tt.Prompt).NotTo(ContainSubstring(offLine))
var schema string
for _, t := range tt.Tools {
if t.Name == "propose_change" {
schema = string(t.Schema)
}
}
Expect(schema).To(ContainSubstring(`"memory"`))
})
It("turns everything off for a private chat, and only that chat", func() {
expectOff(turn(CreateInput{Model: "m", Switches: Switches{BuiltinsOff: []string{"memory"}}}), "private chat")
Expect(turn(CreateInput{Model: "m"}).Prompt).To(ContainSubstring("lives in Rome"))
})
It("turns everything off for a person who switched memory off, whatever else says", func() {
setting(HostSettingsID, MemoryEnabledKey, MemoryOff)
expectOff(turn(CreateInput{Model: "m"}), "user off")
agent, err := svc.SaveAgentWithFolder(ctx, "alice", agents.Agent{Name: "Granted", Model: "m", Addons: []string{"memory"},
Builtins: []string{contract.CapMemoryWrite}}, nil)
Expect(err).NotTo(HaveOccurred())
expectOff(turn(CreateInput{Model: "m", AgentID: agent.ID}), "a saved agent cannot widen the choice of the person")
// Nothing in the chat can widen it either.
expectOff(turn(CreateInput{Model: "m", Switches: Switches{AddonsOff: nil, BuiltinsOff: nil}}), "chat switches only narrow")
})
It("honours it in a run that started by itself", func() {
setting(HostSettingsID, MemoryEnabledKey, MemoryOff)
rec, err := svc.CreateAs(ctx, "alice", CreateInput{Model: "m"}, Origin{Kind: session.OriginTrigger, ID: "t1"})
Expect(err).NotTo(HaveOccurred())
x, err := svc.ChatAccess(ctx, "alice", rec.ID)
Expect(err).NotTo(HaveOccurred())
tt, err := svc.chatTools(ctx, x)
Expect(err).NotTo(HaveOccurred())
Expect(tt.Prompt).NotTo(ContainSubstring("lives in Rome"))
Expect(tt.Prompt).To(ContainSubstring(offLine))
})
It("honours the memory switch of the agent", func() {
agent, err := svc.SaveAgentWithFolder(ctx, "alice", agents.Agent{Name: "Quiet", Model: "m", Addons: []string{"memory"},
Builtins: []string{contract.CapMemoryWrite}, BuiltinsOff: []string{"memory"}}, nil)
Expect(err).NotTo(HaveOccurred())
tt := turn(CreateInput{Model: "m", AgentID: agent.ID})
Expect(tt.Prompt).NotTo(ContainSubstring("lives in Rome"))
Expect(tt.Prompt).To(ContainSubstring("for this agent"))
})
It("takes the two memory skills away while memory is off", func() {
rec, err := svc.CreateAs(ctx, "alice", CreateInput{Model: "m", Switches: Switches{BuiltinsOff: []string{"memory"}}}, Origin{})
Expect(err).NotTo(HaveOccurred())
list, _, err := svc.Skills(ctx, "alice", rec.ID)
Expect(err).NotTo(HaveOccurred())
seen := 0
for _, sk := range list {
if sk.Name == "memory" || sk.Name == "memory-check-own-files" {
seen++
Expect(sk.Off).To(BeTrue(), sk.Name)
}
}
Expect(seen).To(Equal(2))
})
It("says which level is off, and where to turn it on", func() {
rec, err := svc.CreateAs(ctx, "alice", CreateInput{Model: "m", Switches: Switches{BuiltinsOff: []string{"memory"}}}, Origin{})
Expect(err).NotTo(HaveOccurred())
r := svc.ChatMemory(ctx, rec)
Expect(r.On).To(BeFalse())
Expect(r.Code).To(Equal(MemoryOffChat))
Expect(r.By).To(Equal("chat"))
Expect(r.Fix).To(Equal(&Fix{Kind: FixOpenToolsMenu, Target: "memory"}))
setting(HostSettingsID, MemoryEnabledKey, MemoryOff)
plain, err := svc.CreateAs(ctx, "alice", CreateInput{Model: "m"}, Origin{})
Expect(err).NotTo(HaveOccurred())
r = svc.ChatMemory(ctx, plain)
Expect(r.Code).To(Equal(MemoryOffUser))
Expect(r.Fix.Kind).To(Equal(FixOpenMemorySettings))
Expect(svc.ChatMemory(ctx, rec).Code).To(Equal(MemoryOffChat), "the narrowest level is the one named")
})
It("lists the memory group in the Tools menu, off for a private chat and unusable when the person switched it off", func() {
panel, err := svc.DraftTools(ctx, "alice", "m", "")
Expect(err).NotTo(HaveOccurred())
var got *BuiltinGroup
for i := range panel.Builtins {
if panel.Builtins[i].Group == "memory" {
got = &panel.Builtins[i]
}
}
Expect(got).NotTo(BeNil())
Expect(got.Off).To(BeFalse())
Expect(got.Usable).To(BeTrue())
Expect(got.Title).To(Equal("Memory"))
setting(HostSettingsID, MemoryEnabledKey, MemoryOff)
panel, err = svc.DraftTools(ctx, "alice", "m", "")
Expect(err).NotTo(HaveOccurred())
for _, g := range panel.Builtins {
if g.Group == "memory" {
Expect(g.Usable).To(BeFalse())
Expect(g.Reason).To(ContainSubstring("off in your settings"))
}
}
Expect(panel.Memory.Code).To(Equal(MemoryOffUser))
})
It("keeps the notes viewable and exportable while memory is off", func() {
setting(HostSettingsID, MemoryEnabledKey, MemoryOff)
list, err := svc.ListContextFiles(ctx, "alice")
Expect(err).NotTo(HaveOccurred())
Expect(list.Groups).NotTo(BeEmpty())
var buf bytes.Buffer
n, err := svc.ExportMemory(ctx, "alice", &buf, "", "")
Expect(err).NotTo(HaveOccurred())
Expect(n).To(Equal(2))
zr, err := zip.NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len()))
Expect(err).NotTo(HaveOccurred())
var names []string
for _, f := range zr.File {
names = append(names, f.Name)
}
Expect(names).To(ConsistOf("Memory/index.md", "Memory/home.md"))
_, err = svc.ExportMemory(ctx, "alice", &bytes.Buffer{}, "agent", "nobody")
Expect(err).To(MatchError(ErrNoNotes))
})
It("stores the switch and the save level with the person's settings", func() {
m, err := svc.MemorySettings(ctx, "alice")
Expect(err).NotTo(HaveOccurred())
Expect(m).To(Equal(MemorySettings{Enabled: true, SaveMode: SaveAsk, Provider: "builtin", Available: true}))
off, auto := false, SaveAuto
m, err = svc.SetMemory(ctx, "alice", MemoryUpdate{Enabled: &off, SaveMode: &auto})
Expect(err).NotTo(HaveOccurred())
Expect(m.Enabled).To(BeFalse())
Expect(m.EnabledSet).To(BeTrue())
Expect(m.SaveMode).To(Equal(SaveAuto))
Expect(m.SaveModeSet).To(BeTrue())
bad := "always"
_, err = svc.SetMemory(ctx, "alice", MemoryUpdate{SaveMode: &bad})
Expect(err).To(MatchError(ErrInvalidSettings))
})
})
})
+137
View File
@@ -0,0 +1,137 @@
package studio
import (
"archive/zip"
"context"
"errors"
"fmt"
"io"
"path"
"strings"
"github.com/mudler/LocalAI/core/services/studio/contextfiles"
)
// ErrMemorySettings means the memory settings cannot be stored.
var ErrMemorySettings = errors.New("studio: the memory settings cannot be stored on this server")
// MemorySettings is the person's own memory choices, as the Memory tab shows
// them. The server keeps them with the person's other settings and every
// frontend reads the same answer.
type MemorySettings struct {
// Enabled is the switch in force: memory On or Off for every chat of the
// person. A chat, a messaging connection or an agent can only narrow it.
Enabled bool `json:"enabled"`
// EnabledSet is true once the person chose. Before that the switch is on,
// unless they had disabled the Memory add-on to stop memory.
EnabledSet bool `json:"enabled_set"`
// SaveMode is how a note is saved: ask, auto or never.
SaveMode string `json:"save_mode"`
// SaveModeSet is true once the person chose in this setting. Before that
// the value they gave on the page of the Memory add-on, if any, applies.
SaveModeSet bool `json:"save_mode_set"`
// Provider says what serves memory: "builtin".
Provider string `json:"provider"`
// Available is false when the server has no files: notes are files.
Available bool `json:"available"`
}
// MemoryUpdate is a change to the settings. A nil field is left alone.
type MemoryUpdate struct {
Enabled *bool
SaveMode *string
}
// MemorySettings reads the memory settings of a person.
func (s *Service) MemorySettings(ctx context.Context, user string) (MemorySettings, error) {
legacy := legacyMemoryOf(s.addonContextSets(ctx, user))
out := MemorySettings{Provider: s.memory.ID(), Available: s.d.Files.Available(), SaveMode: SaveAsk}
out.Enabled = s.memoryUserOn(ctx, user, legacy)
if s.d.UserSetting != nil {
if v, ok, err := s.d.UserSetting(ctx, principal(user), HostSettingsID, MemoryEnabledKey); err == nil && ok && (v == MemoryOn || v == MemoryOff) {
out.EnabledSet = true
}
if v, ok, err := s.d.UserSetting(ctx, principal(user), HostSettingsID, MemorySaveKey); err == nil && ok && ValidSaveMode(v) {
out.SaveModeSet = true
}
}
out.SaveMode = s.changes.storedSaveMode(ctx, user)
return out, nil
}
// SetMemory stores the choices of a person. A value that is not one of the
// allowed ones is ErrInvalidSettings.
func (s *Service) SetMemory(ctx context.Context, user string, in MemoryUpdate) (MemorySettings, error) {
if in.SaveMode != nil && !ValidSaveMode(*in.SaveMode) {
return MemorySettings{}, fmt.Errorf("%w: save_mode must be ask, auto or never", ErrInvalidSettings)
}
if (in.Enabled != nil || in.SaveMode != nil) && s.d.SetUserSetting == nil {
return MemorySettings{}, ErrMemorySettings
}
if in.Enabled != nil {
v := MemoryOff
if *in.Enabled {
v = MemoryOn
}
if err := s.d.SetUserSetting(ctx, principal(user), HostSettingsID, MemoryEnabledKey, v); err != nil {
return MemorySettings{}, fmt.Errorf("%w: %v", ErrMemorySettings, err)
}
}
if in.SaveMode != nil {
if err := s.d.SetUserSetting(ctx, principal(user), HostSettingsID, MemorySaveKey, *in.SaveMode); err != nil {
return MemorySettings{}, fmt.Errorf("%w: %v", ErrMemorySettings, err)
}
}
return s.MemorySettings(ctx, user)
}
// ErrNoNotes means a scope has no notes to export.
var ErrNoNotes = errors.New("studio: there are no notes to export")
// ExportMemory writes the notes of a person as a zip file: the Markdown files
// of the memory folders, with their paths in the home. scope and key narrow it
// to one group, as the context files list names them (user; agent and the
// agent ID; channel and the folder name); empty exports all. It works while
// memory is off: the notes belong to the person.
func (s *Service) ExportMemory(ctx context.Context, user string, w io.Writer, scope, key string) (int, error) {
list, err := s.ListContextFiles(ctx, user)
if err != nil {
return 0, err
}
var paths []string
for _, g := range list.Groups {
if g.Source != MemoryAddonID {
continue
}
if scope != "" && (string(g.Scope) != scope || g.Key != key) {
continue
}
for _, f := range g.Files {
paths = append(paths, f.Path)
}
}
if len(paths) == 0 {
return 0, ErrNoNotes
}
zw := zip.NewWriter(w)
rd := homeReader{f: s.d.Files}
n := 0
for _, p := range paths {
data, err := rd.ReadFile(ctx, principal(user), p, 1<<20)
if err != nil {
if errors.Is(err, contextfiles.ErrNotExist) {
continue
}
return n, err
}
fw, err := zw.Create(strings.TrimPrefix(path.Clean(p), "/"))
if err != nil {
return n, err
}
if _, err := fw.Write(data); err != nil {
return n, err
}
n++
}
return n, zw.Close()
}
@@ -63,6 +63,8 @@ const (
)
var allowed = []entry{
{ui + "hooks/useToolGroups.js", "memory", "the switch group of the built-in memory"},
{ui + "utils/memoryState.js", "memory", "the switch group of the built-in memory"},
// Memory is built into the host. The add-on of that name is the alias of
// the built-in: its index files and skills are the host's now, and the
// host ignores its copies.
+3
View File
@@ -472,6 +472,9 @@ func New(d Deps) (*Service, error) {
if err := s.registerToolGroups(); err != nil {
return nil, err
}
if err := s.registerMemoryGroup(); err != nil {
return nil, err
}
s.memory = builtinMemory{}
s.ctxfiles = contextfiles.NewLoader(contextfiles.NewRegistry(), homeReader{f: d.Files}, log)
s.shared = sharedfolders.New(sharedfolders.Options{Files: d.Files, Consents: d.PageConsents, Audit: d.SharedFolderAudit, Users: s.folderUsers()})
+5
View File
@@ -152,6 +152,11 @@ func (s *Service) chatTools(ctx context.Context, x session.Access) (session.Turn
}
notes, notesKey = s.contextTurnFor(ctx, rec, tools, extra, !(legacy.Installed && legacy.Running))
tools = append(tools, s.contextTools(rec, tools, extra)...)
if st := s.memoryState(ctx, rec, legacy); !st.On && st.Code != MemoryOffFiles {
// Off: the model hears it in one line, and has no note and no tool.
line := memoryOffLine(st)
notes, notesKey = joinBlocks(notes, line), notesKey+line
}
}
if lead := joinBlocks(persona, notes); lead != "" {
prompt = strings.TrimSpace(lead + "\n\n" + prompt)
+1 -1
View File
@@ -238,7 +238,7 @@ var _ = Describe("the one registry of built-in tools", func() {
if t.ID == "load_skill" || t.ID == "goal_done" || t.ID == "goal_blocked" || t.ID == studio.SendMessageName {
Expect(t.Group).To(BeEmpty(), t.ID)
} else if t.External {
Expect(t.Group).To(BeElementOf(builtins.GroupFiles, builtins.GroupMedia, builtins.GroupCollections, builtins.GroupSubAgents), t.ID)
Expect(t.Group).To(BeElementOf(builtins.GroupFiles, builtins.GroupMedia, builtins.GroupCollections, builtins.GroupSubAgents, builtins.GroupMemory), t.ID)
} else {
Expect(t.Group).To(BeElementOf(builtins.GroupTriggers, builtins.GroupChanges), t.ID)
}