Skip to content

feat: add offline OSHA safety compliance tool for vision models#6171

Open
anadya-s wants to merge 2 commits intoaden-hive:mainfrom
anadya-s:feat/osha_vision_tool
Open

feat: add offline OSHA safety compliance tool for vision models#6171
anadya-s wants to merge 2 commits intoaden-hive:mainfrom
anadya-s:feat/osha_vision_tool

Conversation

@anadya-s
Copy link

@anadya-s anadya-s commented Mar 11, 2026

Summary

This PR introduces osha_safety_tool.py, a localized reasoning tool designed to bridge computer vision models (like YOLOv8) with the Aden framework for automated safety compliance.

Why this is needed

Currently, handling continuous video frame anomalies (e.g., missing PPE on a job site) requires routing every detection through an LLM, which rapidly burns through API rate limits.

This tool provides a hardcoded, offline reasoning layer. It allows a vision model to pass a simple anomaly string ("no hard hat") to the agent, which then cross-references an internal database to return the exact official OSHA standard (e.g., OSHA 1926.100(a)) and protocol without hitting external APIs.

Changes Made

  • Created osha_safety_tool.py using the FastMCP pattern.
  • Added a foundational database of critical construction edge cases (headgear, fall protection, scaffolding).
  • Registered the tool in the _TOOL_MODULES and unverified tool registries.

Tested locally via a simulated YOLO-to-Agent bridge script.

Fixes #6172

@github-actions
Copy link

PR Requirements Warning

This PR does not meet the contribution requirements.
If the issue is not fixed within ~24 hours, it may be automatically closed.

Missing: No linked issue found.

To fix:

  1. Create or find an existing issue for this work
  2. Assign yourself to the issue
  3. Re-open this PR and add Fixes #123 in the description

Exception: To bypass this requirement, you can:

  • Add the micro-fix label or include micro-fix in your PR title for trivial fixes
  • Add the documentation label or include doc/docs in your PR title for documentation changes

Micro-fix requirements (must meet ALL):

Qualifies Disqualifies
< 20 lines changed Any functional bug fix
Typos & Documentation & Linting Refactoring for "clean code"
No logic/API/DB changes New features (even tiny ones)

Why is this required? See #472 for details.

@github-actions github-actions bot added the pr-requirements-warning PR doesn't follow contribution guidelines. Please fix or it will be auto-closed. label Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-requirements-warning PR doesn't follow contribution guidelines. Please fix or it will be auto-closed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add localized OSHA safety compliance tool for vision models

1 participant