Skip to content

Commit 3fb8708

Browse files
Update overview.md
1 parent 5bd4f4b commit 3fb8708

File tree

1 file changed

+43
-57
lines changed

1 file changed

+43
-57
lines changed

content/en/overview/quick_start/overview.md

Lines changed: 43 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ When building applications with large models, a common problem is: **How can AI
2929
MemOS provides two core APIs to help you achieve this:
3030

3131
- `addMessage` — Submit raw conversations to us, we automatically process and store them as memory
32-
- `searchMemory` — Recall relevant memories and optional suggested instructions in subsequent conversations, making AI responses more aligned with user needs
32+
- `searchMemory` — Recall factual memories and preference memories in subsequent conversations, so that the AI's responses are more aligned with the user's needs
3333

3434
![image.svg](https://cdn.memtensor.com.cn/img/1758686454660_pixumf_compressed.png)
3535

@@ -50,17 +50,16 @@ import os
5050
import requests
5151
import json
5252

53+
# Replace with your MemOS API Key
5354
os.environ["MEMOS_API_KEY"] = "YOUR_API_KEY"
5455
os.environ["MEMOS_BASE_URL"] = "https://memos.memtensor.cn/api/openmem/v1"
5556

5657
data = {
5758
"messages": [
58-
{"role": "user", "content": "I want to travel during summer vacation, can you recommend something?"},
59-
{"role": "assistant", "content": "Sure! Are you traveling alone or with family/friends?"},
60-
{"role": "user", "content": "Of course I’m bringing my kid, our family always travels together."},
61-
{"role": "assistant", "content": "Got it, so you’re traveling with your children as a family, right?"},
62-
{"role": "user", "content": "Yes, with both kids and elderly, we usually travel as a whole family."},
63-
{"role": "assistant", "content": "Understood, I’ll recommend destinations suitable for family trips."}
59+
{"role": "user", "content": "I’ve planned to travel to Guangzhou this summer. What chain hotels are available for accommodation?"},
60+
{"role": "assistant", "content": "You can consider options like 7 Days Inn, All Seasons, Hilton, etc."},
61+
{"role": "user", "content": "I’ll choose 7 Days Inn."},
62+
{"role": "assistant", "content": "Alright, feel free to ask me if you have any other questions."}
6463
],
6564
"user_id": "memos_user_123",
6665
"conversation_id": "0610"
@@ -83,17 +82,9 @@ print(res.json())
8382
::note
8483
**Conversation B: occurred on 2025-09-28**<br>
8584

86-
In a new conversation, when the user asks AI to recommend a National Day trip plan, MemOS automatically recalls relevant memories for AI reference, enabling more personalized recommendations.
85+
When the user asks in a new session for National Day travel and hotel recommendations, MemOS automatically recalls factual (where they’ve been) and preference memories (hotel choices) to help the AI give more personalized suggestions.
8786
::
8887

89-
> MemOS supports returning **`related memories (matches)`**, **`stitched instructions (instruction)` (coming soon)**, and **`full instructions (full_instruction)` (coming soon)** simultaneously. In practice, you only need to choose one based on your business needs.
90-
91-
> - **Need full control** → use **matches**, only returns memory items, developers manually stitch them into instructions;
92-
> - **Want to save stitching work, but still need to add business rules** → use **instruction**, system has combined memories and user query into semi-finished instructions, developers can further refine them;
93-
> - **Pursue one-click direct use** → use **full_instruction**, system has generated complete terminal instructions ready to be sent to the model.
94-
95-
> **Why this design**: Most memory systems stop at “recalling facts”, but facts ≠ executable Prompts. MemOS’s unique instruction completion chain saves you from complex stitching and fine-tuning, directly converting memories into model-readable and executable prompts.
96-
9788
```python
9889
import os
9990
import requests
@@ -103,16 +94,12 @@ os.environ["MEMOS_API_KEY"] = "YOUR_API_KEY"
10394
os.environ["MEMOS_BASE_URL"] = "https://memos.memtensor.cn/api/openmem/v1"
10495

10596
data = {
106-
"user_id": "memos_user_123",
107-
"conversation_id": "0928",
108-
"query": "Where to go for National Day travel?",
109-
"memory_limit_number": 6 # Optional, default is 6 if not provided
110-
111-
# ==== Coming Soon ====
112-
# The following parameters will be supported in future versions, please do not pass them now
113-
# "return_matches": True,
114-
# "return_instruction": True,
115-
# "return_full_instruction": True
97+
"user_id": "memos_user_123",
98+
"conversation_id": "0928",
99+
"query": "I want to travel during the National Day holiday. Please recommend a city I haven’t been to and a hotel brand I haven’t stayed at.",
100+
"memory_limit_number": 6, # Fact memory limit — if not provided, default is 6
101+
"include_preference":True, # Return preference memories — if not provided, defaults to enabled
102+
"preference_limit_number":6 # Preference memory limit — if not provided, default is 6
116103
}
117104

118105
headers = {
@@ -123,35 +110,34 @@ url = f"{os.environ['MEMOS_BASE_URL']}/search/memory"
123110

124111
res = requests.post(url=url, headers=headers, data=json.dumps(data))
125112

126-
# Mode 1: Related Memories (matches)
127113
print(f"result: {res.json()}")
128-
# Example output(simplified here for easier understanding, for reference only):
129-
# [
130-
# {
131-
# "memory_key": "Travel Habit",
132-
# "memory_value": "Travel with whole family (including kids and elderly)",
133-
# "confidence": 0.97,
134-
# "update_time": "2025-06-10T10:00:00Z"
135-
# }
136-
# ]
137-
138-
# Mode 2 (coming soon): Stitched Instruction (semi-finished, structured, easy for further processing)
139-
# print("Instruction:", results["data"]["instruction"])
140-
# Example output:
141-
# Task: Answer user’s “Where to go for National Day travel?”
142-
# Audience: Family trip (including kids and elderly)
143-
# Requirements:
144-
# - Explicitly consider the needs of children and elderly in the response
145-
# - Destination suggestions must align with “family-friendly”
146-
# Notes: If key information is missing (departure, budget, duration), add clarification strategies via business logic
147-
148-
# Mode 3 (coming soon): Full Instruction (terminal form, can be directly sent to model)
149-
# print("Full Instruction:", results["data"]["full_instruction"])
150-
# Example output:
151-
# You are a travel consultant.
152-
# The user always travels with their whole family (including kids and elderly).
153-
# Directly answer “Where to go for National Day travel?” and prioritize family-friendly destinations.
154-
# If information is insufficient, first ask clarification questions before giving suggestions.
114+
115+
# Example output (simplified for easier understanding, for reference only)
116+
117+
# Preference Memory
118+
# preference_detail_list [
119+
# {
120+
# "preference_type": "implicit_preference",
121+
# "preference": "Preference for budget-friendly accommodations.",
122+
# "reasoning": "The user's choice of 7 Days Inn over other options like Hilton suggests a potential preference for more budget-friendly accommodations. 7 Days Inn is known for being an economical option compared to Hilton, which is a higher-end hotel chain. This choice indicates that the user might prioritize cost-effectiveness in their accommodation decisions.",
123+
# "conversation_id": "0610"
124+
# }
125+
# ]
126+
127+
# Fact Memory
128+
# memory_detail_list [
129+
# {
130+
# "memory_key": "Summer travel plans to Guangzhou",
131+
# "memory_value": "The user has planned to travel to Guangzhou during the summer of 2024 and has chosen to stay at 7 Days Inn for accommodation.",
132+
# "conversation_id": "0610",
133+
# "tags": [
134+
# "travel",
135+
# "Guangzhou",
136+
# "accommodation",
137+
# "hotel choice"
138+
# ]
139+
# }
140+
# ]
155141
```
156142

157143
## 2. Option Two: Open-source Framework
@@ -170,13 +156,13 @@ Here we will explain in detail **how a message entering the system is processed
170156

171157
::note
172158
**Deep Understanding**<br>
173-
MemOS’s memory mechanism can be understood as a complete “workflow”:
174-
You submit raw messagesProcessed into memory → Scheduling mechanism arranges invocation and storage based on task and context, and dynamically adjusts memory formsRelevant memories are recalled when needed and injected as context or instructions → Lifecycle management ensures evolution and updates.
159+
MemOS’s memory mechanism works like a complete “workflow”:
160+
You send a messagethe system processes it into memory → the scheduler decides when to store or use it based on context and tasks, and can adjust its formrelated memories are recalled when needed → meanwhile, lifecycle management keeps them evolving and updated.
175161
::
176162

177163
- [Memory Production](/overview/quick_start/mem_production)
178164
- [Memory Scheduling](/overview/quick_start/mem_schedule)
179-
- [Memory Recall & Instruction Completion](/overview/quick_start/mem_recall)
165+
- [Memory Recall](/overview/quick_start/mem_recall)
180166
- [Memory Lifecycle Management](/overview/quick_start/mem_lifecycle)
181167

182168
### 3.2 Practice with MemOS

0 commit comments

Comments
 (0)