🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

MemVault

by @wjy9902

Production-ready long-term memory server for AI agents with Ebbinghaus decay and strength-weighted retrieval. Use when you need persistent memory across agen...

Versionv1.0.3
Downloads1,214
TERMINAL
clawhub install memvault

πŸ“– About This Skill


name: memvault description: "Production-ready long-term memory server for AI agents with Ebbinghaus decay and strength-weighted retrieval. Use when you need persistent memory across agent sessions, memory decay (forgetting curve), memory statistics, or multi-agent memory tracking. Triggers: long-term memory, remember, recall, memory decay, Ebbinghaus, agent memory, memvault. Requires Docker."

MemVault β€” Long-term Memory for AI Agents

Quick Start

# Install (one command β€” Docker handles everything)
bash scripts/install.sh

Verify

memvault health

Usage

# Store a memory
memvault memorize-text  "" "[reply]"

Retrieve memories (strength-weighted)

memvault retrieve ""

Run daily decay (memories fade like human memory)

memvault decay

Check stats

memvault stats

API Endpoints

| Method | Endpoint | Description | |--------|----------|-------------| | POST | /memorize | Store conversation β†’ extract facts/events/knowledge | | POST | /retrieve | Strength-weighted vector search (similarity Γ— strength) | | POST | /decay | Ebbinghaus forgetting curve (run daily via cron) | | GET | /stats | Memory distribution, access patterns, agent breakdown | | GET | /health | Service health |

How It Works

1. Store: Conversations β†’ LLM extracts facts β†’ embedded β†’ stored in pgvector 2. Retrieve: Query embedded β†’ cosine similarity Γ— memory strength β†’ ranked results 3. Decay: strength = exp(-rate Γ— days / (1 + damping Γ— ln(1 + access_count))) 4. Access boost: Each retrieval increments access_count, slowing decay

Fading memories (strength < 0.1) are excluded from search.

Configuration

All via environment variables in .env (created by install script):

  • MEMVAULT_LLM_BASE_URL β€” Default: Ollama local. Set to OpenAI/Groq/etc URL if preferred
  • MEMVAULT_LLM_MODEL β€” Default: qwen2.5:3b
  • MEMVAULT_TRANSLATION β€” Set true + MEMVAULT_TRANSLATION_LANG for auto-translation
  • MEMVAULT_PORT β€” Default: 8002
  • Daily Cron Setup

    Add Ebbinghaus decay to your agent's cron:

    0 3 * * *  curl -s -X POST 'http://127.0.0.1:8002/decay?user_id=YOUR_USER_ID'
    

    TOOLS.md Snippet

    ## MemVault 🧠
    memvault memorize-text "" "" ""
    memvault retrieve "" ""
    memvault decay 
    memvault stats 
    
  • API: 127.0.0.1:8002
  • Multi-Agent Memory

    Tag memories by source agent:

    curl -X POST http://localhost:8002/memorize -H "Content-Type: application/json" \
      -d '{"conversation": [
        {"role": "metadata", "content": "{\"source_agent\": \"research-bot\"}"},
        {"role": "user", "content": "Found new papers on transformers"}
      ], "user_id": "team"}'
    

    Troubleshooting

  • "Connection refused" β†’ Run docker compose -f ~/.openclaw/workspace/skills/memvault/docker-compose.yml up -d
  • Slow memorize β†’ Normal, LLM extraction takes 5-15s per conversation
  • No results from retrieve β†’ Check memvault stats β€” if total=0, nothing stored yet
  • All memories fading β†’ Reduce decay_rate: curl -X POST 'http://localhost:8002/decay?decay_rate=0.05'
  • πŸ’‘ Examples

    # Store a memory
    memvault memorize-text  "" "[reply]"

    Retrieve memories (strength-weighted)

    memvault retrieve ""

    Run daily decay (memories fade like human memory)

    memvault decay

    Check stats

    memvault stats

    βš™οΈ Configuration

    All via environment variables in .env (created by install script):

  • MEMVAULT_LLM_BASE_URL β€” Default: Ollama local. Set to OpenAI/Groq/etc URL if preferred
  • MEMVAULT_LLM_MODEL β€” Default: qwen2.5:3b
  • MEMVAULT_TRANSLATION β€” Set true + MEMVAULT_TRANSLATION_LANG for auto-translation
  • MEMVAULT_PORT β€” Default: 8002
  • πŸ“‹ Tips & Best Practices

  • "Connection refused" β†’ Run docker compose -f ~/.openclaw/workspace/skills/memvault/docker-compose.yml up -d
  • Slow memorize β†’ Normal, LLM extraction takes 5-15s per conversation
  • No results from retrieve β†’ Check memvault stats β€” if total=0, nothing stored yet
  • All memories fading β†’ Reduce decay_rate: curl -X POST 'http://localhost:8002/decay?decay_rate=0.05'