Store and recall long-term memories scoped by user or tenant using Weaviate, pgvector, or custom backends
Memory lets agents remember facts and preferences across separate runs — scoped per user, tenant, or custom tags — without relying on conversation history alone.Use it when users return across sessions, when preferences should persist beyond a single conversation, or when you need tenant- or project-scoped memory separate from chat history.
# Weaviatedocker run --rm -p 8080:8080 -p 50051:50051 cr.weaviate.io/semitechnologies/weaviate:latest# pgvector (Postgres with pgvector extension)docker run --rm -p 5432:5432 -e POSTGRES_PASSWORD=pass pgvector/pgvector:pg16
Both Weaviate and pgvector are external shared stores — the same backend works for single-process and remote-worker deployments. Both processes must reach the same host or cluster.
Use on-demand when the model should decide what to persist. Use always when every run should be saved without relying on tool calls.
With StoreModeAlways and no custom Extract, the worker needs WithLLMClient when using remote workers — the SDK runs an LLM call at run-end to extract memories. Set memCfg.Store.Extract to a custom function if you want to avoid this extra LLM call.
memCfg.Store.DedupMinScore (default 0.85) controls whether a near-duplicate memory is updated or appended. Lower to dedup more aggressively; raise to keep distinct entries.
Pass the samememory.Config to both NewAgent and NewAgentWorker. Both processes must reach the same backend host. See Worker Separation for the full split-process setup.