LibreChat/api/server/controllers/agents
Danny Avila 3945d293de
🗂️ feat: Per-Agent Memory Partitions (#14084)
* feat: per-agent memory partitions (memory_scope)

Adds an optional agentId partition to MemoryEntry so agents can opt into
isolated memory via a new memory_scope field ('user' | 'agent'). Partition
derives from agentId presence ({agentId: null} matches legacy docs, no
migration). Inline set_memory/delete_memory tools, the post-turn memory
agent, the request-scoped memory cache, and context injection are all
partition-aware; context is only injected into agents whose resolved
partition matches. Memory routes accept the partition param, scope
duplicate/token-limit checks per partition, and enrich entries with agent
names. Memories panel gains a partition filter and agent badges; the agent
builder gains an agent-scoped memory toggle.

* fix: address Codex review findings on memory partitions

- strip runtime ____N id suffixes in getMemoryAgentId so added-conversation
  runs share the persisted agent's partition
- load each agent's own partition in multi-agent context injection instead
  of skipping foreign partitions entirely
- clear memory_scope to 'user' on save when Enable Memory is unchecked
- fall back to 'all' when the selected panel partition no longer exists
- restrict GET /memories agent-name resolution to agents the requester can
  VIEW
2026-07-09 10:48:51 -04:00
..
__tests__ 🙋 feat: ask_user_question - agent-initiated questions with durable pause/resume (#14139) 2026-07-08 15:31:05 -04:00
callbacks.js 🧠 feat: Add Memory as an Agent Capability with Inline Tools and Ephemeral Badge (#13869) 2026-06-24 17:14:13 -04:00
client.js 🗂️ feat: Per-Agent Memory Partitions (#14084) 2026-07-09 10:48:51 -04:00
client.test.js 🪝 feat: Human-in-the-Loop Runtime - Tool Approval + Ask-User-Question (Slice B) (#13942) 2026-06-29 16:56:41 -04:00
errors.js
filterAuthorizedTools.spec.js 🧠 feat: Add Memory as an Agent Capability with Inline Tools and Ephemeral Badge (#13869) 2026-06-24 17:14:13 -04:00
openai.js 📛 feat: Tag Langfuse Traces With Tenant ID (#13808) 2026-06-17 20:27:55 -04:00
recordCollectedUsage.spec.js
request.js 🪝 feat: Human-in-the-Loop Runtime - Tool Approval + Ask-User-Question (Slice B) (#13942) 2026-06-29 16:56:41 -04:00
responses.js 🎒 fix: Apply OCR Context to Responses API Agents and Handoffs (#13707) 2026-06-20 10:17:09 -04:00
resume.js 🙋 feat: ask_user_question - agent-initiated questions with durable pause/resume (#14139) 2026-07-08 15:31:05 -04:00
v1.js 🧊 fix: Include Conversation Starters in Agent View and List Responses (#14142) 2026-07-08 12:54:54 -04:00
v1.spec.js 🧊 fix: Include Conversation Starters in Agent View and List Responses (#14142) 2026-07-08 12:54:54 -04:00