You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# instructions_v1 = """Summarize the memory events into at least two groups according to the event content. An event can belong to multiple groups. You must output the summary in JSON format (Each group should have a simple name (only a-z and _ is allowed), and a list of event ids):
200
+
# [
201
+
# {
202
+
# "name": "",
203
+
# "describe":"",
204
+
# "event_ids": ["Event id here"]
205
+
# },
206
+
# {
207
+
# "name": "",
208
+
# "describe":"",
209
+
# "event_ids": ["Event id here"]
210
+
# }
211
+
# ]
212
+
# The event id must be derived from the provided events data.
213
+
# """
214
+
instructions_v2="""You are tasked with grouping memory events based on their content. Follow these requirements strictly:
215
+
216
+
1. **Core Task**: Summarize the provided memory events into at least 2 groups. An event can belong to multiple groups.
217
+
2. **Input Specification**: The input is structured memory events data containing unique event IDs (to be used directly in outputs) and event details (characters, time, location, event type, topic, emotion, etc.).
218
+
3. **Group Requirements**:
219
+
- **Name**: A concise name for the group, using only lowercase letters and underscores (e.g., "family_dinner_events").
220
+
- **Tags**: A list of entity tags extracted from the events in the group, covering characters, time, location, event type, topic, and emotion (e.g., ["Alice", "2023-10-01", "home", "reunion", "holiday_plans", "joyful"]).
221
+
- **Event IDs**: A list of event IDs from the input data that belong to the group (must match the IDs provided in the input).
222
+
4. **Output Format**: Strictly use JSON format with no extra content. The JSON structure must be:
223
+
{
224
+
"groups": [
225
+
{
226
+
"name": "group_name_1",
227
+
"tags": ["tag1", "tag2", ...],
228
+
"event_ids": ["event_id_1", "event_id_2", ...]
229
+
},
230
+
{
231
+
"name": "group_name_2",
232
+
"tags": ["tag3", "tag4", ...],
233
+
"event_ids": ["event_id_3", "event_id_4", ...]
234
+
}
235
+
]
236
+
}
237
+
5. **Prohibitions**: Do not fabricate event IDs, tags, or group names; all content must be derived from the input events data. Do not output any text outside the JSON structure.
238
+
239
+
"""
197
240
198
241
agent=Agent(
199
242
name="memory_summarizer",
200
243
description="A summarizer that summarizes the memory events.",
201
-
instruction="""Summarize the memory events into different groups according to the event content. An event can belong to multiple groups. You must output the summary in JSON format (Each group should have a simple name (only a-z and _ is allowed), and a list of event ids):
0 commit comments