Skip to content

Durasi: 10 menit | Block: 3


🧠 Memory in Hermes ​

┌─────────────────────────────────┐
│         MEMORY LAYERS           │
│                                 │
│  ┌───────────────────────────┐  │
│  │ SHORT-TERM (per session)  │  │
│  │ Chat history saat ini     │  │
│  │ Auto-reset per sesi baru  │  │
│  └───────────────────────────┘  │
│                                 │
│  ┌───────────────────────────┐  │
│  │ LONG-TERM (persistent)    │  │
│  │ Facts tentang user/bisnis │  │
│  │ Disimpan permanen         │  │
│  └───────────────────────────┘  │
│                                 │
│  ┌───────────────────────────┐  │
│  │ CONTEXT FILES             │  │
│  │ SOUL.md, docs, knowledge  │  │
│  │ Loaded setiap session     │  │
│  └───────────────────────────┘  │
└─────────────────────────────────┘

📊 Comparison ​

AspekShort-TermLong-TermContext Files
Scope1 chat sessionAcross sessionsAlways loaded
DurationSampai chat selesaiPermanentPermanent (file)
StorageChat historyMemory databaseFile system
Contoh"Tadi kamu bilang X""Nama bisnis Budi"Product catalog
UpdateOtomatisExplicit saveManual edit
Cost impactTokens per chatTokens saat di-loadTokens saat di-load

📝 Short-Term Memory ​

Automatic — Hermes simpan konteks dalam 1 session.

User: "Saya punya toko kopi di Jakarta"
Hermes: "Menarik! Kopi di Jakarta..."

User: "Berapa produk yang sebaiknya saya jual?" 
Hermes: "Untuk toko kopi kamu di Jakarta..." ← paham konteks

Limitation: Reset kalau session baru dimulai.


💾 Long-Term Memory ​

Persistent facts yang Hermes ingat across sessions.

Cara Save ke Memory ​

User: "Ingat: nama toko saya adalah Kopi Nusantara, 
       lokasi di Jakarta Selatan, buka sejak 2020"

Hermes: ✅ Saved to memory:
- Toko: Kopi Nusantara
- Lokasi: Jakarta Selatan  
- Berdiri: 2020

Kapan Pakai Long-Term Memory ​

InfoStore Where
Nama bisnis, lokasi, tahun berdiriLong-term memory
Detail produk (nama, harga)Context file (product catalog)
Preferensi customerLong-term memory
SOP dan guidelinesContext file
Riwayat percakapan pentingLong-term memory

📁 Context Files ​

File yang di-load setiap session — knowledge base agent.

Struktur Context Files ​

project/
├── SOUL.md                    # Persona
├── AGENTS.md                  # Project-specific config
├── context/
│   ├── products.md            # Product catalog
│   ├── faq.md                 # FAQ knowledge base
│   ├── brand-guidelines.md    # Brand voice & tone
│   ├── pricing.md             # Price list
│   └── sop/                   # Standard Operating Procedures
│       ├── order-process.md
│       ├── complaint-handling.md
│       └── escalation.md
└── memory/                    # Auto-managed by Hermes
    └── longterm.json

🎯 Decision Framework: Where to Put Info? ​

Info yang mau di-store?
    │
    ├─ Persona / personality / tone?
    │   → SOUL.md
    │
    ├─ Facts tentang bisnis (nama, lokasi)?
    │   → Long-term memory
    │
    ├─ Reference documents (products, FAQ, SOP)?
    │   → Context files
    │
    ├─ Project-specific behavior / tools config?
    │   → AGENTS.md
    │
    └─ Session-specific context?
        → Short-term (auto)

⚡ Pro Tips ​

  1. Jangan duplicate — info yang sama di SOUL.md dan context file = waste tokens
  2. Token budget — semua context di-load per session. Keep it lean.
  3. Version your files — git track SOUL.md dan context files
  4. Test memory — buat session baru, tanya sesuatu yang harusnya di-memory
  5. Clean up — hapus long-term memory yang outdated

Bootcamp AI Automation — akala.id