Spaces:
Sleeping
Sleeping
π€ Contributing to Healthcare AI Platform
Thank you for your interest in contributing! This document provides guidelines for contributing to the project.
π Quick Start
- Fork the repository
- Clone your fork
git clone https://github.com/YOUR_USERNAME/healthcare-rag-agent.git cd healthcare-rag-agent - Create a branch
git checkout -b feature/your-feature-name - Install dependencies
pip install -r requirements-local.txt - Make your changes
- Test your changes
pytest tests/ - Commit and push
git add . git commit -m "feat: your feature description" git push origin feature/your-feature-name - Create a Pull Request
π Development Guidelines
Code Style
- Python: Follow PEP 8
- Formatting: Use
blackfor code formatting - Linting: Use
flake8for linting - Type hints: Use type hints where possible
- Docstrings: Use Google-style docstrings
Commit Messages
Follow conventional commits:
feat:- New featurefix:- Bug fixdocs:- Documentation changesrefactor:- Code refactoringtest:- Adding testschore:- Maintenance tasks
Examples:
feat: add multimodal image analysis
fix: resolve timeout in report analyzer
docs: update API documentation
π§ͺ Testing
Running Tests
# All tests
pytest tests/
# Specific test file
pytest tests/test_intelligence.py
# With coverage
pytest --cov=. tests/
Writing Tests
- Place tests in
tests/directory - Name test files
test_*.py - Use descriptive test names
- Include docstrings
Example:
def test_query_routing():
"""Test that router correctly classifies query types."""
router = RouterAgent()
result = router.route("What are diabetes symptoms?")
assert result["type"] == "symptom_check"
ποΈ Architecture Guidelines
Adding New Features
- Services (
services/) - Business logic - Agents (
agents/) - AI agents - API (
api/) - REST endpoints - UI (
streamlit_app/) - Frontend
File Organization
- Keep files focused and single-purpose
- Use clear, descriptive names
- Add docstrings to all modules
- Import from
utils/config.pyfor configuration
π Security
Important Rules
- Never commit API keys - Use environment variables
- Never commit
.envfiles - Use.env.exampleas template - Hash passwords - Use bcrypt
- Validate inputs - Sanitize all user inputs
- Log security events - Use audit service
Pre-commit Hooks
The project uses pre-commit hooks to prevent secrets from being committed:
# Install pre-commit
pip install pre-commit
pre-commit install
# Run manually
pre-commit run --all-files
π Documentation
When to Update Docs
- New features - Update README and feature docs
- API changes - Update API documentation
- Breaking changes - Update CHANGELOG
- Configuration - Update
.env.example
Documentation Files
README.md- Main project documentationUSER_GUIDE.md- User manualARCHITECTURE.md- System designdocs/features/- Feature-specific docs
π Reporting Bugs
Before Reporting
- Check existing issues
- Try latest version
- Reproduce the bug
- Gather logs and error messages
Bug Report Template
**Description**
Clear description of the bug
**Steps to Reproduce**
1. Go to...
2. Click on...
3. See error
**Expected Behavior**
What should happen
**Actual Behavior**
What actually happens
**Environment**
- OS: [e.g., macOS 14]
- Python: [e.g., 3.11]
- Version: [e.g., 1.0.0]
**Logs**
Paste relevant logs here
π‘ Feature Requests
Suggesting Features
- Check existing issues and roadmap
- Describe the problem it solves
- Explain the proposed solution
- Consider alternatives
Feature Request Template
**Problem**
What problem does this solve?
**Proposed Solution**
How should it work?
**Alternatives**
What other approaches did you consider?
**Additional Context**
Any other information
π― Areas for Contribution
High Priority
- Additional medical knowledge sources
- More comprehensive tests
- Performance optimizations
- UI/UX improvements
- Documentation improvements
Medium Priority
- Additional language support
- Mobile-friendly UI
- Export functionality
- Advanced visualizations
Advanced
- Real-time monitoring dashboard
- A/B testing framework
- Advanced analytics
- Integration with EHR systems
π Pull Request Process
- Update documentation if needed
- Add tests for new features
- Ensure all tests pass
- Update CHANGELOG if applicable
- Request review from maintainers
PR Checklist
- Code follows style guidelines
- Tests added and passing
- Documentation updated
- Commit messages follow convention
- No secrets in code
- Branch is up to date with main
π€ Questions?
- GitHub Issues: Open an issue
- Discussions: GitHub Discussions
π License
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to better healthcare AI! π