Chat

Memories & Context

Manage AI Representative memories and configure chat context behavior.

Memories and Context

Memories let AI Representatives remember important facts across conversations. Instead of repeating information every session, the AI retains key details (preferences, past interactions, stated goals) and uses them to provide personalized responses.

Authentication required

All memory and context endpoints require a valid JWT or API key.

How memories work

When a visitor shares meaningful information during a conversation ("I focus on luxury condos in Brickell"), the AI Representative can store this as a memory. In future sessions, the AI uses stored memories to give more relevant, personalized answers without the visitor repeating themselves.

List memories

GET
/api/v1/chat/memories
API Key

List all stored memories for the authenticated user.

Create a memory

POST
/api/v1/chat/memories
API Key

Manually create a memory entry.

contentstringRequired

The fact or preference to remember.

categorystringOptional

Optional category for organizing memories (e.g. preferences, goals, context).

Update a memory

PATCH
/api/v1/chat/memories/{memory_id}
API Key

Update the content or category of an existing memory.

Delete a single memory

DELETE
/api/v1/chat/memories/{memory_id}
API Key

Delete a specific memory by ID.

Delete all memories

DELETE
/api/v1/chat/memories
API Key

Delete all memories for the authenticated user. This cannot be undone.

Deleting all memories resets the AI Representative to a blank state for this user. It will no longer recall any past preferences or context.

Chat context

Context configuration controls how the AI Representative behaves during conversations. This includes system-level instructions, personality settings, and knowledge boundaries.

Get context

GET
/api/v1/chat/context
API Key

Retrieve the current chat context configuration.

Update context

PATCH
/api/v1/chat/context
API Key

Update the chat context configuration.

Context plus memories

Context sets the baseline behavior (personality, boundaries). Memories add visitor-specific information on top. Together they create conversations that feel both on-brand and personal.

Context usage stats

GET
/api/v1/chat/sessions/{session_id}/context-usage
API Key

Get token usage for a specific session including memory overhead.

Use this endpoint to monitor how memories and context are affecting token usage. If a session is consuming too many tokens, consider compacting the session or pruning old memories.