Skip to content

Commit 31ddd8e

Browse files
committed
Merge branch 'feat/modify_playground' of github.com:CaralHsi/MemOSRealPublic into feat/modify_playground
2 parents e62976c + bb0ef2c commit 31ddd8e

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/memos/memories/textual/tree_text_memory/retrieve/searcher.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,19 @@ def search(
9696
f"[TIMER] Graph embedding search took {(time.perf_counter() - search_start) * 1000:.2f} ms"
9797
)
9898

99+
# add some knowledge retrieved from internet to the context to avoid misunderstanding while parsing the task goal.
100+
if self.internet_retriever:
101+
supplyment_memory_items = self.internet_retriever.retrieve_from_internet(
102+
query=query, top_k=3
103+
)
104+
context.extend(
105+
[
106+
each_supplyment_item.memory.partition("\nContent: ")[-1]
107+
for each_supplyment_item in supplyment_memory_items
108+
]
109+
)
110+
111+
# Step 1a: Parse task structure into topic, concept, and fact levels
99112
parse_start = time.perf_counter()
100113
parsed_goal = self.task_goal_parser.parse(
101114
task_description=query,

src/memos/memories/textual/tree_text_memory/retrieve/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
2. Tags: thematic tags to help categorize and retrieve related memories.
66
3. Goal Type: retrieval | qa | generation
77
4. Rephrased instruction: Give a rephrased task instruction based on the former conversation to make it less confusing to look alone. If you think the task instruction is easy enough to understand, or there is no former conversation, set "rephrased_instruction" to an empty string.
8-
5. Need for internet search: If you think you need to search the internet to finish the rephrased/original user task instruction, set "internet_search" to True. Otherwise, set it to False.
8+
5. Need for internet search: If the user's task instruction only involves objective facts or can be completed without introducing external knowledge, set "internet_search" to False. Otherwise, set it to True.
99
6. Memories: Provide 2–5 short semantic expansions or rephrasings of the rephrased/original user task instruction. These are used for improved embedding search coverage. Each should be clear, concise, and meaningful for retrieval.
1010
1111
Task description:

src/memos/templates/mos_prompts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
- `memoriesID` is the specific memory ID from the available memories list
121121
122122
### Reference Examples
123-
- Correct: `[1:abc123]`, `[2:def456]`, `[3:ghi789]`, `[4:jkl101]`, `[5:mno112]`
123+
- Correct: `[1:abc123]`, `[2:def456]`, `[3:ghi789]`, `[4:jkl101][5:mno112]` (concatenate reference annotation directly while citing multiple memories)
124124
- Incorrect: `[1:abc123,2:def456]` (do not use connected format)
125125
126126
## Response Guidelines

0 commit comments

Comments
 (0)