# Robotmem

> Robot Memory - Persistent memory system for AI robots. MCP Server + hybrid search + spatial retrieval.

- **Type:** MCP server
- **Install:** `agentstack add mcp-robotmem-robotmem`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [robotmem](https://agentstack.voostack.com/s/robotmem)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [robotmem](https://github.com/robotmem)
- **Source:** https://github.com/robotmem/robotmem
- **Website:** https://robotmem.com

## Install

```sh
agentstack add mcp-robotmem-robotmem
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

[中文版](README_zh.md)

# robotmem — Let Robots Learn from Experience

> Your robot ran 1000 experiments, starting from scratch every time. robotmem stores episode experiences — parameters, trajectories, outcomes — and retrieves the most relevant ones to guide future decisions.

**FetchPush experiment**: +25% success rate improvement (42% → 67%), CPU-only, reproducible in 5 minutes.

  

## Quick Start

```bash
pip install robotmem
```

```python
from robotmem import learn, recall, save_perception, start_session, end_session

# Start an episode
session = start_session(context='{"robot_id": "arm-01", "task": "push"}')

# Record experience
learn(
    insight="grip_force=12.5N yields highest grasp success rate",
    context='{"params": {"grip_force": {"value": 12.5, "unit": "N"}}, "task": {"success": true}}'
)

# Retrieve experiences (structured filtering + spatial nearest-neighbor)
memories = recall(
    query="grip force parameters",
    context_filter='{"task.success": true}',
    spatial_sort='{"field": "spatial.position", "target": [1.3, 0.7, 0.42]}'
)

# Store perception data
save_perception(
    description="Grasp trajectory: 30 steps, success",
    perception_type="procedural",
    data='{"sampled_actions": [[0.1, -0.3, 0.05, 0.8], ...]}'
)

# End episode (auto-consolidation + proactive recall)
end_session(session_id=session["session_id"])
```

## 7 APIs

| API | Purpose |
|-----|---------|
| `learn` | Record physical experiences (parameters / strategies / lessons) |
| `recall` | Retrieve experiences — BM25 + vector hybrid search with `context_filter` and `spatial_sort` |
| `save_perception` | Store perception / trajectory / force data (visual / tactile / proprioceptive / auditory / procedural) |
| `forget` | Delete incorrect memories |
| `update` | Correct memory content |
| `start_session` | Begin an episode |
| `end_session` | End an episode (auto-consolidation + proactive recall) |

## Key Features

### Structured Experience Retrieval

Not just vector search — robotmem understands the structure of robot experiences:

```python
# Retrieve only successful experiences
recall(query="push to target", context_filter='{"task.success": true}')

# Find spatially nearest scenarios
recall(query="grasp object", spatial_sort='{"field": "spatial.object_position", "target": [1.3, 0.7, 0.42]}')

# Combine: success + distance  0.50 (protects constraint / postmortem / high-confidence entries)
- **Proactive Recall**: Returns historically relevant memories for the next episode

## FetchPush Demo

```bash
cd examples/fetch_push
pip install gymnasium-robotics
PYTHONPATH=../../src python demo.py  # 90 episodes, ~2 min
```

Three-phase experiment: baseline → memory writing → memory utilization. Expected Phase C success rate 10-20% higher than Phase A.

## Architecture

```
SQLite + FTS5 + vec0
├── BM25 full-text search (jieba CJK tokenizer)
├── Vector search (FastEmbed ONNX, CPU-only)
├── RRF fusion ranking
├── Structured filtering (context_filter)
└── Spatial nearest-neighbor sorting (spatial_sort)
```

- CPU-only, no GPU required
- Single-file database `~/.robotmem/memory.db`
- MCP Server (7 tools) or direct Python import
- Web management UI: `robotmem web`

## Comparison

| Feature | MemoryVLA (Academic) | Mem0 (Product) | **robotmem** |
|---------|---------------------|----------------|-------------|
| Target users | Specific VLA models | Text AI | **Robotic AI** |
| Memory format | Vectors (opaque) | Text | **Natural language + perception + parameters** |
| Structured filtering | No | No | **Yes (`context_filter`)** |
| Spatial retrieval | No | No | **Yes (`spatial_sort`)** |
| Physical parameters | No | No | **Yes (`params` section)** |
| Installation | Compile from paper code | pip install | **pip install** |
| Database | Embedded | Cloud | **Local SQLite** |

## License

Apache-2.0

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [robotmem](https://github.com/robotmem)
- **Source:** [robotmem/robotmem](https://github.com/robotmem/robotmem)
- **License:** Apache-2.0
- **Homepage:** https://robotmem.com

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-robotmem-robotmem
- Seller: https://agentstack.voostack.com/s/robotmem
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
