Language Model Memory
Spice provides memory persistence tools that help language models store and retrieve information across conversations. These tools are available through the memory tool group.
Memory tools are useful for applications where context from previous interactions should influence future responses, such as chatbots, assistants, or multi-turn workflows.
Enabling Memory Tools​
To enable memory tools for Spice models, define a store memory dataset and specify memory in the model's tools parameter.
Example: Enabling Memory Tools​
datasets:
- from: memory:store
name: llm_memory
access: read_write
models:
- name: memory-enabled-model
from: openai:gpt-4o
params:
tools: memory, sql # Can be combined with other tool groups
For more information on tools, see Tool components.
The memory tools need a memory: dataset to read from and write to. Without one, a model is not given the memory tools, they are not listed by /v1/mcp, and a request that names a memory tool does not find it. In Spice v2.4.3 and earlier, a call that named a memory tool still ran it and failed with No memory table found.
Cookbook​
- A cookbook recipe to give language models persistent memory across conversations. LLM Memory: Persistent Memory for Language Models with Spice
