Skip to content

About

Advanced pattern recognition system for Hermes Agent - learns daily routines, emotional stages, relationships, interests, hobbies, and choices to become your second best friend who knows everything about you

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Hermes User Pattern Memory

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.

🌟 What This Does

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

πŸš€ Quick Install

One-Line Install (Linux/macOS/WSL)

curl -fsSL https://raw.githubusercontent.com/sudosonic/hermes-user-pattern-memory/main/scripts/install.sh | bash

Windows (PowerShell as Administrator)

irm https://raw.githubusercontent.com/sudosonic/hermes-user-pattern-memory/main/scripts/install.ps1 | iex

Manual Install

# 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

πŸ“¦ What Gets Installed

~/.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

πŸ”§ Configuration

Copy the template and customize:

cp templates/config.yaml ~/.hermes/user_pattern_memory_config.yaml

Key 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: 3

πŸ’‘ Usage

Basic Usage (Standalone)

from 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()

Hermes Agent Integration

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}}"""

🎯 What You Get

1. Proactive Suggestions

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"

2. Choice Prediction

prediction = pm.predict_choice('tools', ['vscode', 'zed', 'vim'], 'new editor')
# Returns: predicted='vscode', confidence=0.87, reasoning="Because chosen 47 times before; values familiarity"

3. Emotional Intelligence

  • Detects 14 emotional states from text
  • Learns your recovery strategies
  • Proactive check-ins when needed
  • Tracks intensity and duration patterns

4. Relationship Awareness

  • Maps all people you mention
  • Tracks communication frequency
  • Identifies dynamics (supportive, challenging, playful, intellectual)
  • Alerts when important relationships need attention

5. Learning Trajectory Tracking

  • Exploring β†’ Learning β†’ Practicing β†’ Building β†’ Mastering β†’ Teaching
  • Tracks proficiency (1-7 scale)
  • Identifies dormant expertise to revive
  • Suggests next steps for active projects

πŸ—οΈ Architecture

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           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”§ Tweaking & Customization

Add Custom Suggestion Rules

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
))

Add Custom Interest Categories

# In interest_profiler.py, extend CATEGORY_KEYWORDS
CATEGORY_KEYWORDS[InterestCategory.OTHER] = [
    'your_custom_keyword', 'another_keyword'
]

Adjust Sensitivity

# 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

Custom Choice Domains

# In choice_predictor.py, extend DOMAIN_KEYWORDS
DOMAIN_KEYWORDS[ChoiceDomain.OTHER] = [
    'your_domain_keyword'
]

πŸ“Š Example Output

User Snapshot

{
  "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
}

πŸ§ͺ Testing

# Run test suite
python tests/test_installation.py

πŸ“ File Structure

hermes-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

🀝 Integration with Existing Skills

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!

πŸ› οΈ Requirements

  • Python 3.8+
  • Hermes Agent with JerryMemory skill installed
  • SQLite (built-in)

Optional:

  • apscheduler for background scheduler
  • pyyaml for config

πŸ“ License

MIT License - see LICENSE

πŸ™ Credits

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.

About

Advanced pattern recognition system for Hermes Agent - learns daily routines, emotional stages, relationships, interests, hobbies, and choices to become your second best friend who knows everything about you

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages