Skip to main content
POST
Add memory

When to use it

Use this endpoint to store user-specific context that personalizes recall:
  • Preferences – “User prefers dark mode and detailed technical explanations”
  • Conversation history – chat messages between the user and your agent
  • User notes – markdown snippets, settings, profile data
For documents, files, and app-generated content, use POST /ingestion/upload_knowledge instead.

Endpoint

  • Auth: Bearer token
  • Idempotency: Controlled by upsert (default true – overwrites existing items with the same source_id)
  • Async: Yes – memories are queued for processing. Use POST /ingestion/verify_processing to check status.
For memories, metadata and additional_metadata are plain JSON objects. Do not pre-stringify them.

Example

Request parameters

Memory item

Each entry in the memories array supports three content formats. Pick one:

Format 1 – Plain text

Format 2 – Markdown

Format 3 – Conversation pairs

All MemoryItem fields

Inference modes

The infer flag controls how HydraDB processes content:
  • infer: true – HydraDB extracts implicit preferences, insights, and entities from the text. Best for conversation history and free-form user notes where you want HydraDB to derive structured signals.
  • infer: false (default) – Content is chunked and indexed as-is. Best for content that should be stored verbatim, like preset profile fields or raw notes.
Always set infer explicitly. The default is false. If you’re storing conversational content and expect HydraDB to extract preferences, you must set infer: true.

Response

Behavior notes

Processing is asynchronous. This endpoint returns immediately after queuing. To verify a memory is fully indexed, poll POST /ingestion/verify_processing with the returned source_id until status is completed.
Sub-tenants are created implicitly. If you pass a sub_tenant_id that doesn’t exist, HydraDB creates it automatically on first use. There is no separate sub-tenant creation endpoint.

Errors

Common codes: 400 INVALID_PARAMETERS, 404 TENANT_NOT_FOUND, 422 VALIDATION_ERROR. See Error Responses for the full list. Read more: Essentials → Memories · Essentials → Metadata

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
memories
MemoryItem · object[]
required

List of memory items to ingest

Minimum array length: 1
Example:
tenant_id
string
required

Unique identifier for the tenant/organization

Example:

"tenant_1234"

sub_tenant_id
string
default:""

Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.

Example:

"sub_tenant_4567"

upsert
boolean
default:true

If true, update existing sources with the same source_id.

Example:

true

Response

Successful Response

Response model for add_memory endpoint.

success
boolean
default:true
Example:

true

message
string
default:Memories queued for ingestion successfully
results
MemoryResultItem · object[]

List of results for each ingested memory item.

Example:
success_count
integer
default:0

Number of items successfully queued for ingestion.

Example:

1

failed_count
integer
default:0

Number of items that failed to queue.

Example:

1