Skip to content

Commit 4e500a9

Browse files
authored
doc: Update readme (#458)
* doc: Update readme * feat(env): update .env.example * refactor(client): pref mem * fix pref type * chore(env): 更新环境变量配置文件
1 parent ccbffae commit 4e500a9

File tree

8 files changed

+90
-176
lines changed

8 files changed

+90
-176
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,27 @@ showcasing its capabilities in **information extraction**, **temporal and cross-
8181

8282
## 🚀 Getting Started
8383

84+
### ⭐️ MemOS online API
85+
The easiest way to use MemOS. Equip your agent with memory **in minutes**!
86+
87+
Sign up and get started on[`MemOS dashboard`](https://memos-dashboard.openmem.net/cn/quickstart/?source=landing).
88+
89+
90+
### Self-Hosted Server
91+
1. Get the repository.
92+
```bash
93+
git clone https://github.com/MemTensor/MemOS.git
94+
cd MemOS
95+
pip install -r ./docker/requirements.txt
96+
```
97+
98+
2. Configure `docker/.env.example` and copy to `MemOS/.env`
99+
3. Start the service.
100+
```bash
101+
uvicorn memos.api.server_api:app --host 0.0.0.0 --port 8001 --workers 8
102+
```
103+
104+
### Local SDK
84105
Here's a quick example of how to create a **`MemCube`**, load it from a directory, access its memories, and save it.
85106

86107
```python
@@ -102,7 +123,7 @@ for item in mem_cube.act_mem.get_all():
102123
mem_cube.dump("tmp/mem_cube")
103124
```
104125

105-
What about **`MOS`** (Memory Operating System)? It's a higher-level orchestration layer that manages multiple MemCubes and provides a unified API for memory operations. Here's a quick example of how to use MOS:
126+
**`MOS`** (Memory Operating System) is a higher-level orchestration layer that manages multiple MemCubes and provides a unified API for memory operations. Here's a quick example of how to use MOS:
106127

107128
```python
108129
from memos.configs.mem_os import MOSConfig

docker/.env.example

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,60 @@
11
# MemOS Environment Variables Configuration
2+
TZ=Asia/Shanghai
23

3-
# Path to memory storage (e.g. /tmp/data_test)
4-
MOS_CUBE_PATH=
4+
MOS_CUBE_PATH="/tmp/data_test" # Path to memory storage (e.g. /tmp/data_test)
5+
MOS_ENABLE_DEFAULT_CUBE_CONFIG="true" # Enable default cube config (true/false)
56

67
# OpenAI Configuration
7-
OPENAI_API_KEY= # Your OpenAI API key
8-
OPENAI_API_BASE= # OpenAI API base URL (default: https://api.openai.com/v1)
8+
OPENAI_API_KEY="sk-xxx" # Your OpenAI API key
9+
OPENAI_API_BASE="http://xxx" # OpenAI API base URL (default: https://api.openai.com/v1)
910

10-
# MemOS Feature Toggles
11-
MOS_ENABLE_DEFAULT_CUBE_CONFIG= # Enable default cube config (true/false)
12-
MOS_ENABLE_SCHEDULER= # Enable background scheduler (true/false)
11+
# MemOS Chat Model Configuration
12+
MOS_CHAT_MODEL=gpt-4o-mini
13+
MOS_CHAT_TEMPERATURE=0.8
14+
MOS_MAX_TOKENS=8000
15+
MOS_TOP_P=0.9
16+
MOS_TOP_K=50
17+
MOS_CHAT_MODEL_PROVIDER=openai
1318

14-
# Neo4j Configuration
15-
NEO4J_URI= # Neo4j connection URI (e.g. bolt://localhost:7687)
16-
NEO4J_USER= # Neo4j username
17-
NEO4J_PASSWORD= # Neo4j password
18-
MOS_NEO4J_SHARED_DB= # Shared Neo4j database name (if using multi-db)
19+
# graph db
20+
# neo4j
21+
NEO4J_BACKEND=xxx
22+
NEO4J_URI=bolt://xxx
23+
NEO4J_USER=xxx
24+
NEO4J_PASSWORD=xxx
25+
MOS_NEO4J_SHARED_DB=xxx
26+
NEO4J_DB_NAME=xxx
27+
28+
# tetxmem reog
29+
MOS_ENABLE_REORGANIZE=false
1930

2031
# MemOS User Configuration
21-
MOS_USER_ID= # Unique user ID
22-
MOS_SESSION_ID= # Session ID for current chat
23-
MOS_MAX_TURNS_WINDOW= # Max number of turns to keep in memory
32+
MOS_USER_ID=root
33+
MOS_SESSION_ID=default_session
34+
MOS_MAX_TURNS_WINDOW=20
35+
36+
# MemRader Configuration
37+
MEMRADER_MODEL=gpt-4o-mini
38+
MEMRADER_API_KEY=sk-xxx
39+
MEMRADER_API_BASE=http://xxx:3000/v1
40+
MEMRADER_MAX_TOKENS=5000
41+
42+
#embedding & rerank
43+
EMBEDDING_DIMENSION=1024
44+
MOS_EMBEDDER_BACKEND=universal_api
45+
MOS_EMBEDDER_MODEL=bge-m3
46+
MOS_EMBEDDER_API_BASE=http://xxx
47+
MOS_EMBEDDER_API_KEY=EMPTY
48+
MOS_RERANKER_BACKEND=http_bge
49+
MOS_RERANKER_URL=http://xxx
50+
# Ollama Configuration (for embeddings)
51+
#OLLAMA_API_BASE=http://xxx
2452

25-
# Ollama Configuration (for local embedding models)
26-
OLLAMA_API_BASE= # Ollama API base URL (e.g. http://localhost:11434)
53+
# milvus for pref mem
54+
MILVUS_URI=http://xxx
55+
MILVUS_USER_NAME=xxx
56+
MILVUS_PASSWORD=xxx
2757

28-
# Embedding Configuration
29-
MOS_EMBEDDER_BACKEND= # Embedding backend: openai, ollama, etc.
58+
# pref mem
59+
ENABLE_PREFERENCE_MEMORY=true
60+
RETURN_ORIGINAL_PREF_MEM=true

evaluation/.env-example

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,3 @@ SUPERMEMORY_API_KEY="sm_xxx"
2222
MEMOBASE_API_KEY="xxx"
2323
MEMOBASE_PROJECT_URL="http://***.***.***.***:8019"
2424

25-
# eval settings
26-
PRE_SPLIT_CHUNK=false
27-
28-
# Configuration Only For Scheduler
29-
# RabbitMQ Configuration
30-
MEMSCHEDULER_RABBITMQ_HOST_NAME=rabbitmq-cn-***.cn-***.amqp-32.net.mq.amqp.aliyuncs.com
31-
MEMSCHEDULER_RABBITMQ_USER_NAME=***
32-
MEMSCHEDULER_RABBITMQ_PASSWORD=***
33-
MEMSCHEDULER_RABBITMQ_VIRTUAL_HOST=memos
34-
MEMSCHEDULER_RABBITMQ_ERASE_ON_CONNECT=true
35-
MEMSCHEDULER_RABBITMQ_PORT=5672
36-
37-
# OpenAI Configuration
38-
MEMSCHEDULER_OPENAI_API_KEY=sk-***
39-
MEMSCHEDULER_OPENAI_BASE_URL=http://***.***.***.***:3000/v1
40-
MEMSCHEDULER_OPENAI_DEFAULT_MODEL=gpt-4o-mini
41-
42-
# Graph DB Configuration
43-
MEMSCHEDULER_GRAPHDBAUTH_URI=bolt://localhost:7687
44-
MEMSCHEDULER_GRAPHDBAUTH_USER=neo4j
45-
MEMSCHEDULER_GRAPHDBAUTH_PASSWORD=***
46-
MEMSCHEDULER_GRAPHDBAUTH_DB_NAME=neo4j
47-
MEMSCHEDULER_GRAPHDBAUTH_AUTO_CREATE=true

evaluation/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ This repository provides tools and scripts for evaluating the `LoCoMo`, `LongMem
1616
```
1717

1818
## Configuration
19-
20-
1. Copy the `.env-example` file to `.env`, and fill in the required environment variables according to your environment and API keys.
21-
22-
2. Copy the `configs-example/` directory to a new directory named `configs/`, and modify the configuration files inside it as needed. This directory contains model and API-specific settings.
19+
Copy the `.env-example` file to `.env`, and fill in the required environment variables according to your environment and API keys.
2320

2421
## Setup MemOS
2522
### local server

evaluation/configs-example/mem_cube_config.json

Lines changed: 0 additions & 51 deletions
This file was deleted.

evaluation/configs-example/mos_memos_config.json

Lines changed: 0 additions & 51 deletions
This file was deleted.

evaluation/scripts/utils/client.py

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -250,33 +250,23 @@ def search(self, query, user_id, top_k):
250250
preference_note = json.loads(response.text)["data"]["preference_note"]
251251
for i in text_mem_res:
252252
i.update({"memory": i.pop("memory_value")})
253+
explicit_pref_string = "Explicit Preference:"
254+
implicit_pref_string = "\n\nImplicit Preference:"
255+
explicit_idx = 0
256+
implicit_idx = 0
257+
for pref in pref_mem_res:
258+
if pref["preference_type"] == "explicit_preference":
259+
explicit_pref_string += f"\n{explicit_idx + 1}. {pref['preference']}"
260+
explicit_idx += 1
261+
if pref["preference_type"] == "implicit_preference":
262+
implicit_pref_string += f"\n{implicit_idx + 1}. {pref['preference']}"
263+
implicit_idx += 1
264+
265+
return {
266+
"text_mem": [{"memories": text_mem_res}],
267+
"pref_string": explicit_pref_string + implicit_pref_string + preference_note,
268+
}
253269

254-
explicit_prefs = [
255-
p["preference"]
256-
for p in pref_mem_res
257-
if p.get("preference_type", "") == "explicit_preference"
258-
]
259-
implicit_prefs = [
260-
p["preference"]
261-
for p in pref_mem_res
262-
if p.get("preference_type", "") == "implicit_preference"
263-
]
264-
265-
pref_parts = []
266-
if explicit_prefs:
267-
pref_parts.append(
268-
"Explicit Preference:\n"
269-
+ "\n".join(f"{i + 1}. {p}" for i, p in enumerate(explicit_prefs))
270-
)
271-
if implicit_prefs:
272-
pref_parts.append(
273-
"Implicit Preference:\n"
274-
+ "\n".join(f"{i + 1}. {p}" for i, p in enumerate(implicit_prefs))
275-
)
276-
277-
pref_string = "\n".join(pref_parts) + preference_note
278-
279-
return {"text_mem": [{"memories": text_mem_res}], "pref_string": pref_string}
280270
except Exception as e:
281271
if attempt < max_retries - 1:
282272
time.sleep(2**attempt)

src/memos/log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def close(self):
187187
},
188188
"handlers": {
189189
"console": {
190-
"level": "DEBUG",
190+
"level": selected_log_level,
191191
"class": "logging.StreamHandler",
192192
"stream": stdout,
193193
"formatter": "no_datetime",

0 commit comments

Comments
 (0)