@lobehub/lobehub 2.0.0-next.335 → 2.0.0-next.337

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/changelog/v1.json +21 -0
  3. package/package.json +1 -1
  4. package/packages/builtin-tool-agent-builder/src/manifest.ts +0 -2
  5. package/packages/builtin-tool-group-management/src/manifest.ts +54 -53
  6. package/packages/builtin-tool-group-management/src/systemRole.ts +43 -111
  7. package/packages/builtin-tool-memory/src/client/Render/AddPreferenceMemory/index.tsx +17 -0
  8. package/packages/builtin-tool-memory/src/client/Render/index.ts +2 -0
  9. package/packages/builtin-tool-memory/src/client/Streaming/AddPreferenceMemory/index.tsx +17 -0
  10. package/packages/builtin-tool-memory/src/client/Streaming/index.ts +4 -3
  11. package/packages/builtin-tool-memory/src/client/components/PreferenceMemoryCard.tsx +357 -0
  12. package/packages/builtin-tool-memory/src/client/components/index.ts +1 -0
  13. package/packages/builtin-tool-memory/src/executor/index.ts +3 -3
  14. package/packages/builtin-tool-memory/src/systemRole.ts +1 -0
  15. package/packages/context-engine/src/engine/tools/ToolArgumentsRepairer.ts +129 -0
  16. package/packages/context-engine/src/engine/tools/__tests__/ToolArgumentsRepairer.test.ts +186 -0
  17. package/packages/context-engine/src/engine/tools/index.ts +3 -0
  18. package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/index.ts +2 -0
  19. package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/with-assistant-group.json +156 -0
  20. package/packages/conversation-flow/src/__tests__/parse.test.ts +22 -0
  21. package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +88 -11
  22. package/packages/database/src/models/userMemory/model.ts +1 -1
  23. package/packages/memory-user-memory/src/extractors/context.test.ts +0 -1
  24. package/packages/memory-user-memory/src/extractors/experience.test.ts +0 -1
  25. package/packages/memory-user-memory/src/extractors/identity.test.ts +0 -1
  26. package/packages/memory-user-memory/src/extractors/preference.test.ts +0 -1
  27. package/packages/memory-user-memory/src/schemas/context.ts +0 -2
  28. package/packages/memory-user-memory/src/schemas/experience.ts +0 -2
  29. package/packages/memory-user-memory/src/schemas/identity.ts +1 -2
  30. package/packages/memory-user-memory/src/schemas/preference.ts +0 -2
  31. package/packages/types/src/openai/chat.ts +0 -4
  32. package/src/app/[variants]/(main)/community/(detail)/user/features/DetailProvider.tsx +5 -1
  33. package/src/app/[variants]/(main)/community/(detail)/user/features/UserAgentCard.tsx +8 -8
  34. package/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupCard.tsx +142 -15
  35. package/src/app/[variants]/(main)/community/(detail)/user/features/useUserDetail.ts +45 -20
  36. package/src/server/routers/lambda/market/agentGroup.ts +179 -1
  37. package/src/server/routers/lambda/userMemories/tools.ts +5 -4
  38. package/src/server/routers/lambda/userMemories.ts +4 -4
  39. package/src/server/services/discover/index.ts +4 -0
  40. package/src/server/services/memory/userMemory/extract.ts +3 -3
  41. package/src/services/chat/chat.test.ts +109 -104
  42. package/src/services/chat/index.ts +13 -32
  43. package/src/services/chat/mecha/agentConfigResolver.test.ts +113 -0
  44. package/src/services/chat/mecha/agentConfigResolver.ts +15 -5
  45. package/src/services/marketApi.ts +14 -0
  46. package/src/store/chat/agents/__tests__/createAgentExecutors/helpers/testExecutor.ts +13 -0
  47. package/src/store/chat/agents/createAgentExecutors.ts +13 -1
  48. package/src/store/chat/slices/aiChat/actions/__tests__/conversationControl.test.ts +5 -1
  49. package/src/store/chat/slices/aiChat/actions/__tests__/fixtures.ts +14 -0
  50. package/src/store/chat/slices/aiChat/actions/__tests__/streamingExecutor.test.ts +131 -7
  51. package/src/store/chat/slices/aiChat/actions/streamingExecutor.ts +61 -62
  52. package/src/store/chat/slices/plugin/action.test.ts +71 -0
  53. package/src/store/chat/slices/plugin/actions/internals.ts +14 -5
package/CHANGELOG.md CHANGED
@@ -2,6 +2,65 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 2.0.0-next.337](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.336...v2.0.0-next.337)
6
+
7
+ <sup>Released on **2026-01-22**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix memory schema, update the agentbuilder tools not always use humanIntervention.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix memory schema, closes [#11645](https://github.com/lobehub/lobe-chat/issues/11645) ([3baf780](https://github.com/lobehub/lobe-chat/commit/3baf780))
21
+ - **misc**: Update the agentbuilder tools not always use humanIntervention, closes [#11696](https://github.com/lobehub/lobe-chat/issues/11696) ([0d3017b](https://github.com/lobehub/lobe-chat/commit/0d3017b))
22
+
23
+ </details>
24
+
25
+ <div align="right">
26
+
27
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
28
+
29
+ </div>
30
+
31
+ ## [Version 2.0.0-next.336](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.335...v2.0.0-next.336)
32
+
33
+ <sup>Released on **2026-01-22**</sup>
34
+
35
+ #### ✨ Features
36
+
37
+ - **misc**: Support agent group unpublish agents.
38
+
39
+ #### 🐛 Bug Fixes
40
+
41
+ - **misc**: Fix tool argument scape and improve multi task run.
42
+
43
+ <br/>
44
+
45
+ <details>
46
+ <summary><kbd>Improvements and Fixes</kbd></summary>
47
+
48
+ #### What's improved
49
+
50
+ - **misc**: Support agent group unpublish agents, closes [#11687](https://github.com/lobehub/lobe-chat/issues/11687) ([4e060be](https://github.com/lobehub/lobe-chat/commit/4e060be))
51
+
52
+ #### What's fixed
53
+
54
+ - **misc**: Fix tool argument scape and improve multi task run, closes [#11691](https://github.com/lobehub/lobe-chat/issues/11691) ([b13bb8a](https://github.com/lobehub/lobe-chat/commit/b13bb8a))
55
+
56
+ </details>
57
+
58
+ <div align="right">
59
+
60
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
61
+
62
+ </div>
63
+
5
64
  ## [Version 2.0.0-next.335](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.334...v2.0.0-next.335)
6
65
 
7
66
  <sup>Released on **2026-01-22**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,25 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Fix memory schema, update the agentbuilder tools not always use humanIntervention."
6
+ ]
7
+ },
8
+ "date": "2026-01-22",
9
+ "version": "2.0.0-next.337"
10
+ },
11
+ {
12
+ "children": {
13
+ "features": [
14
+ "Support agent group unpublish agents."
15
+ ],
16
+ "fixes": [
17
+ "Fix tool argument scape and improve multi task run."
18
+ ]
19
+ },
20
+ "date": "2026-01-22",
21
+ "version": "2.0.0-next.336"
22
+ },
2
23
  {
3
24
  "children": {},
4
25
  "date": "2026-01-22",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/lobehub",
3
- "version": "2.0.0-next.335",
3
+ "version": "2.0.0-next.337",
4
4
  "description": "LobeHub - an open-source,comprehensive AI Agent framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -27,7 +27,6 @@ export const AgentBuilderManifest: BuiltinToolManifest = {
27
27
  {
28
28
  description:
29
29
  'Search for tools (MCP plugins) in the marketplace. Users can browse and install tools directly from the search results. Use this when users want to find new tools or capabilities.',
30
- humanIntervention: 'always',
31
30
  name: AgentBuilderApiName.searchMarketTools,
32
31
  parameters: {
33
32
  properties: {
@@ -57,7 +56,6 @@ export const AgentBuilderManifest: BuiltinToolManifest = {
57
56
  {
58
57
  description:
59
58
  'Install a plugin for the agent. This tool ALWAYS REQUIRES user approval before installation, even in auto-run mode. For MCP marketplace plugins, it will install and enable the plugin. For Klavis tools and LobehubSkill providers that need OAuth, it will initiate the connection flow and wait for user to complete authorization.',
60
- humanIntervention: 'always',
61
59
  name: AgentBuilderApiName.installPlugin,
62
60
  parameters: {
63
61
  properties: {
@@ -84,43 +84,44 @@ export const GroupManagementManifest: BuiltinToolManifest = {
84
84
  // },
85
85
 
86
86
  // ==================== Task Execution ====================
87
- {
88
- description:
89
- 'Assign an asynchronous task to an agent. The task runs in the background and results are returned to the conversation context upon completion. Ideal for longer operations.',
90
- name: GroupManagementApiName.executeAgentTask,
91
- humanIntervention: 'required',
92
- parameters: {
93
- properties: {
94
- agentId: {
95
- description: 'The ID of the agent to execute the task.',
96
- type: 'string',
97
- },
98
- title: {
99
- description: 'Brief title describing what this task does (shown in UI).',
100
- type: 'string',
101
- },
102
- task: {
103
- description:
104
- 'Clear description of the task to perform. Be specific about expected deliverables.',
105
- type: 'string',
106
- },
107
- timeout: {
108
- default: 1_800_000,
109
- description:
110
- 'Maximum time in milliseconds to wait for task completion (default: 1800000, 30 minutes).',
111
- type: 'number',
112
- },
113
- skipCallSupervisor: {
114
- default: false,
115
- description:
116
- 'If true, the orchestration will end after the task completes, without calling the supervisor again. Use this when the task is the final action needed.',
117
- type: 'boolean',
118
- },
119
- },
120
- required: ['agentId', 'title', 'task'],
121
- type: 'object',
122
- },
123
- },
87
+ // TODO: Enable executeAgentTask when ready
88
+ // {
89
+ // description:
90
+ // 'Assign an asynchronous task to an agent. The task runs in the background and results are returned to the conversation context upon completion. Ideal for longer operations.',
91
+ // name: GroupManagementApiName.executeAgentTask,
92
+ // humanIntervention: 'required',
93
+ // parameters: {
94
+ // properties: {
95
+ // agentId: {
96
+ // description: 'The ID of the agent to execute the task.',
97
+ // type: 'string',
98
+ // },
99
+ // title: {
100
+ // description: 'Brief title describing what this task does (shown in UI).',
101
+ // type: 'string',
102
+ // },
103
+ // task: {
104
+ // description:
105
+ // 'Clear description of the task to perform. Be specific about expected deliverables.',
106
+ // type: 'string',
107
+ // },
108
+ // timeout: {
109
+ // default: 1_800_000,
110
+ // description:
111
+ // 'Maximum time in milliseconds to wait for task completion (default: 1800000, 30 minutes).',
112
+ // type: 'number',
113
+ // },
114
+ // skipCallSupervisor: {
115
+ // default: false,
116
+ // description:
117
+ // 'If true, the orchestration will end after the task completes, without calling the supervisor again. Use this when the task is the final action needed.',
118
+ // type: 'boolean',
119
+ // },
120
+ // },
121
+ // required: ['agentId', 'title', 'task'],
122
+ // type: 'object',
123
+ // },
124
+ // },
124
125
  // TODO: Enable executeAgentTasks when ready
125
126
  // {
126
127
  // description:
@@ -168,22 +169,22 @@ export const GroupManagementManifest: BuiltinToolManifest = {
168
169
  // type: 'object',
169
170
  // },
170
171
  // },
171
- {
172
- description:
173
- 'Interrupt a running agent task. Use this to stop a task that is taking too long or is no longer needed.',
174
- humanIntervention: 'always',
175
- name: GroupManagementApiName.interrupt,
176
- parameters: {
177
- properties: {
178
- taskId: {
179
- description: 'The ID of the task to interrupt (returned by executeTask).',
180
- type: 'string',
181
- },
182
- },
183
- required: ['taskId'],
184
- type: 'object',
185
- },
186
- },
172
+ // {
173
+ // description:
174
+ // 'Interrupt a running agent task. Use this to stop a task that is taking too long or is no longer needed.',
175
+ // humanIntervention: 'always',
176
+ // name: GroupManagementApiName.interrupt,
177
+ // parameters: {
178
+ // properties: {
179
+ // taskId: {
180
+ // description: 'The ID of the task to interrupt (returned by executeTask).',
181
+ // type: 'string',
182
+ // },
183
+ // },
184
+ // required: ['taskId'],
185
+ // type: 'object',
186
+ // },
187
+ // },
187
188
 
188
189
  // ==================== Context Management ====================
189
190
  // {
@@ -7,45 +7,38 @@
7
7
  export const systemPrompt = `You are a Group Supervisor with tools to orchestrate multi-agent collaboration. Your primary responsibility is to coordinate agents effectively by choosing the right mode of interaction.
8
8
 
9
9
  <core_decision_framework>
10
- ## The Critical Choice: Speaking vs Task Execution
10
+ ## Communication Mode Selection
11
11
 
12
- Before involving any agent, you MUST determine which mode is appropriate:
12
+ Before involving any agent, determine the best communication approach:
13
13
 
14
- ### 🗣️ Speaking Mode (speak/broadcast)
15
- **Use when agents DON'T need to use tools** - agents share the group's conversation context.
14
+ ### 🗣️ Single Agent (speak)
15
+ **Use when one agent's expertise is sufficient** - the agent shares the group's conversation context.
16
16
 
17
17
  Characteristics:
18
18
  - Agent responds based on their expertise and knowledge
19
19
  - Agent sees the group conversation history
20
20
  - Response is immediate and synchronous
21
- - No tool/plugin invocation needed
22
- - Lightweight, quick interactions
21
+ - Focused, single-perspective response
23
22
 
24
23
  Best for:
25
- - Sharing opinions, perspectives, or advice
26
- - Answering questions from knowledge
27
- - Brainstorming and ideation
28
- - Reviewing/critiquing content presented in conversation
29
- - Quick consultations
30
- - Discussion and debate
24
+ - Follow-up questions to a specific agent
25
+ - Tasks clearly matching one agent's expertise
26
+ - When user explicitly requests a specific agent
31
27
 
32
- ### Task Execution Mode (executeAgentTask)
33
- **Use when agents NEED to use tools** - each agent gets an independent context window to complete their task autonomously.
28
+ ### 📢 Multiple Agents (broadcast)
29
+ **Use when diverse perspectives are valuable** - all agents share the group's conversation context.
34
30
 
35
31
  Characteristics:
36
- - Agent operates in isolated context (fresh conversation)
37
- - Agent CAN use their configured tools/plugins (web search, code execution, file operations, etc.)
38
- - Asynchronous execution - multiple agents can work in parallel
39
- - Each agent completes their task independently
40
- - Results are returned to the group when done
32
+ - Multiple agents respond in parallel
33
+ - All agents see the same conversation history
34
+ - Quick gathering of multiple viewpoints
41
35
 
42
36
  Best for:
43
- - Web research and information gathering
44
- - Code writing, analysis, or execution
45
- - File processing or generation
46
- - API calls or external service interactions
47
- - Complex multi-step tasks requiring tool usage
48
- - Any task where the agent needs to "do something" not just "say something"
37
+ - Sharing opinions, perspectives, or advice
38
+ - Answering questions from knowledge
39
+ - Brainstorming and ideation
40
+ - Reviewing/critiquing content presented in conversation
41
+ - Discussion and debate
49
42
 
50
43
  ## Decision Flowchart
51
44
 
@@ -53,36 +46,23 @@ Best for:
53
46
  User Request
54
47
 
55
48
 
56
- Does the task require agents to USE TOOLS?
57
- (search web, write code, call APIs, process files, etc.)
49
+ Does the task need multiple perspectives?
58
50
 
59
- ├─── YES ──→ executeAgentTask (independent context per agent)
51
+ ├─── YES ──→ broadcast (parallel speaking)
60
52
 
61
- └─── NO ───→ Does the task need multiple perspectives?
62
-
63
- ├─── YES ──→ broadcast (parallel speaking)
64
-
65
- └─── NO ───→ speak (single agent)
53
+ └─── NO ───→ speak (single agent)
66
54
  \`\`\`
67
55
  </core_decision_framework>
68
56
 
69
57
  <user_intent_analysis>
70
58
  Before responding, analyze the user's intent:
71
59
 
72
- **Signals for Task Execution (executeAgentTask):**
73
- - "Search for...", "Find information about...", "Research..."
74
- - "Write code to...", "Create a script that...", "Implement..."
75
- - "Analyze this file...", "Process this data..."
76
- - "Generate a report...", "Create documentation..."
77
- - Tasks that clearly require external tools or multi-step operations
78
- - When multiple agents need to work on different parts independently
79
-
80
- **Signals for Speaking (speak/broadcast):**
60
+ **Signals for Multiple Agents (broadcast):**
81
61
  - "What do you think about...", "Any ideas for...", "How should we..."
82
62
  - "Review this...", "Give me feedback on...", "Critique..."
83
63
  - "Explain...", "Compare...", "Summarize..."
84
64
  - Requests for opinions, perspectives, or expertise-based answers
85
- - Questions that can be answered from knowledge alone
65
+ - Questions that benefit from diverse viewpoints
86
66
 
87
67
  **Signals for Single Agent (speak):**
88
68
  - Explicit request: "Ask [Agent Name] to...", "Let [Agent Name] answer..."
@@ -90,7 +70,6 @@ Before responding, analyze the user's intent:
90
70
  - Task clearly matches only one agent's expertise
91
71
 
92
72
  **Default Behavior:**
93
- - When in doubt about tool usage → Ask yourself: "Can this be answered with knowledge alone, or does it require the agent to DO something?"
94
73
  - When in doubt about single vs multiple agents → Lean towards broadcast for diverse perspectives
95
74
  </user_intent_analysis>
96
75
 
@@ -150,115 +129,68 @@ When a user's request is broad or unclear, ask 1-2 focused questions to understa
150
129
  <core_capabilities>
151
130
  ## Tool Categories
152
131
 
153
- **Speaking (Shared Context, No Tools):**
132
+ **Communication:**
154
133
  - **speak**: Single agent responds synchronously in group context
155
134
  - **broadcast**: Multiple agents respond in parallel in group context
156
135
 
157
- **Task Execution (Independent Context, With Tools):**
158
- - **executeAgentTask**: Assign a task to one agent in isolated context
159
- - **interrupt**: Stop a running task
160
-
161
136
  **Flow Control:**
162
- - **summarize**: Compress conversation context
163
137
  - **vote**: Initiate voting among agents
164
138
  </core_capabilities>
165
139
 
166
140
  <workflow_patterns>
167
141
  ## Pattern Selection Guide
168
142
 
169
- ### Pattern 1: Discussion/Consultation (Speaking)
170
- When you need opinions, feedback, or knowledge-based responses.
143
+ ### Pattern 1: Discussion/Consultation (Broadcast)
144
+ When you need opinions, feedback, or knowledge-based responses from multiple agents.
171
145
 
172
146
  \`\`\`
173
147
  User: "What do you think about using microservices for this project?"
174
- Analysis: Opinion-based, no tools needed
148
+ Analysis: Opinion-based, benefits from diverse perspectives
175
149
  Action: broadcast to [Architect, DevOps, Backend] - share perspectives
176
150
  \`\`\`
177
151
 
178
- ### Pattern 2: Independent Research (Task)
179
- When an agent needs to research/work independently using their tools.
180
-
181
- \`\`\`
182
- User: "Research the pros and cons of React"
183
- Analysis: Requires web search, agent works independently
184
- Action: executeAgentTask to frontend expert
185
- executeAgentTask({
186
- agentId: "frontend-expert",
187
- title: "Research React",
188
- task: "Research React ecosystem, performance benchmarks, community size, and typical use cases. Provide pros and cons."
189
- })
190
- \`\`\`
191
-
192
- ### Pattern 3: Sequential Discussion (Speaking Chain)
152
+ ### Pattern 2: Sequential Discussion (Speaking Chain)
193
153
  When each response should build on previous ones.
194
154
 
195
155
  \`\`\`
196
156
  User: "Design a notification system architecture"
197
- Analysis: Build-upon discussion, no tools needed per step
157
+ Analysis: Build-upon discussion, each agent adds to previous response
198
158
  Action:
199
159
  1. speak to Architect: "Propose high-level architecture"
200
160
  2. speak to Backend: "Evaluate and add implementation details"
201
161
  3. speak to DevOps: "Add deployment and scaling considerations"
202
162
  \`\`\`
203
163
 
204
- ### Pattern 4: Research then Discuss (Hybrid)
205
- When you need facts first, then discussion.
164
+ ### Pattern 3: Focused Consultation (Speak)
165
+ When a specific agent's expertise is needed.
206
166
 
207
167
  \`\`\`
208
- User: "Should we migrate to Kubernetes? Research and discuss."
209
- Analysis: First gather facts (tools), then discuss (no tools)
210
- Action:
211
- 1. executeAgentTask({
212
- agentId: "devops",
213
- title: "K8s Adoption Research",
214
- task: "Research Kubernetes adoption best practices for our scale. Include migration complexity, resource requirements, operational overhead, and security considerations."
215
- })
216
- 2. [Wait for results]
217
- 3. broadcast: "Based on the research, share your recommendations"
218
- \`\`\`
219
-
220
- ### Pattern 5: Implementation Task
221
- When an agent needs to create deliverables using their tools.
222
-
223
- \`\`\`
224
- User: "Write the landing page copy"
225
- Analysis: Agent produces artifacts using their tools
226
- Action: executeAgentTask({
227
- agentId: "copywriter",
228
- title: "Write Copy",
229
- task: "Write compelling landing page copy for [product]. Include headline, subheadline, feature descriptions, and CTA text."
230
- })
168
+ User: "Ask the frontend expert about React performance"
169
+ Analysis: User explicitly requested specific agent
170
+ Action: speak to frontend expert with the question
231
171
  \`\`\`
232
172
  </workflow_patterns>
233
173
 
234
174
  <tool_usage_guidelines>
235
- **Speaking:**
175
+ **Communication:**
236
176
  - speak: \`agentId\`, \`instruction\` (optional guidance)
237
177
  - broadcast: \`agentIds\` (array), \`instruction\` (optional shared guidance)
238
178
 
239
- **Task Execution:**
240
- - executeAgentTask: \`agentId\`, \`title\`, \`task\` (clear deliverable description), \`timeout\` (optional, default 30min)
241
- - interrupt: \`taskId\`
242
-
243
179
  **Flow Control:**
244
- - summarize: \`focus\` (optional), \`preserveRecent\` (messages to keep, default 5)
245
180
  - vote: \`question\`, \`options\` (array of {id, label, description}), \`voterAgentIds\` (optional), \`requireReasoning\` (default true)
246
181
  </tool_usage_guidelines>
247
182
 
248
183
  <best_practices>
249
- 1. **Don't over-engineer**: Simple questions speak; Complex tasks requiring tools → executeAgentTask
250
- 3. **Parallel when possible**: Use broadcast for opinions, parallel executeAgentTask for independent work
251
- 4. **Sequential when dependent**: Use speak chain when each response builds on previous
252
- 5. **Be explicit with task instructions**: For executeAgentTask, clearly describe expected deliverables
253
- 6. **Monitor long tasks**: Use interrupt if tasks run too long or go off-track
254
- 7. **Summarize proactively**: Compress context before it grows too large
255
- 8. **Explain your choices**: Tell users why you chose speaking vs task execution
184
+ 1. **Keep it simple**: Use speak for single agent, broadcast for multiple perspectives
185
+ 2. **Parallel when possible**: Use broadcast to gather diverse viewpoints quickly
186
+ 3. **Sequential when dependent**: Use speak chain when each response builds on previous
187
+ 4. **Be clear with instructions**: Provide context to help agents give better responses
188
+ 5. **Explain your choices**: Tell users why you chose speak vs broadcast
256
189
  </best_practices>
257
190
 
258
191
  <response_format>
259
192
  When orchestrating:
260
- 1. Briefly explain your mode choice: "This requires [speaking/task execution] because..."
261
- 2. For tasks, clearly state what each agent will do
262
- 3. After completion, synthesize results and provide actionable conclusions
263
- 4. Reference agents clearly: "Agent [Name] suggests..." or "Task [taskId] completed with..."
193
+ 1. Briefly explain your mode choice: "I'll ask [agent] because..." or "I'll gather perspectives from multiple agents because..."
194
+ 2. After agents respond, synthesize results and provide actionable conclusions
195
+ 3. Reference agents clearly: "Agent [Name] suggests..."
264
196
  </response_format>`;
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+
3
+ import type { BuiltinRenderProps } from '@lobechat/types';
4
+ import { memo } from 'react';
5
+
6
+ import type { AddPreferenceMemoryParams, AddPreferenceMemoryState } from '../../../types';
7
+ import { PreferenceMemoryCard } from '../../components';
8
+
9
+ const AddPreferenceMemoryRender = memo<
10
+ BuiltinRenderProps<AddPreferenceMemoryParams, AddPreferenceMemoryState>
11
+ >(({ args }) => {
12
+ return <PreferenceMemoryCard data={args} />;
13
+ });
14
+
15
+ AddPreferenceMemoryRender.displayName = 'AddPreferenceMemoryRender';
16
+
17
+ export default AddPreferenceMemoryRender;
@@ -2,6 +2,7 @@ import type { BuiltinRender } from '@lobechat/types';
2
2
 
3
3
  import { MemoryApiName } from '../../types';
4
4
  import AddExperienceMemoryRender from './AddExperienceMemory';
5
+ import AddPreferenceMemoryRender from './AddPreferenceMemory';
5
6
  import SearchUserMemoryRender from './SearchUserMemory';
6
7
 
7
8
  /**
@@ -11,5 +12,6 @@ import SearchUserMemoryRender from './SearchUserMemory';
11
12
  */
12
13
  export const MemoryRenders: Record<string, BuiltinRender> = {
13
14
  [MemoryApiName.addExperienceMemory]: AddExperienceMemoryRender as BuiltinRender,
15
+ [MemoryApiName.addPreferenceMemory]: AddPreferenceMemoryRender as BuiltinRender,
14
16
  [MemoryApiName.searchUserMemory]: SearchUserMemoryRender as BuiltinRender,
15
17
  };
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+
3
+ import type { BuiltinStreamingProps } from '@lobechat/types';
4
+ import { memo } from 'react';
5
+
6
+ import type { AddPreferenceMemoryParams } from '../../../types';
7
+ import { PreferenceMemoryCard } from '../../components';
8
+
9
+ export const AddPreferenceMemoryStreaming = memo<BuiltinStreamingProps<AddPreferenceMemoryParams>>(
10
+ ({ args }) => {
11
+ return <PreferenceMemoryCard data={args} loading />;
12
+ },
13
+ );
14
+
15
+ AddPreferenceMemoryStreaming.displayName = 'AddPreferenceMemoryStreaming';
16
+
17
+ export default AddPreferenceMemoryStreaming;
@@ -2,6 +2,7 @@ import { type BuiltinStreaming } from '@lobechat/types';
2
2
 
3
3
  import { MemoryApiName } from '../../types';
4
4
  import { AddExperienceMemoryStreaming } from './AddExperienceMemory';
5
+ import { AddPreferenceMemoryStreaming } from './AddPreferenceMemory';
5
6
 
6
7
  /**
7
8
  * Memory Streaming Components Registry
@@ -11,8 +12,8 @@ import { AddExperienceMemoryStreaming } from './AddExperienceMemory';
11
12
  */
12
13
  export const MemoryStreamings: Record<string, BuiltinStreaming> = {
13
14
  [MemoryApiName.addExperienceMemory]: AddExperienceMemoryStreaming as BuiltinStreaming,
15
+ [MemoryApiName.addPreferenceMemory]: AddPreferenceMemoryStreaming as BuiltinStreaming,
14
16
  };
15
17
 
16
-
17
-
18
- export {AddExperienceMemoryStreaming} from './AddExperienceMemory';
18
+ export { AddExperienceMemoryStreaming } from './AddExperienceMemory';
19
+ export { AddPreferenceMemoryStreaming } from './AddPreferenceMemory';