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
| Aspek | Short-Term | Long-Term | Context Files |
|---|---|---|---|
| Scope | 1 chat session | Across sessions | Always loaded |
| Duration | Sampai chat selesai | Permanent | Permanent (file) |
| Storage | Chat history | Memory database | File system |
| Contoh | "Tadi kamu bilang X" | "Nama bisnis Budi" | Product catalog |
| Update | Otomatis | Explicit save | Manual edit |
| Cost impact | Tokens per chat | Tokens saat di-load | Tokens 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 konteksLimitation: 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: 2020Kapan Pakai Long-Term Memory
| Info | Store Where |
|---|---|
| Nama bisnis, lokasi, tahun berdiri | Long-term memory |
| Detail produk (nama, harga) | Context file (product catalog) |
| Preferensi customer | Long-term memory |
| SOP dan guidelines | Context file |
| Riwayat percakapan penting | Long-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
- Jangan duplicate — info yang sama di SOUL.md dan context file = waste tokens
- Token budget — semua context di-load per session. Keep it lean.
- Version your files — git track SOUL.md dan context files
- Test memory — buat session baru, tanya sesuatu yang harusnya di-memory
- Clean up — hapus long-term memory yang outdated