-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Type
Feature Request / Improvement
Problem
Robot learning policies (RL/IL) start each episode from scratch — they can't remember what worked in previous episodes. This limits sample efficiency and prevents experience transfer across tasks and environments.
Proposed Solution: robotmem
We built robotmem, an open-source cross-episode experience memory system for robot learning.
Core API:
learn()— Record episode outcomes with structured context (parameters, spatial info, success/failure)recall()— Retrieve relevant past experiences using semantic search + spatial nearest-neighborsession()— Automatic session-level experience consolidation
Experiment Results
Tested across 3 Gymnasium Robotics environments with heuristic policies:
| Environment | Baseline | With Memory | Delta | Setup |
|---|---|---|---|---|
| FetchPush-v4 | 42% | 67% | +25% | 10 seeds × 300 episodes |
| FetchPush → FetchSlide | 4% | 12% | +8% | Cross-environment transfer |
| Meta-World push-v3 | 21.5% | 32.6% | +11.1% | 5 seeds × 20 instances |
Mechanism: After exploration episodes, the policy recall()s the most relevant past successful experiences based on spatial similarity (e.g., object position), then adjusts strategy parameters accordingly.
All experiments are reproducible with --seed flags.
Integration Example
from robotmem.sdk import RobotMemory
mem = RobotMemory(collection="lerobot_experiment")
with mem.session(context={"task": "push"}) as sid:
for episode in range(num_episodes):
# Before episode — recall similar successful experiences
memories = mem.recall(
"successful push strategy",
n=3,
context_filter={"task.success": True},
spatial_sort={
"field": "spatial.object_position",
"target": current_obj_pos,
},
)
# ... run episode with memory-guided policy ...
# After episode — record experience
mem.learn(
insight=f"push: reward={reward:.1f}, success={success}",
context={
"params": {"push_speed": {"value": speed, "type": "scalar"}},
"spatial": {"object_position": obj_pos.tolist()},
"task": {"success": success, "reward": float(reward)},
},
session_id=sid,
)We also have a RobotMemCallback class that hooks into training loops (on_train_begin, on_episode_end, on_train_end).
ROS 2 Node
Related to #2093 — we have a ROS 2 Node with 7 services + 1 topic that wraps the Python SDK, enabling persistent memory for ROS-based robot deployments.
Install
pip install git+https://github.com/robotmem/robotmem.gitZero external service dependencies — SQLite + local ONNX embeddings. No GPU required.
Links
- Website: www.robotmem.com
- Repository: robotmem/robotmem
- Experiment scripts:
examples/fetch_push/,examples/metaworld/ - LeRobot callback:
examples/lerobot_callback.py - Colab demo:
examples/colab_demo.ipynb