better-mem0-mcp 1.1.0b21__py3-none-any.whl → 1.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- better_mem0_mcp/docs/memory.md +1 -14
- better_mem0_mcp/server.py +9 -16
- {better_mem0_mcp-1.1.0b21.dist-info → better_mem0_mcp-1.1.2.dist-info}/METADATA +31 -56
- better_mem0_mcp-1.1.2.dist-info/RECORD +11 -0
- better_mem0_mcp/__main__.py +0 -6
- better_mem0_mcp-1.1.0b21.dist-info/RECORD +0 -12
- {better_mem0_mcp-1.1.0b21.dist-info → better_mem0_mcp-1.1.2.dist-info}/WHEEL +0 -0
- {better_mem0_mcp-1.1.0b21.dist-info → better_mem0_mcp-1.1.2.dist-info}/entry_points.txt +0 -0
- {better_mem0_mcp-1.1.0b21.dist-info → better_mem0_mcp-1.1.2.dist-info}/licenses/LICENSE +0 -0
better_mem0_mcp/docs/memory.md
CHANGED
|
@@ -17,8 +17,6 @@ Save information to long-term memory. Mem0 automatically:
|
|
|
17
17
|
{"action": "add", "content": "User prefers dark mode and uses FastAPI"}
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
**Response:** `Saved: {results: [{id, memory, event}]}`
|
|
21
|
-
|
|
22
20
|
### search
|
|
23
21
|
Semantic search across stored memories. Combines vector search with graph context.
|
|
24
22
|
|
|
@@ -26,8 +24,6 @@ Semantic search across stored memories. Combines vector search with graph contex
|
|
|
26
24
|
{"action": "search", "query": "coding preferences", "limit": 5}
|
|
27
25
|
```
|
|
28
26
|
|
|
29
|
-
**Response:** Formatted list of matching memories with optional graph context.
|
|
30
|
-
|
|
31
27
|
### list
|
|
32
28
|
Get all stored memories for a user.
|
|
33
29
|
|
|
@@ -35,8 +31,6 @@ Get all stored memories for a user.
|
|
|
35
31
|
{"action": "list"}
|
|
36
32
|
```
|
|
37
33
|
|
|
38
|
-
**Response:** `Memories (N): - [id] memory text`
|
|
39
|
-
|
|
40
34
|
### delete
|
|
41
35
|
Remove a memory by ID.
|
|
42
36
|
|
|
@@ -44,17 +38,10 @@ Remove a memory by ID.
|
|
|
44
38
|
{"action": "delete", "memory_id": "abc12345-..."}
|
|
45
39
|
```
|
|
46
40
|
|
|
47
|
-
**Response:** `Deleted: {memory_id}`
|
|
48
|
-
|
|
49
41
|
## Parameters
|
|
50
42
|
- `action` - Required: add, search, list, delete
|
|
51
43
|
- `content` - Required for add: information to remember
|
|
52
44
|
- `query` - Required for search: what to search for
|
|
53
45
|
- `memory_id` - Required for delete: ID of memory to remove
|
|
54
46
|
- `limit` - Optional for search: max results (default: 5)
|
|
55
|
-
- `user_id` - Optional: scope memories to a specific user
|
|
56
|
-
|
|
57
|
-
## Technical Notes
|
|
58
|
-
- Mem0 API returns `{"results": [...]}` for both `search()` and `get_all()`
|
|
59
|
-
- Graph context is automatically included in search results when available
|
|
60
|
-
- Embeddings use 1536 dimensions for pgvector HNSW compatibility
|
|
47
|
+
- `user_id` - Optional: scope memories to a specific user
|
better_mem0_mcp/server.py
CHANGED
|
@@ -108,24 +108,21 @@ async def memory(
|
|
|
108
108
|
if not query:
|
|
109
109
|
return "Error: 'query' required for search action"
|
|
110
110
|
|
|
111
|
-
# Vector search
|
|
112
|
-
|
|
113
|
-
memories = (
|
|
114
|
-
response.get("results", []) if isinstance(response, dict) else response
|
|
115
|
-
)
|
|
111
|
+
# Vector search
|
|
112
|
+
results = _memory.search(query, user_id=user_id, limit=limit)
|
|
116
113
|
|
|
117
114
|
# Add graph context
|
|
118
115
|
graph_context = ""
|
|
119
116
|
if _graph:
|
|
120
117
|
graph_context = _graph.get_context(query, user_id)
|
|
121
118
|
|
|
122
|
-
if not
|
|
119
|
+
if not results and not graph_context:
|
|
123
120
|
return "No memories found."
|
|
124
121
|
|
|
125
122
|
output = ""
|
|
126
|
-
if
|
|
123
|
+
if results:
|
|
127
124
|
output = "Memories:\n" + "\n".join(
|
|
128
|
-
[f"- {
|
|
125
|
+
[f"- {r.get('memory', str(r))}" for r in results]
|
|
129
126
|
)
|
|
130
127
|
if graph_context:
|
|
131
128
|
output += f"\n\n{graph_context}"
|
|
@@ -133,17 +130,13 @@ async def memory(
|
|
|
133
130
|
return output
|
|
134
131
|
|
|
135
132
|
elif action == "list":
|
|
136
|
-
|
|
137
|
-
response = _memory.get_all(user_id=user_id)
|
|
138
|
-
memories = (
|
|
139
|
-
response.get("results", []) if isinstance(response, dict) else response
|
|
140
|
-
)
|
|
133
|
+
results = _memory.get_all(user_id=user_id)
|
|
141
134
|
|
|
142
|
-
if not
|
|
135
|
+
if not results:
|
|
143
136
|
return "No memories stored."
|
|
144
137
|
|
|
145
|
-
lines = [f"- [{
|
|
146
|
-
return f"Memories ({len(
|
|
138
|
+
lines = [f"- [{r['id'][:8]}] {r['memory']}" for r in results]
|
|
139
|
+
return f"Memories ({len(results)}):\n" + "\n".join(lines)
|
|
147
140
|
|
|
148
141
|
elif action == "delete":
|
|
149
142
|
if not memory_id:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: better-mem0-mcp
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
4
4
|
Summary: Zero-setup MCP Server for AI memory - works with Neon/Supabase
|
|
5
5
|
Project-URL: Homepage, https://github.com/n24q02m/better-mem0-mcp
|
|
6
6
|
Project-URL: Repository, https://github.com/n24q02m/better-mem0-mcp.git
|
|
@@ -29,28 +29,16 @@ Description-Content-Type: text/markdown
|
|
|
29
29
|
|
|
30
30
|
# better-mem0-mcp
|
|
31
31
|
|
|
32
|
-
**
|
|
32
|
+
**Zero-setup** MCP Server for AI memory. Works with Neon/Supabase free tier.
|
|
33
33
|
|
|
34
|
-
[](https://hub.docker.com/r/n24q02m/better-mem0-mcp)
|
|
36
|
-
[](LICENSE)
|
|
37
|
-
|
|
38
|
-
## Features
|
|
39
|
-
|
|
40
|
-
- **Self-hosted PostgreSQL** - Your data stays with you (Neon/Supabase free tier supported)
|
|
41
|
-
- **Graph Memory** - SQL-based relationship tracking alongside vector memory
|
|
42
|
-
- **Multi-provider LLM** - Gemini, OpenAI, Anthropic, Groq, DeepSeek, Mistral
|
|
43
|
-
- **Fallback chains** - Multi-key per provider + multi-model fallback
|
|
44
|
-
- **Zero manual setup** - Just `DATABASE_URL` + `API_KEYS`
|
|
45
|
-
|
|
46
|
-
---
|
|
34
|
+
[](https://opensource.org/licenses/MIT)
|
|
47
35
|
|
|
48
36
|
## Quick Start
|
|
49
37
|
|
|
50
38
|
### 1. Get Prerequisites
|
|
51
39
|
|
|
52
|
-
- **Database**: [Neon](https://neon.tech) or [Supabase](https://supabase.com) (free tier
|
|
53
|
-
- **API Key**:
|
|
40
|
+
- **Database**: [Neon](https://neon.tech) or [Supabase](https://supabase.com) (free tier)
|
|
41
|
+
- **API Key**: [Google AI Studio](https://aistudio.google.com/apikey) (free tier)
|
|
54
42
|
|
|
55
43
|
### 2. Add to mcp.json
|
|
56
44
|
|
|
@@ -59,9 +47,9 @@ Description-Content-Type: text/markdown
|
|
|
59
47
|
```json
|
|
60
48
|
{
|
|
61
49
|
"mcpServers": {
|
|
62
|
-
"
|
|
50
|
+
"memory": {
|
|
63
51
|
"command": "uvx",
|
|
64
|
-
"args": ["better-mem0-mcp
|
|
52
|
+
"args": ["better-mem0-mcp"],
|
|
65
53
|
"env": {
|
|
66
54
|
"DATABASE_URL": "postgresql://user:pass@xxx.neon.tech/neondb?sslmode=require",
|
|
67
55
|
"API_KEYS": "gemini:AIza..."
|
|
@@ -76,7 +64,7 @@ Description-Content-Type: text/markdown
|
|
|
76
64
|
```json
|
|
77
65
|
{
|
|
78
66
|
"mcpServers": {
|
|
79
|
-
"
|
|
67
|
+
"memory": {
|
|
80
68
|
"command": "docker",
|
|
81
69
|
"args": ["run", "-i", "--rm", "-e", "DATABASE_URL", "-e", "API_KEYS", "n24q02m/better-mem0-mcp:latest"],
|
|
82
70
|
"env": {
|
|
@@ -90,7 +78,7 @@ Description-Content-Type: text/markdown
|
|
|
90
78
|
|
|
91
79
|
### 3. Done!
|
|
92
80
|
|
|
93
|
-
Ask
|
|
81
|
+
Ask Claude: "Remember that I prefer dark mode and use FastAPI"
|
|
94
82
|
|
|
95
83
|
---
|
|
96
84
|
|
|
@@ -98,26 +86,22 @@ Ask your AI: "Remember that I prefer dark mode and use FastAPI"
|
|
|
98
86
|
|
|
99
87
|
| Variable | Required | Description |
|
|
100
88
|
|----------|----------|-------------|
|
|
101
|
-
| `DATABASE_URL` | Yes | PostgreSQL
|
|
102
|
-
| `API_KEYS` | Yes | `provider:key
|
|
103
|
-
| `LLM_MODELS` | No |
|
|
104
|
-
| `EMBEDDER_MODELS` | No |
|
|
105
|
-
|
|
106
|
-
### Supported Providers
|
|
107
|
-
|
|
108
|
-
`gemini`, `openai`, `anthropic`, `groq`, `deepseek`, `mistral`
|
|
89
|
+
| `DATABASE_URL` | Yes | PostgreSQL connection string |
|
|
90
|
+
| `API_KEYS` | Yes | `provider:key,...` (multi-key per provider OK) |
|
|
91
|
+
| `LLM_MODELS` | No | `provider/model,...` (fallback chain) |
|
|
92
|
+
| `EMBEDDER_MODELS` | No | `provider/model,...` (fallback chain) |
|
|
109
93
|
|
|
110
94
|
### Examples
|
|
111
95
|
|
|
112
|
-
**
|
|
113
|
-
```
|
|
96
|
+
**Minimal (Gemini only):**
|
|
97
|
+
```
|
|
114
98
|
API_KEYS=gemini:AIza...
|
|
115
99
|
```
|
|
116
100
|
|
|
117
101
|
**Multi-key with fallback:**
|
|
118
|
-
```
|
|
102
|
+
```
|
|
119
103
|
API_KEYS=gemini:AIza-1,gemini:AIza-2,openai:sk-xxx
|
|
120
|
-
LLM_MODELS=gemini/gemini-
|
|
104
|
+
LLM_MODELS=gemini/gemini-2.5-flash,openai/gpt-4o-mini
|
|
121
105
|
EMBEDDER_MODELS=gemini/gemini-embedding-001,openai/text-embedding-3-small
|
|
122
106
|
```
|
|
123
107
|
|
|
@@ -125,7 +109,7 @@ EMBEDDER_MODELS=gemini/gemini-embedding-001,openai/text-embedding-3-small
|
|
|
125
109
|
|
|
126
110
|
| Setting | Default |
|
|
127
111
|
|---------|---------|
|
|
128
|
-
| `LLM_MODELS` | `gemini/gemini-
|
|
112
|
+
| `LLM_MODELS` | `gemini/gemini-2.5-flash` |
|
|
129
113
|
| `EMBEDDER_MODELS` | `gemini/gemini-embedding-001` |
|
|
130
114
|
|
|
131
115
|
---
|
|
@@ -134,41 +118,32 @@ EMBEDDER_MODELS=gemini/gemini-embedding-001,openai/text-embedding-3-small
|
|
|
134
118
|
|
|
135
119
|
| Tool | Description |
|
|
136
120
|
|------|-------------|
|
|
137
|
-
| `memory` |
|
|
138
|
-
| `help` |
|
|
121
|
+
| `memory` | `action`: add, search, list, delete |
|
|
122
|
+
| `help` | Detailed documentation |
|
|
139
123
|
|
|
140
|
-
### Usage
|
|
124
|
+
### Usage
|
|
141
125
|
|
|
142
126
|
```json
|
|
143
127
|
{"action": "add", "content": "I prefer TypeScript over JavaScript"}
|
|
144
|
-
{"action": "search", "query": "
|
|
128
|
+
{"action": "search", "query": "preferences"}
|
|
145
129
|
{"action": "list"}
|
|
146
130
|
{"action": "delete", "memory_id": "abc123"}
|
|
147
131
|
```
|
|
148
132
|
|
|
149
133
|
---
|
|
150
134
|
|
|
151
|
-
##
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
git clone https://github.com/n24q02m/better-mem0-mcp
|
|
155
|
-
cd better-mem0-mcp
|
|
135
|
+
## Why better-mem0-mcp?
|
|
156
136
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
**Requirements:** Python 3.13+
|
|
137
|
+
| Feature | Official mem0-mcp | better-mem0-mcp |
|
|
138
|
+
|---------|-------------------|-----------------|
|
|
139
|
+
| Storage | Mem0 Cloud | **Self-hosted PostgreSQL** |
|
|
140
|
+
| Graph Memory | No | **Yes (SQL-based)** |
|
|
141
|
+
| LLM Provider | OpenAI only | **Any (Gemini/OpenAI/Ollama/...)** |
|
|
142
|
+
| Fallback | No | **Yes (multi-key + multi-model)** |
|
|
143
|
+
| Setup | API Key | **DATABASE_URL + API_KEYS** |
|
|
165
144
|
|
|
166
145
|
---
|
|
167
146
|
|
|
168
|
-
## Contributing
|
|
169
|
-
|
|
170
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
171
|
-
|
|
172
147
|
## License
|
|
173
148
|
|
|
174
|
-
MIT
|
|
149
|
+
MIT
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
better_mem0_mcp/__init__.py,sha256=fcqgbz2HvMCPidqqoPvtRky5pGIHP2w9oVim7UQkuBc,106
|
|
2
|
+
better_mem0_mcp/config.py,sha256=vgKLIw3jHyeBLTzzBnuHV5x6Nra0Rbav1IJRL8rLCuk,5576
|
|
3
|
+
better_mem0_mcp/graph.py,sha256=rE9z6XECiAktEqDNgmwqCpFpvKSn3azO9H4sRBhj8UU,6195
|
|
4
|
+
better_mem0_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
better_mem0_mcp/server.py,sha256=O6s0L1FggB9FDfX4OKF6govrRznwUIAh9RkFRCrYX3Y,5124
|
|
6
|
+
better_mem0_mcp/docs/memory.md,sha256=jqoxBYHVh2N9TZbt77qY5zhL1vSU-Ro-yuaczT1r7Mo,1126
|
|
7
|
+
better_mem0_mcp-1.1.2.dist-info/METADATA,sha256=-Ccmz2b162rXT7n0AnE6wbTRS2R1n3o7FG4vWOYWcZU,3871
|
|
8
|
+
better_mem0_mcp-1.1.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
9
|
+
better_mem0_mcp-1.1.2.dist-info/entry_points.txt,sha256=2b7E3D6yo94mQXP2Ms0bhUlWkK9f664f0GrstImOq30,57
|
|
10
|
+
better_mem0_mcp-1.1.2.dist-info/licenses/LICENSE,sha256=d7xQ6sRyeGus6gnvwgqiQtSY7XdFw0Jd0w5-Co_xHnk,1064
|
|
11
|
+
better_mem0_mcp-1.1.2.dist-info/RECORD,,
|
better_mem0_mcp/__main__.py
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
better_mem0_mcp/__init__.py,sha256=fcqgbz2HvMCPidqqoPvtRky5pGIHP2w9oVim7UQkuBc,106
|
|
2
|
-
better_mem0_mcp/__main__.py,sha256=IeeRidmZF4oBaamjQM6FUbhXpsSdE4sQF_6y_D2GEE4,116
|
|
3
|
-
better_mem0_mcp/config.py,sha256=vgKLIw3jHyeBLTzzBnuHV5x6Nra0Rbav1IJRL8rLCuk,5576
|
|
4
|
-
better_mem0_mcp/graph.py,sha256=rE9z6XECiAktEqDNgmwqCpFpvKSn3azO9H4sRBhj8UU,6195
|
|
5
|
-
better_mem0_mcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
better_mem0_mcp/server.py,sha256=QYLP46pz0U9gkxQKB_g8FMga77ywElMMjSCU-hGZQ-M,5499
|
|
7
|
-
better_mem0_mcp/docs/memory.md,sha256=198dDuAGccG5Ca7rhEXIU03ZhxNKK44B_Brl2glurGc,1608
|
|
8
|
-
better_mem0_mcp-1.1.0b21.dist-info/METADATA,sha256=UPLzfj_0duOqDHdUY9uP0hxLAjhCRp9rV02T8ii633s,4543
|
|
9
|
-
better_mem0_mcp-1.1.0b21.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
10
|
-
better_mem0_mcp-1.1.0b21.dist-info/entry_points.txt,sha256=2b7E3D6yo94mQXP2Ms0bhUlWkK9f664f0GrstImOq30,57
|
|
11
|
-
better_mem0_mcp-1.1.0b21.dist-info/licenses/LICENSE,sha256=d7xQ6sRyeGus6gnvwgqiQtSY7XdFw0Jd0w5-Co_xHnk,1064
|
|
12
|
-
better_mem0_mcp-1.1.0b21.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|