Skip to main content
Two-turn demos store then recall user preferences using WithMemory. Pick one backend per run. Uses the same Docker stack as retriever examples. task infra:weaviate:up / task infra:pgvector:up creates the memory class/table (AgentMemory / agent_memories) in addition to retriever schema. No seed rows — memories are written by agent runs. Source: examples/agent_with_memory/

What it demonstrates

  • memory.DefaultConfig with vector backends
  • MEMORY_STORE_MODEondemand (save_memory tool) vs always (run-end extract)
  • Scope via MEMORY_USER_ID (default demo-user) — must match across runs you want to share
  • Telemetry: total_memory_recalls / total_memory_stores with SHOW_TELEMETRY=true
Set MEMORY_RECALL_ENABLED=false for store-only (skip load before LLM).

Setup

From examples/:
Weaviate:
Verify schema: curl -s http://localhost:8081/v1/schema | jq '.classes[].class' — expect Document and AgentMemory (examples compose publishes Weaviate on host 8081; Restate uses 8080). pgvector:
After an embedding key change: task infra:weaviate:down && task infra:weaviate:up.

Run behavior

  • No CLI args — two runs in one process: run 1 stores a preference, run 2 recalls it.
  • With args — single custom prompt.
Batch all four combinations (each backend × each store mode): task examples:local includes memory targets when infra is up.

Expected output

Two-run flow (no CLI args):
Run 1 stores the preference; Run 2 recalls it. With SHOW_TELEMETRY=true:

Learn more

Memory

Store modes, scope, recall config

Retrieval

RAG with same vector infra