Skip to content

Commit ede5e81

Browse files
committed
fix: update README.md
1 parent 33fc280 commit ede5e81

File tree

1 file changed

+60
-96
lines changed

1 file changed

+60
-96
lines changed

README.md

Lines changed: 60 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -131,88 +131,32 @@ showcasing its capabilities in **information extraction**, **temporal and cross-
131131
- **🔌 Extensible**: Easily extend and customize memory modules, data sources, and LLM integrations.
132132
- **🏂 Lightweight Deployment** 🆕: Support for quick mode and complete mode deployment options.
133133

134-
## 📦 Installation
135134

136-
### Install via pip
137-
138-
```bash
139-
pip install MemoryOS
140-
```
141-
142-
### Optional Dependencies
143-
144-
MemOS provides several optional dependency groups for different features. You can install them based on your needs.
145-
146-
| Feature | Package Name |
147-
| --------------------- | ------------------------- |
148-
| Tree Memory | `MemoryOS[tree-mem]` |
149-
| Memory Reader | `MemoryOS[mem-reader]` |
150-
| Memory Scheduler | `MemoryOS[mem-scheduler]` |
151-
152-
Example installation commands:
153-
154-
```bash
155-
pip install MemoryOS[tree-mem]
156-
pip install MemoryOS[tree-mem,mem-reader]
157-
pip install MemoryOS[mem-scheduler]
158-
pip install MemoryOS[tree-mem,mem-reader,mem-scheduler]
159-
```
160-
161-
### External Dependencies
162-
163-
#### Ollama Support
164-
165-
To use MemOS with [Ollama](https://ollama.com/), first install the Ollama CLI:
166-
167-
```bash
168-
curl -fsSL https://ollama.com/install.sh | sh
169-
```
170-
171-
#### Transformers Support
172-
173-
To use functionalities based on the `transformers` library, ensure you have [PyTorch](https://pytorch.org/get-started/locally/) installed (CUDA version recommended for GPU acceleration).
174-
175-
#### Download Examples
135+
## 🚀 Quickstart Guide
176136

177-
To download example code, data and configurations, run the following command:
137+
### Get API Key
138+
- Sign up and get started on[`MemOS dashboard`](https://memos-dashboard.openmem.net/cn/quickstart/?source=landing)
139+
- Open the API Keys Console in the MemOS dashboard and copy the API Key into the initialization code
178140

179-
```bash
180-
memos download_examples
181-
```
182-
183-
## 🚀 Getting Started
184-
185-
### ⭐️ MemOS online API
186-
The easiest way to use MemOS. Equip your agent with memory **in minutes**!
187-
188-
Sign up and get started on[`MemOS dashboard`](https://memos-dashboard.openmem.net/cn/quickstart/?source=landing).
189-
190-
191-
### Self-Hosted Server
192-
1. Get the repository.
193-
```bash
194-
git clone https://github.com/MemTensor/MemOS.git
195-
cd MemOS
196-
pip install -r ./docker/requirements.txt
197-
```
141+
### Install via pip
198142

199-
2. Configure `docker/.env.example` and copy to `MemOS/.env`
200-
3. Start the service.
201143
```bash
202-
uvicorn memos.api.server_api:app --host 0.0.0.0 --port 8001 --workers 8
144+
pip install MemoryOS -U
203145
```
204146

205-
### Interface SDK
206-
#### Here is a quick example showing how to create interface SDK
147+
### Basic Usage
207148

208-
This interface is used to add messages, supporting multiple types of content and batch additions. MemOS will automatically parse the messages and handle memory for reference in subsequent conversations.
149+
- Initialize MemOS client with API Key to start sending requests
209150
```python
210151
# Please make sure MemoS is installed (pip install MemoryOS -U)
211152
from memos.api.client import MemOSClient
212153

213154
# Initialize the client using the API Key
214155
client = MemOSClient(api_key="YOUR_API_KEY")
156+
```
215157

158+
- This API allows you to add one or more messages to a specific conversation. As illustrated in the examples bellow, you can add messages in real time during a user-assistant interaction, import historical messages in bulk, or enrich the conversation with user preferences and behavior data. All added messages are transformed into memories by MemOS, enabling their retrieval in future conversations to support chat history management, user behavior tracking, and personalized interactions.
159+
```python
216160
messages = [
217161
{"role": "user", "content": "I have planned to travel to Guangzhou during the summer vacation. What chain hotels are available for accommodation?"},
218162
{"role": "assistant", "content": "You can consider [7 Days, All Seasons, Hilton], and so on."},
@@ -226,30 +170,19 @@ res = client.add_message(messages=messages, user_id=user_id, conversation_id=con
226170
print(f"result: {res}")
227171
```
228172

229-
This interface is used to retrieve the memories of a specified user, returning the memory fragments most relevant to the input query for Agent use. The recalled memory fragments include 'factual memory', 'preference memory', and 'tool memory'.
173+
- This API allows you to query a user’s memory and returns the fragments most relevant to the input. These can serve as references for the model when generating responses. As shown in the examples bellow, You can retrieve memory in real time during a user’s conversation with the AI, or perform a global search across their entire memory to create user profiles or support personalized recommendations, improving both dialogue coherence and personalization.
174+
In the latest update, in addition to “Fact Memory”, the system now supports “Preference Memory”, enabling LLM to respond in a way that better understands the user.
230175
```python
231-
# Please make sure MemoS is installed (pip install MemoryOS -U)
232-
from memos.api.client import MemOSClient
233-
234-
# Initialize the client using the API Key
235-
client = MemOSClient(api_key="YOUR_API_KEY")
236-
237176
query = "I want to go out to play during National Day. Can you recommend a city I haven't been to and a hotel brand I haven't stayed at?"
238177
user_id = "memos_user_123"
239-
conversation_id = "0928"
178+
conversation_id = "0610"
240179
res = client.search_memory(query=query, user_id=user_id, conversation_id=conversation_id)
241180

242181
print(f"result: {res}")
243182
```
244183

245-
This interface is used to delete the memory of specified users and supports batch deletion.
184+
- This API is used to delete specified user memories, supporting batch deletion.
246185
```python
247-
# Please make sure MemoS is installed (pip install MemoryOS -U)
248-
from memos.api.client import MemOSClient
249-
250-
# Initialize the client using the API Key
251-
client = MemOSClient(api_key="YOUR_API_KEY")
252-
253186
user_ids = ["memos_user_123"]
254187
# Replace with the memory ID
255188
memory_ids = ["6b23b583-f4c4-4a8f-b345-58d0c48fea04"]
@@ -258,14 +191,8 @@ res = client.delete_memory(user_ids=user_ids, memory_ids=memory_ids)
258191
print(f"result: {res}")
259192
```
260193

261-
This interface is used to add feedback to messages in the current session, allowing MemOS to correct its memory based on user feedback.
194+
- This API is used to add feedback to current session messages, allowing MemOS to correct memories based on user feedback.
262195
```python
263-
# Please make sure MemoS is installed (pip install MemoryOS -U)
264-
from memos.api.client import MemOSClient
265-
266-
# Initialize the client using the API Key
267-
client = MemOSClient(api_key="YOUR_API_KEY")
268-
269196
user_id = "memos_user_123"
270197
conversation_id = "memos_feedback_conv"
271198
feedback_content = "No, let's change it now to a meal allowance of 150 yuan per day and a lodging subsidy of 700 yuan per day for first-tier cities; for second- and third-tier cities, it remains the same as before."
@@ -282,14 +209,8 @@ res = client.add_feedback(
282209
print(f"result: {res}")
283210
```
284211

285-
This interface is used to create a knowledgebase associated with a project
212+
- This API is used to create a knowledgebase associated with a project
286213
```python
287-
# Please make sure MemoS is installed (pip install MemoryOS -U)
288-
from memos.api.client import MemOSClient
289-
290-
# Initialize the client using the API Key
291-
client = MemOSClient(api_key="YOUR_API_KEY")
292-
293214
knowledgebase_name = "Financial Reimbursement Knowledge Base"
294215
knowledgebase_description = "A compilation of all knowledge related to the company's financial reimbursements."
295216

@@ -300,6 +221,49 @@ res = client.create_knowledgebase(
300221
print(f"result: {res}")
301222
```
302223

224+
### Self-Hosted Server
225+
1. Get the repository.
226+
```bash
227+
git clone https://github.com/MemTensor/MemOS.git
228+
cd MemOS
229+
pip install -r ./docker/requirements.txt
230+
```
231+
2. Configure `docker/.env.example` and copy to `MemOS/.env`
232+
- The `OPENAI_API_KEY`,`MOS_EMBEDDER_API_KEY`,`MEMRADER_API_KEY` and others can be applied for through [`BaiLian`](https://bailian.console.aliyun.com/?spm=a2c4g.11186623.0.0.2f2165b08fRk4l&tab=api#/api).
233+
- Fill in the corresponding configuration in the `MemOS/.env` file.
234+
3. Start the service.
235+
```bash
236+
uvicorn memos.api.server_api:app --host 0.0.0.0 --port 8001 --workers 2
237+
```
238+
239+
For detailed integration steps, see the [`API Reference`](https://docs-pre.openmem.net/cn/open_source/getting_started/rest_api_server/#fork-memos-%E4%BB%93%E5%BA%93%E4%BB%A3%E7%A0%81httpsgithubcommemtensormemos-%E5%88%B0%E8%87%AA%E5%B7%B1%E7%9A%84%E4%BB%93%E5%BA%93).
240+
241+
Example
242+
- Add User Memory http://localhost:8000/product/add (POST)
243+
```json
244+
// Request params
245+
{
246+
"user_id": "8736b16e-1d20-4163-980b-a5063c3facdc",
247+
"mem_cube_id": "b32d0977-435d-4828-a86f-4f47f8b55bca",
248+
"messages": [
249+
{
250+
"role": "user",
251+
"content": "I like strawberry"
252+
}
253+
],
254+
"async_mode": "sync"
255+
}
256+
```
257+
- Query User Memory http://localhost:8000/product/search (POST)
258+
```json
259+
// Request params
260+
{
261+
"query": "What do I like",
262+
"user_id": "8736b16e-1d20-4163-980b-a5063c3facdc",
263+
"mem_cube_id": "b32d0977-435d-4828-a86f-4f47f8b55bca"
264+
}
265+
```
266+
303267
## 💬 Community & Support
304268

305269
Join our community to ask questions, share your projects, and connect with other developers.

0 commit comments

Comments
 (0)