-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add RAG-based Robot Dataset Health Analysis (Cohere Hackathon) #2127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add RAG-based Robot Dataset Health Analysis (Cohere Hackathon) #2127
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a comprehensive RAG-based robot dataset health analysis system for the Cohore hackathon. The system analyzes robot motor data to identify outliers and provides conversational insights about dataset quality.
- Adds RAG system for analyzing robot motor averages with outlier detection and health scoring
- Implements data collection script for extracting initial position statistics from robot datasets
- Provides conversational AI interface using Cohere for dataset health insights and explanations
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
src/lerobot/scripts/rag_robot_health.py | Main RAG system with FAISS indexing, Cohere integration, and CLI for dataset health analysis |
src/lerobot/scripts/collect_initpos.py | Data collection script for extracting motor averages and first frames from robot episodes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Sahana Venkatesh <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Sahana Venkatesh <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Sahana Venkatesh <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Sahana Venkatesh <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Accepts motor-major JSON with floats/strings/lists. | ||
Returns: motor -> {episode_id: float_mean} | ||
""" | ||
raw = json.loads(Path(path).read_text()) |
Copilot
AI
Oct 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON loading should include error handling to prevent potential security issues from malformed files. Consider using a try-except block around the JSON parsing.
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <[email protected]> Signed-off-by: Sahana Venkatesh <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Sahana Venkatesh <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Sahana Venkatesh <[email protected]>
RAG-based Robot Dataset Health Analysis (Cohere Hackathon)
Labels:
π§ feature
π evaluation
ποΈ tooling
Scope: Adds RAG-based dataset QA, outlier detection over motor stats, and a conversational explainer.
What this does
This PR introduces a lightweight βDataset Doctorβ for LeRobot datasets:
RAG health analysis over per-episode motor statistics with FAISS indexing.
Outlier detection + scoring on initial joint/motor positions (means/variance) to surface suspicious episodes.
Conversational insights via Cohere to explain why an episode/segment looks unhealthy and suggest curation actions.
CLI tools for batch analysis and interactive Q&A.
Two new scripts:
src/lerobot/scripts/collect_initpos.py
: extracts per-episode first-frame motor statistics & thumbnails.src/lerobot/scripts/rag_robot_health.py
: builds FAISS index, runs outlier scoring, and exposes a chat interface.No training code or existing evaluation logic is modified. Default behavior is opt-in and isolated under
src/lerobot/scripts/
.Why it matters
Robotic datasets are noisy and grow in breadth, not depth. Fast, explainable QA reduces wasted training cycles and helps contributors spot drift, recording mistakes, and hardware quirks before they poison experiments.
How it was tested
Unit-ish checks (local):
collect_initpos.py
on small subsets oflerobot/pusht
and a local ALOHA capture to confirm schema + I/O.E2E smoke:
Perf notes:
Determinism: Fixed random seeds where relevant; pure CPU path.
How to check out & try (reviewer quickstart)
What to look for
..._health_report.json
β includes per-episode z-scores, outlier flags, and a dataset-level health score.Implementation notes
[motor_mean..., motor_std...]
.episode_id
,motor_mean_*
,motor_std_*
,timestamp_first_frame
,thumb_path
.Backward compatibility
Trade-offs / Limitations
Documentation
--help
for both scripts.docs/
.Future work (follow-ups I can own)
tests/
with a tiny synthetic dataset to validate: schema, index round-trip, outlier thresholds.lerobot
eval suite behind a flag.Security & Privacy
Changelog
src/lerobot/scripts/collect_initpos.py
β newsrc/lerobot/scripts/rag_robot_health.py
β new