Inserting Memories

Inserting memory is how your app writes durable knowledge into Neocortex. This is an upsert operation: if the same identity already exists, it updates; otherwise it creates.

When to Use This

  • Persist user preferences and profile facts

  • Save conversation outcomes and action items

  • Backfill historical memory with timestamps

  • Attach metadata for filtering/routing later

Request Shape

Required Fields

Field
Type
Description

title

string

Stable memory identifier (often equivalent to key/document id).

content

string

The memory text payload.

namespace

string

Logical scope (for example preferences, crm, support).

Optional Fields

Field
Type
Description

sourceType

doc | chat | email

Source channel for downstream interpretation.

metadata

object

Arbitrary structured tags (user id, tenant, source, etc.).

priority

high | medium | low

Optional importance hint.

createdAt

number

Unix timestamp (seconds). Useful for backfilling older memories.

updatedAt

number

Unix timestamp (seconds), usually >= createdAt.

documentId

string

Explicit external id if you need strict cross-system mapping.

Step-by-Step

  1. Choose a namespace.

  2. Pick a stable title/key for deduping.

  3. Write content and optional metadata.

  4. Insert and inspect status (completed, updated, etc.).

Example Request Body

Examples by Language

Response Notes

  • status: operation status (for example completed/updated)

  • stats: backend insert statistics when available

  • usage: token/cost metadata when enabled

Last updated