Advanced pattern recognition system for Hermes Agent - learns your daily routines, emotional stages, relationships, interests, hobbies, and choices to become your "second best friend" who knows everything about you and serves you better.
This skill gives your Hermes agent lifelong memory with pattern recognition. It doesn't just store facts - it learns patterns from every conversation:
| Pattern Type | What It Learns |
|---|---|
| Daily Routines | When you wake up, gym time, work hours, coffee breaks, sleep schedule |
| Emotional Stages | Stress triggers, anxiety patterns, what helps you recover, mood cycles |
| Relationships | Who matters to you, communication patterns, relationship dynamics, who needs attention |
| Interests & Hobbies | What you're learning, building, proficiency levels, learning trajectories |
| Choices & Preferences | Food, tools, editors, learning resources - predicts what you'll choose |
curl -fsSL https://raw.githubusercontent.com/sudosonic/hermes-user-pattern-memory/main/scripts/install.sh | bashirm https://raw.githubusercontent.com/sudosonic/hermes-user-pattern-memory/main/scripts/install.ps1 | iex# Clone the repo
git clone https://github.com/sudosonic/hermes-user-pattern-memory.git
cd hermes-user-pattern-memory
# Run installer
python scripts/install.py~/.hermes/
βββ skills/
β βββ hermes-user-pattern-memory/ # Skill definition
βββ scripts/
β βββ user_pattern_memory.py # Main integration
β βββ learning_engine.py # Central learning orchestrator
β βββ routine_tracker.py # Daily routine patterns
β βββ emotional_detector.py # Emotional state recognition
β βββ relationship_mapper.py # Relationship mapping
β βββ interest_profiler.py # Interest/hobby tracking
β βββ choice_predictor.py # Choice prediction
β βββ proactive_suggestions.py # Proactive suggestions
β βββ integration.py # JerryMemory integration
βββ templates/
β βββ config.yaml # Configuration template
βββ examples/
βββ basic_usage.py # Simple usage
βββ hermes_integration.py # Hermes Agent integration
βββ advanced_usage.py # Custom rules & config
Copy the template and customize:
cp templates/config.yaml ~/.hermes/user_pattern_memory_config.yamlKey settings:
# Core
enabled: true
learning_rate: 0.7
batch_size: 10
# Routine tracking
routine:
timezone: "Asia/Kolkata"
work_hours_start: 9
work_hours_end: 22
# Emotional detection
emotional:
sensitivity: 0.7
check_in_cooldown_hours: 4
# Relationship mapping
relationship:
min_interactions_for_profile: 5
# Interest profiling
interest:
min_mentions_for_interest: 3
auto_categorize: true
# Choice prediction
choice:
min_samples_for_prediction: 5
auto_decide_threshold: 0.85
# Proactive suggestions
suggestions:
enabled: true
check_interval_minutes: 30
max_suggestions_per_check: 3from scripts.integration import create_user_pattern_memory
# Create the system
pm = create_user_pattern_memory()
# Process every user message
result = pm.process_message("I'm feeling stressed about the deadline tomorrow")
# Returns patterns, confidence, and proactive suggestions
# Get proactive suggestions
suggestions = pm.get_proactive_suggestions()
# Predict choices
prediction = pm.predict_choice('food', ['pizza', 'burger', 'salad'], 'lunch time')
# Get full user snapshot
snapshot = pm.get_user_snapshot()
pm.shutdown()from scripts.integration import HermesPatternIntegration
# In your Hermes agent setup
hermes_pm = HermesPatternIntegration()
# For every user message
result = hermes_pm.process_user_message(
"I'm stressed about the presentation tomorrow",
{"platform": "telegram", "session_id": "sess_123"}
)
# Get context to inject into system prompt
context = hermes_pm.get_context_for_prompt()
# Returns formatted context like:
# "User's recent emotional state: stressed
# Currently building: ai_ml (Instagram analyzer)
# Key people: Radhika (ai_companion), Soni (ai_companion)
# Upcoming routines: gym at 06:00, deep_work at 09:00"
# Inject into your system prompt
system_prompt = f"""You are Jerry, the user's AI expert assistant.
{context}
Current user message: {{user_message}}"""The system automatically suggests things based on patterns:
- "Feeling stressed? Here's what worked before: 5-min breathing, break task into 3 steps"
- "Deep work break? You've been focused 90 mins - stand, stretch, hydrate"
- "Check in with Radhika? High importance, no contact in 2 weeks"
- "Post-lunch walk? Boosts afternoon focus"
prediction = pm.predict_choice('tools', ['vscode', 'zed', 'vim'], 'new editor')
# Returns: predicted='vscode', confidence=0.87, reasoning="Because chosen 47 times before; values familiarity"- Detects 14 emotional states from text
- Learns your recovery strategies
- Proactive check-ins when needed
- Tracks intensity and duration patterns
- Maps all people you mention
- Tracks communication frequency
- Identifies dynamics (supportive, challenging, playful, intellectual)
- Alerts when important relationships need attention
- Exploring β Learning β Practicing β Building β Mastering β Teaching
- Tracks proficiency (1-7 scale)
- Identifies dormant expertise to revive
- Suggests next steps for active projects
User Message
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β LearningEngine β
β (Orchestrates all modules) β
βββββββββββββββββββββββββββββββββββββββ
β
ββββΆ RoutineTracker βββΆ Daily patterns, schedule
ββββΆ EmotionalDetector βββΆ Mood, stress, recovery
ββββΆ RelationshipMapper βββΆ People, dynamics, frequency
ββββΆ InterestProfiler βββΆ Skills, projects, trajectory
ββββΆ ChoicePredictor βββΆ Preferences, decisions
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β ProactiveSuggestionEngine β
β (Rules + schedulers) β
βββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββ
β JerryMemory (Persistent Storage) β
β SQLite + FTS5 + WAL mode β
βββββββββββββββββββββββββββββββββββββββ
from scripts.proactive_suggestions import SuggestionRule, SuggestionType, SuggestionPriority
def my_condition(engine, context):
# Your custom logic
return True
def my_generator(engine, context):
return [Suggestion(
type=SuggestionType.LEARNING_OPPORTUNITY,
priority=SuggestionPriority.MEDIUM,
title="Custom Suggestion",
message="Your custom message",
suggested_actions=["Action 1", "Action 2"]
)]
pm.suggestion_engine.add_rule(SuggestionRule(
name="my_custom_rule",
condition=my_condition,
generator=my_generator,
cooldown_hours=6,
max_per_day=2
))# In interest_profiler.py, extend CATEGORY_KEYWORDS
CATEGORY_KEYWORDS[InterestCategory.OTHER] = [
'your_custom_keyword', 'another_keyword'
]# In config.yaml
emotional:
sensitivity: 0.8 # Higher = more sensitive
check_in_cooldown_hours: 2
routine:
work_hours_start: 8 # Your actual work hours
work_hours_end: 20# In choice_predictor.py, extend DOMAIN_KEYWORDS
DOMAIN_KEYWORDS[ChoiceDomain.OTHER] = [
'your_domain_keyword'
]{
"routines": {
"upcoming": [
{"name": "gym", "time": "06:00", "confidence": 0.92},
{"name": "deep_work", "time": "09:00", "confidence": 0.87}
],
"completed_today": ["gym", "coffee", "deep_work"]
},
"emotional_state": {
"dominant_state": "focused",
"most_intense": "stressed",
"avg_intensity": {"stressed": 7.2, "focused": 6.5}
},
"relationships": {
"top_5": [
{"name": "Radhika", "role": "ai_companion", "importance": 10},
{"name": "Soni", "role": "ai_companion", "importance": 9}
],
"needs_attention": []
},
"interests": {
"currently_building": [
{"category": "ai_ml", "project": "Instagram analyzer", "proficiency": 4, "hours": 50}
]
},
"choices": {
"food": {"top_choice": "pizza", "avg_satisfaction": 8.5},
"tools": {"top_choice": "vscode", "avg_satisfaction": 9.0}
},
"overall_confidence": 0.78
}# Run test suite
python tests/test_installation.pyhermes-user-pattern-memory/
βββ SKILL.md # Skill definition
βββ README.md # This file
βββ LICENSE # MIT License
βββ requirements.txt # Dependencies
βββ config.yaml # Default config
βββ scripts/
β βββ __init__.py
β βββ user_pattern_memory.py # Main class
β βββ learning_engine.py # Learning orchestrator
β βββ routine_tracker.py # Routines
β βββ emotional_detector.py # Emotions
β βββ relationship_mapper.py # Relationships
β βββ interest_profiler.py # Interests
β βββ choice_predictor.py # Choices
β βββ proactive_suggestions.py # Suggestions
β βββ integration.py # JerryMemory + Hermes
βββ templates/
β βββ config.yaml # Config template
βββ examples/
β βββ basic_usage.py
β βββ hermes_integration.py
β βββ advanced_usage.py
βββ tests/
βββ test_installation.py
This skill extends (not replaces) the existing hermes-persistent-memory-setup:
| Existing Skill | This Skill Adds |
|---|---|
| Basic fact storage | Pattern recognition |
| Simple preferences | Choice prediction |
| Conversation capture | Emotional intelligence |
| Session boot | Relationship mapping |
| Learning trajectories | |
| Proactive suggestions |
Use both together for maximum effect!
- Python 3.8+
- Hermes Agent with JerryMemory skill installed
- SQLite (built-in)
Optional:
apschedulerfor background schedulerpyyamlfor config
MIT License - see LICENSE
Built for Hermes Agent by the community. Uses the JerryMemory persistent memory system as storage backend.
Made with β€οΈ for Hermes Agent users who want their AI to truly know them.