Agent memory
Store and retrieve persistent user memory across conversations.
Agent Memory is an experimental feature that allows your assistant to persist data about users across conversations. This enables experiences like repeat-caller logic, customer preferences, and cross-channel continuity.
It uses a key-value store attached to a user identifier (like phone number). Memory is read at the start of each turn and written after the conversation ends.
You can:
- Read memory using
conv.memory.get("key")
- Write memory by setting
conv.state["key"] = value
(if configured viastate_keys
)
Configuration
JSON config (Agent Studio)
To enable Agent Memory:
analytics_enabled
: Adds repeat caller metrics to Studio analyticsstate_keys
: Keys to save fromconv.state
to memoryidentifier_blacklist
: Optional list of excluded IDs (e.g. test numbers)
Using memory in functions
Read memory
Write memory (via conv.state)
state_keys
in your config.Example: conditional reuse
Platform (context.memory)
If you’re working in the agent worker (not Studio), use context.memory
:
You can also:
get_builder_memory(...)
link_identifiers(...)
Memory behaviour
- Memory is read once per turn and cached.
- Memory is persisted at the end of a conversation.
- Only supported identifier today: phone number.
FAQ
Can I store nested JSON?
No. Each value must be a string, number, or flat serializable object. Always avoid packing PII into a single field.
Can I check if memory exists?
Yes:
Can I prevent overwrites?
Not directly, but you can check before writing:
Can I link identifiers?
Yes. This is supported by context.memory.link_identifiers()
.
Need help? Contact platform-support@poly-ai.com.