- Add config_functions.py for reasoning configuration - Add init.py initialization module - Add harnessed_reasoning_config model definition - Add skill documentation (SKILL.md with assets, references, scripts) - Add ios_design.css frontend styles
95 lines
4.0 KiB
Markdown
95 lines
4.0 KiB
Markdown
---
|
|
name: harnessed-reasoning-module-implementation
|
|
version: 1.0.0
|
|
description: Complete production-ready implementation of Hermes Reasoning Engine module with advanced reasoning capabilities, planning, tool coordination, error recovery, and cross-session intelligence.
|
|
trigger_conditions:
|
|
- User requests to implement or extend Hermes Reasoning functionality
|
|
- Task involves AI reasoning engine development
|
|
- Need for context-aware reasoning with safety checks
|
|
---
|
|
|
|
# Harnessed Reasoning Module Implementation Guide
|
|
|
|
## Overview
|
|
|
|
This skill provides the complete implementation of the **Harnessed Reasoning** module, which implements advanced reasoning capabilities for the Hermes Agent ecosystem:
|
|
|
|
- **Context-aware reasoning**: Combines memory, sessions, and skills for intelligent decision-making
|
|
- **Task decomposition**: Breaks complex requests into executable subtasks
|
|
- **Tool selection**: Automatically selects appropriate tools for each subtask
|
|
- **Safety checks**: Multi-level safety validation (strict/moderate/lenient modes)
|
|
- **Error recovery**: Automatic recovery strategies for failed tool executions
|
|
- **Cross-session intelligence**: Leverages past sessions for better reasoning
|
|
- **Multi-user isolation**: Complete user separation with proper authentication
|
|
|
|
## Module Structure
|
|
|
|
```
|
|
harnessed_reasoning/
|
|
├── harnessed_reasoning/ # Python package
|
|
│ ├── __init__.py # Empty (Python package marker)
|
|
│ ├── init.py # Module initialization with load_harnessed_reasoning()
|
|
│ ├── core.py # Core reasoning engine (HermesReasoningEngine class)
|
|
│ └── config_functions.py # Configuration get/save functions
|
|
├── wwwroot/ # Frontend resources (.ui files)
|
|
├── models/ # Database table definitions (JSON)
|
|
├── json/ # CRUD operation definitions (JSON)
|
|
├── init/ # Initialization data
|
|
├── skill/ # This skill documentation
|
|
├── pyproject.toml # Python packaging
|
|
└── README.md # Module documentation
|
|
```
|
|
|
|
## Database Tables
|
|
|
|
- **harnessed_reasoning_config**: User-specific reasoning configuration
|
|
- **harnessed_reasoning_sessions**: Reasoning session records with execution plans
|
|
|
|
## Key Features
|
|
|
|
### 1. Reasoning Engine
|
|
- Configurable max reasoning steps and tool calls per step
|
|
- Intelligent context gathering from memory, sessions, and skills
|
|
- Keyword-based tool selection and parameter inference
|
|
- Confidence scoring for execution plans
|
|
|
|
### 2. Safety System
|
|
- Three safety modes: strict, moderate, lenient
|
|
- Dangerous command detection for terminal actions
|
|
- Path traversal protection for file operations
|
|
- User preference enforcement
|
|
|
|
### 3. Error Recovery
|
|
- Automatic retry with exponential backoff
|
|
- Context-aware recovery strategies (e.g., file not found -> search for similar files)
|
|
- Configurable max recovery attempts
|
|
|
|
## Configuration
|
|
|
|
```python
|
|
class ReasoningConfig:
|
|
max_reasoning_steps: int = 10
|
|
max_tool_calls_per_step: int = 5
|
|
enable_cross_session_search: bool = True
|
|
enable_skill_auto_loading: bool = True
|
|
safety_mode: str = "strict"
|
|
max_context_tokens: int = 4000
|
|
enable_error_recovery: bool = True
|
|
max_recovery_attempts: int = 3
|
|
```
|
|
|
|
## Exposed Functions
|
|
|
|
- `hermes_reason_and_execute(request, execute_immediately)` - Main entry point
|
|
- `hermes_get_reasoning_session(session_id)` - Retrieve session by ID
|
|
- `hermes_list_reasoning_sessions(limit, offset)` - List user sessions
|
|
- `hermes_get_reasoning_config()` - Get default configuration
|
|
- `hermes_save_reasoning_config(context, config_data)` - Save user configuration
|
|
|
|
## Related Skills
|
|
|
|
- [module-development-spec](module-development-spec): Module development workflow
|
|
- [bricks-framework](bricks-framework): Frontend development framework
|
|
- [sqlor-database-module](sqlor-database-module): Database integration patterns
|
|
- [harnessed-agent-skill-architecture](harnessed-agent-skill-architecture): Dual skill architecture
|