PERMEAR: Persistent memory and self-learning for Home Assistant agents

​[Project] PERMEAR — Persistent Memory & Self-Learning for Home Assistant Agents

​Most Home Assistant agents share the same flaw: they forget everything once the interaction ends. PERMEAR changes that by adding a persistent memory and self-learning layer, turning your assistant into an entity that actually improves over time.

​It runs fully local (JSON + Python + HA Automations). No external database, no cloud dependencies.

:rocket: Key Features

  • User Awareness: Remembers specific users and their individual preferences.
  • Feedback Loops: Learns from your input (e.g., “that was irrelevant”) for instant behavioral adjustment.
  • Pattern Detection: Identifies household routines and suggests optimizations.
  • System Health: Actively monitors your HA instance’s health and entities.
  • Human-in-the-Loop: Proposes new automations based on usage (requires your approval).

:building_construction: Architecture

   USER (Voice / Telegram / UI)
              │
              ▼
       LLM AGENT (HA)
              │
   ┌──────────┼──────────┐
   ▼          ▼          ▼
MEMORY     SCRIPTS       HA
(JSON)    (Python)     (YAML)
   └──────────┬──────────┘
              ▼
    SELF-LEARNING SYSTEM

:open_file_folder: Memory Structure

​Data is stored in human-readable JSON files with a built-in rotation:

  • ​memory/soul.json — Core personality and logic guidelines.
  • ​memory/users.json — Individual user profiles and preferences.
  • ​memory/insights.json — Detected patterns and learned behaviors.
  • ​memory/daily/ — Interaction logs (7-day rolling rotation).

:gear: Automation Cycles

​The system maintains itself through scheduled “thought” cycles:

  • Every 30 min: Pre-briefing (System health + House status check).
  • Daily: General briefing + long-term memory consolidation.
  • 06:00 AM: Entity discovery (Detects new devices or changes in the UI).
  • Weekly: Self-improvement cycle (Analyzes feedback to refine prompts).

:light_bulb: The Vision

No manual tuning. The goal is a system that learns directly from how you respond. Instead of editing YAML to change a bot’s behavior, you simply talk to it, and it adapts.

:link: Repository

​Check out the code and installation guide here:

:backhand_index_pointing_right: GitHub - zzzmada/permear: A three-layer persistent memory system that transforms Home Assistant's Gemini (or any LLM) conversation agent from a stateless chatbot into an intelligent assistant that **remembers, learns, and self-improves** over time. · GitHub

Feel free to drop any feedback or open an issue!

Nice project, would you consider deploying it as a hacs project for easier integration?

Thanks! HACS is on the roadmap. I’m still refining the core and fixing some edge cases, so I want it more stable first. Also want a bit more real-world usage and feedback before packaging it. But yeah, that’s the next step

1 Like