Memory
Memory is application context that you attach to requests so the model can respond with project, user, or workflow-specific information.
UniKey does not require you to use a proprietary memory format. For most integrations, keep durable memory in your own database and inject the relevant context into system or messages fields at request time.
Recommended pattern
- Store long-term user or project facts in your application.
- Retrieve only the facts needed for the current task.
- Put stable instructions in the
systemfield. - Put task-specific context in the latest user message.
- Keep sensitive data out of prompts unless the model genuinely needs it.
Example
{
"model": "gpt-5.2",
"messages": [
{
"role": "system",
"content": "You answer as the support assistant for Project Atlas."
},
{
"role": "user",
"content": "User plan: Pro. Last ticket: billing export failed. Help them retry the export."
}
]
}
Agent workflows
For agentic systems, store intermediate state outside the model call. Send only the next useful observation, tool result, or constraint to the model. This keeps requests cheaper, reduces accidental data exposure, and makes failures easier to replay.