microsoft / microsoft/simplechat
Enable fact and instruction memories from Chat admin settings without agents or actions
- Dominant language
- Python
- Stars
- 152
- Forks
- 116
- Avg merge
- 7h 7m
- Merged PRs (30d)
- 122
Description
## Summary
Move the fact/instruction memory control out of **Agents & Actions → Actions** and surface it in **Chat → Chat Experience**, so admins can enable memory for the normal chat experience without turning on agents or actions.
This follows the same pattern already used for Tabular Processing: the capability is owned by the tab it actually belongs to, and the Actions pane keeps a read-only dependency note pointing at it.
## User Value
Today `enable_fact_memory_plugin` is only reachable from the Actions tab and is labeled "Enable Fact Memory Action". An admin who never enables agents has no reason to open that tab, so they never discover the switch — even though memory recall already works in plain chat and users can manage entries in Profile.
Framing memory as a chat capability makes it discoverable for the large set of deployments that run plain chat, and removes the false implication that agents are a prerequisite.
## Proposed Behavior
- `enable_fact_memory_plugin` remains the single settings key (no new key, no migration).
- Admin Settings → **Chat → Chat Experience** gains a **Fact Memory** card (`fact-memory-section`) containing the live toggle, with copy stating plainly that it works without agents or actions, that users manage entries in Profile, and that the assistant can save or remove memories when asked.
- Admin Settings → **Agents & Actions → Actions** replaces its toggle with a read-only note pointing at Chat, matching the existing `tabular-processing-dependency-note` treatment.
- The Chat toggle saves through the main admin settings form; `POST /api/admin/plugins/settings` moves the key from required to deprecated-optional so it is accepted but no longer written by that endpoint.
- With the toggle on and agents off, normal chat also supports **explicit** memory creation and removal ("remember that I prefer bullet points", "stop calling me Paul") using the existing Semantic Kernel machinery via a small memory-only kernel pass, gated by a cheap intent pre-filter so ordinary turns take no extra model call.
## Acceptance Criteria
- [ ] The fact memory toggle renders in Chat → Chat Experience and saves through the admin settings form.
- [ ] The Actions pane shows a read-only note instead of a toggle, and reflects current state.
- [ ] Toggling any other core plugin no longer clobbers `enable_fact_memory_plugin`.
- [ ] `POST /api/admin/plugins/settings` accepts requests that omit the key, and ignores it when present.
- [ ] With agents disabled, an explicit user request to remember, change, or forget something persists through `FactMemoryStore` in the authorized chat scope.
- [ ] Standard and streaming chat paths behave consistently, and memory activity surfaces as a chat thought.
- [ ] Memory writes never break the chat response — failures degrade silently and are logged.
- [ ] Functional regression coverage validates admin placement, save wiring, intent detection, and the memory pass.
- [ ] Documentation, docs inventory, and release notes are updated at the configured app version.
## Notes
Related to #1153, which covers the broader normal-chat memory creation experience including *inferred* memory proposal cards with approve/deny/edit. This issue delivers the admin-settings relocation plus the **explicit** save/update/forget path; the inferred-proposal card UI remains tracked in #1153.
Relevant areas:
- `application/single_app/templates/admin/_panes/chat-experience.html`
- `application/single_app/templates/admin/_panes/actions.html`
- `application/single_app/admin_settings_nav.py`
- `application/single_app/static/js/admin/admin_settings.js`
- `application/single_app/route_backend_plugins.py`
- `application/single_app/route_frontend_admin_settings.py`
- `application/single_app/route_backend_chats.py`
- `application/single_app/semantic_kernel_plugins/fact_memory_plugin.py`
- `docs/admin/chat.md`, `docs/admin/agents-actions.md`, `docs/_data/features.yml`
Hazard found during planning: the Actions toggle currently saves through `POST /api/admin/plugins/settings`, where `enable_fact_memory_plugin` is a **required** field. Removing the input without updating `admin_settings.js` would make the payload send `false`, so changing any unrelated core plugin would silently disable fact memory.
Contributor guide
Assessment
This issue has not been assessed yet.