File size: 1,623 Bytes
cdb66db
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
title: Agent Memory
emoji: 🧠
colorFrom: purple
colorTo: red
sdk: docker
pinned: false
short_description: Multi-tier Memory MCP Server for AI Agents
---

# 🧠 AGENT MEMORY — Multi-tier Memory MCP

Memory tiers: **episodic** · **semantic** · **procedural** · **working** (TTL)

## MCP — Claude Desktop
```json
{
  "mcpServers": {
    "agent-memory": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://chris4k-agent-memory.hf.space/mcp/sse"]
    }
  }
}
```

## MCP Tools
| Tool | Description |
|---|---|
| `memory_store` | Store a memory with tier, tags, importance |
| `memory_search` | Full-text search across all memories |
| `memory_recall` | Get memory by ID |
| `memory_update` | Update content, tags, importance |
| `memory_forget` | Delete a memory |
| `memory_list` | List by tier/tag/agent |
| `memory_stats` | Counts per tier |

## REST API
```
GET    /api/memories?tier=semantic&tag=jarvis
GET    /api/memories/search?q=GDPR&tier=all
GET    /api/memories/{id}
POST   /api/memories     {"content":"...","tier":"episodic","tags":[],"importance":7}
PATCH  /api/memories/{id}
DELETE /api/memories/{id}
GET    /api/stats
```

## Agent Usage
```python
import requests
BASE = "https://chris4k-agent-memory.hf.space"

# Store a memory
requests.post(f"{BASE}/api/memories", json={
    "content": "User prefers async Python with FastAPI for all backend services.",
    "tier": "semantic", "tags": ["preference","python"], "agent": "jarvis", "importance": 8
})

# Search
r = requests.get(f"{BASE}/api/memories/search?q=FastAPI&limit=5")
print(r.json())
```

*Chris4K · ki-fusion-labs.de*