This guide explains how to integrate SOHH (Self-Optimizing Holo-Half) evaluation framework into your OpenSpace project. The integration is zero-config, non-breaking, and provides immediate value through automated performance monitoring.
After integration, you'll have:
- Automatic Performance Tracking - Every task execution is monitored
- Professional HTML Reports - Six-dimensional capability radar charts
- Historical Trend Analysis - Track improvement over time
- A/B Testing Framework - Compare different strategies scientifically
- Execution Trace Visualization - See exactly how tasks are executed
All with just 3 lines of code!
Best for: Quick setup, minimal code changes
Copy these files to your OpenSpace project root:
openspace_sohh_adapter.py # Core adapter (6.3KB)
sohh_standard_interface.py # Data collection interface (36.8KB)
user_scoring/ # Report generation module
├── __init__.py
├── visualization_report.py # HTML report generator (66.5KB)
└── ... (other modules)
plugins/ # Log analysis plugins
├── __init__.py
├── base.py
└── openspace_analyzer.py # OpenSpace log parser (9.0KB)
Before:
from openspace.tool_layer import OpenSpace
agent = OpenSpace(config=config)
await agent.initialize()
result = await agent.execute("Your task...")After:
from openspace_sohh_adapter import MonitoredOpenSpace
# Just replace OpenSpace with MonitoredOpenSpace
agent = MonitoredOpenSpace(
config=config,
project_id="my-project" # Optional: identify your project
)
await agent.initialize()
# All tasks are automatically monitored!
result = await agent.execute("Your task...")
# Generate report anytime
report_path = agent.generate_sohh_report()
print(f"Report saved to: {report_path}")That's it! No other changes needed.
Best for: Fine-grained control, custom workflows
Same as Option 1, copy the required files.
from sohh_standard_interface import SOHHDataCollector
# Initialize collector
collector = SOHHDataCollector(
agent_id="openspace-v1.0",
project_id="my-project"
)
# For each task:
task_id = "task-001"
collector.start_task(
task_id=task_id,
description="Implement user authentication"
)
try:
# Execute your task
result = await execute_task(...)
# End tracking
collector.end_task(
task_id=task_id,
success=result.success,
iterations=result.iterations,
error_message=result.error if not result.success else None
)
except Exception as e:
collector.end_task(
task_id=task_id,
success=False,
error_message=str(e)
)
# Submit data to database
collector.submit_to_sohh(db_path="data/holo_half.db")
# Take capability snapshot
snapshot = collector.take_capability_snapshot()
print(f"Overall Score: {snapshot.overall_score}/100")cd Self_Optimizing_Holo_Half
python -m user_scoring.visualization_reportOutput: reports/evolution_report_YYYYMMDD_HHMMSS.html
-
Executive Summary
- Overall score (0-100)
- Success rate
- Average duration
- Key statistics
-
Six-Dimensional Radar Chart
- Success Rate
- Efficiency Gain
- User Satisfaction
- Usage Activity
- Cost Efficiency
- Innovation
-
Historical Trends
- Line charts showing performance over time
- Identify improvement patterns
- Spot degradation early
-
Task Details
- List of all executed tasks
- Success/failure status
- Duration and iterations
- Click to view execution traces (v2.1 feature)
-
A/B Test Results (if available)
- Statistical comparison
- P-value significance testing
- Winner declaration
To establish a baseline, run the included benchmark suite:
cd Self_Optimizing_Holo_Half
python run_openspace_benchmark.pyThis executes 15 diverse tasks:
- Simple: factorial, HTML page, SQL query, CSS styling, JavaScript function
- Medium: CSV processing, Flask API, bank account class, React component, file download
- Complex: web scraper, Dockerfile, sentiment analysis, binary search tree, GitHub Actions workflow
Expected runtime: ~90 minutes
Success rate: Typically 60-90% depending on model capability
After generating a report, validate its quality:
python comprehensive_quality_validator.pyThis runs 30+ checks across 6 dimensions:
- ✅ Data authenticity (no mock data)
- ✅ Task completeness (all fields present)
- ✅ Timestamp distribution (no duplicates)
- ✅ Execution traces (clear linkage)
- ✅ Statistics accuracy (correct calculations)
- ✅ Report readiness (sufficient data)
All checks must pass before submitting reports to stakeholders.
| Score Range | Interpretation | Action |
|---|---|---|
| 90-100 | Excellent | Maintain current approach |
| 75-89 | Good | Minor optimizations possible |
| 60-74 | Fair | Focus on weakest dimensions |
| 40-59 | Poor | Major improvements needed |
| <40 | Critical | Re-evaluate fundamental approach |
-
Success Rate (权重: 25%)
- Percentage of tasks completed successfully
- Target: >80%
-
Efficiency Gain (权重: 20%)
- Speed improvement vs. baseline (900s)
- Higher is better
-
User Satisfaction (权重: 20%)
- Estimated from output quality
- Based on completion markers and error rates
-
Usage Activity (权重: 15%)
- How actively the Agent is being used
- More tasks = higher score
-
Cost Efficiency (权重: 10%)
- Token usage optimization
- Lower cost per successful task = better
-
Innovation (权重: 10%)
- Creative problem-solving ability
- Assessed from solution diversity
Cause: Database not populated yet
Solution:
# Check if tasks exist
python check_progress.py
# If 0 tasks, run benchmark or execute some tasks first
python run_openspace_benchmark.pyPossible causes:
- Tasks too complex for current model
- Insufficient max_iterations
- Missing dependencies
Solutions:
- Increase
max_iterationsparameter (default: 15) - Simplify task descriptions
- Check error messages in report for patterns
Cause: Baseline time may be inappropriate
Solution: Adjust baseline in visualization_report.py:
baseline_duration = 900 # seconds (15 minutes)
# Try 600 for faster tasks, 1200 for slower tasksCause: Windows console doesn't support emoji
Solution: Set environment variable:
set PYTHONIOENCODING=utf-8Or modify print statements to remove emoji characters.
When integrating into OpenSpace, organize files like this:
OpenSpace/
├── openspace_sohh_adapter.py # ← Add this
├── sohh_standard_interface.py # ← Add this
├── user_scoring/ # ← Add this directory
│ ├── __init__.py
│ ├── visualization_report.py
│ ├── metrics_calculator.py
│ └── ... (other modules)
├── plugins/ # ← Add this directory (if not exists)
│ ├── __init__.py
│ ├── base.py
│ └── openspace_analyzer.py
├── examples/ # ← Add this directory (if not exists)
│ └── sohh_integration_example.py
├── reports/ # ← Generated reports (add to .gitignore)
└── data/ # ← SQLite databases (add to .gitignore)
└── holo_half.db
Update .gitignore:
# SOHH generated files
reports/*.html
data/*.db
*.pyc
__pycache__/Add your own metrics to capability snapshots:
snapshot = collector.take_capability_snapshot()
snapshot.custom_metrics = {
"code_quality": calculate_code_quality(result),
"test_coverage": get_test_coverage(),
"documentation_score": assess_documentation()
}Compare two different approaches:
from user_scoring.ab_testing import ABTestFramework
ab_test = ABTestFramework(db_path="data/holo_half.db")
# Run variant A
variant_a_results = run_tasks_with_config(config_a)
ab_test.record_variant("conservative_prompt", variant_a_results)
# Run variant B
variant_b_results = run_tasks_with_config(config_b)
ab_test.record_variant("aggressive_prompt", variant_b_results)
# Analyze results
analysis = ab_test.analyze_comparison()
print(f"Winner: {analysis.winner}")
print(f"P-value: {analysis.p_value}")
print(f"Significant: {analysis.is_significant}")Track performance over time:
# Take snapshots regularly
if len(collector.task_executions) % 10 == 0:
snapshot = collector.take_capability_snapshot()
print(f"Snapshot #{len(collector.capability_snapshots)}: "
f"Score={snapshot.overall_score:.1f}")
# View trends in HTML report
# The trend chart automatically shows evolution over time- Quick Reference - Fast lookup guide
- PR Description Template - For submitting to teams
- Submission Checklist - Pre-submission verification
examples/sohh_integration_example.py- Complete usage examplesexamples/demo.py- Basic demonstrationsrun_openspace_benchmark.py- Benchmark suite
comprehensive_quality_validator.py- Quality assurancecheck_progress.py- Monitor benchmark progressmonitor_benchmark.py- Real-time progress display
- Run benchmarks before production use - Establish baseline metrics
- Generate reports weekly - Track long-term trends
- Use A/B testing for major changes - Validate improvements statistically
- Review execution traces - Understand failure patterns
- Share reports with team - Collaborative optimization
- ✅ Copy required files to your OpenSpace project
- ✅ Replace
OpenSpacewithMonitoredOpenSpacein your code - ✅ Run initial benchmark:
python run_openspace_benchmark.py - ✅ Generate first report:
python -m user_scoring.visualization_report - ✅ Validate quality:
python comprehensive_quality_validator.py - ✅ Review report and identify improvement areas
- ✅ Share with your team!
Happy optimizing! 🚀
For questions or issues, please refer to the main README or contact the SOHH development team.