curl -X POST "https://api.flumes.ai/v1/memories/" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $FLUMES_API_KEY" \
  -d '{
    "messages": [
      {"role": "user", "content": "I want to go to Rome in July. give me tips for museums"}
    ],
    "agent_id": "alex"
  }'
{
  "results": [
    {
      "id": "4a433930-24bd-4f96-9df6-4e9b0e0d9833",
      "memory": "Wants to go to Rome in July",
      "event": "ADD"
    },
    {
      "id": "d9b95758-a7e3-4db3-b33c-55bbe77a5b9c",
      "memory": "Looking for tips for museums",
      "event": "ADD"
    }
  ]
}
1

Compose request

Send a POST request to /v1/memories/ with a JSON body that contains at least one message and must include agent_id (recommended) or user_id for scoping.
Authorization
string
required
Bearer token used for authentication. Format: Bearer YOUR_API_KEY.
messages
array[object]
required
Array of chat messages in chronological order. Each object must include role (user or assistant) and content (string).
user_id
string
Session or user identifier that scopes the memory. Required if agent_id and run_id are omitted.
agent_id
string
required
Agent identifier that scopes the memory. Required for agent-specific memories and recommended for all requests.
run_id
string
Run identifier that scopes the memory. Alternative to user_id.
metadata
object
Arbitrary key–value pairs saved alongside the memory.
infer
boolean
default:"true"
When true (default) the backend uses an LLM to extract salient facts, deduplicate, and decide whether to add, update, or delete memories automatically. Set to false to store the raw messages exactly as provided.
2

Send request

curl -X POST "https://api.flumes.ai/v1/memories/" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $FLUMES_API_KEY" \
  -d '{
    "messages": [
      {"role": "user", "content": "I want to go to Rome in July. give me tips for museums"}
    ],
    "agent_id": "alex"
  }'
3

Review response

A successful request returns 200 OK with the newly created or updated memories.
{
  "results": [
    {
      "id": "4a433930-24bd-4f96-9df6-4e9b0e0d9833",
      "memory": "Wants to go to Rome in July",
      "event": "ADD"
    },
    {
      "id": "d9b95758-a7e3-4db3-b33c-55bbe77a5b9c",
      "memory": "Looking for tips for museums",
      "event": "ADD"
    }
  ]
}
You should receive a list with at least one item inside results.

Expected outcomes

  • The response contains the newly created memory IDs so you can reference them later.
  • Subsequent GET /v1/memories/{id} requests return the stored content and metadata.