Skip to content
Get started

Get user profile

client.profile(ProfileParams { containerTag, buckets, filters, 3 more } body, RequestOptionsoptions?): ProfileResponse { profile, searchResults }
POST/v4/profile

Get user profile with optional search results

ParametersExpand Collapse
body: ProfileParams { containerTag, buckets, filters, 3 more }
containerTag: string

Tag to filter the profile by. This can be an ID for your user, a project ID, or any other identifier you wish to use to filter memories.

buckets?: Array<string>

Specific bucket keys to return. Omit to return all configured buckets. Only relevant when “buckets” is included.

filters?: Or { OR } | And { AND }

Optional metadata filters to apply to profile results and search results. Supports complex AND/OR queries with multiple conditions.

One of the following:
Or { OR }
OR: Array<FilterCondition { key, value, filterType, 3 more } | Or { OR } | And { AND } >

Array of OR filter expressions

One of the following:
FilterCondition { key, value, filterType, 3 more }

A single filter condition based on metadata, numeric values, array contents, or string matching

key: string
value: string
filterType?: "metadata" | "numeric" | "array_contains" | "string_contains"
One of the following:
"metadata"
"numeric"
"array_contains"
"string_contains"
ignoreCase?: boolean | "true" | "false"
One of the following:
boolean
"true" | "false"
"true"
"false"
negate?: boolean | "true" | "false"
One of the following:
boolean
"true" | "false"
"true"
"false"
numericOperator?: ">" | "<" | ">=" | 2 more
One of the following:
">"
"<"
">="
"<="
"="
Or { OR }
OR: Array<unknown>

OR: Array of conditions or nested expressions

And { AND }
AND: Array<unknown>

AND: Array of conditions or nested expressions

And { AND }
AND: Array<FilterCondition { key, value, filterType, 3 more } | Or { OR } | And { AND } >

Array of AND filter expressions

One of the following:
FilterCondition { key, value, filterType, 3 more }

A single filter condition based on metadata, numeric values, array contents, or string matching

key: string
value: string
filterType?: "metadata" | "numeric" | "array_contains" | "string_contains"
One of the following:
"metadata"
"numeric"
"array_contains"
"string_contains"
ignoreCase?: boolean | "true" | "false"
One of the following:
boolean
"true" | "false"
"true"
"false"
negate?: boolean | "true" | "false"
One of the following:
boolean
"true" | "false"
"true"
"false"
numericOperator?: ">" | "<" | ">=" | 2 more
One of the following:
">"
"<"
">="
"<="
"="
Or { OR }
OR: Array<unknown>

OR: Array of conditions or nested expressions

And { AND }
AND: Array<unknown>

AND: Array of conditions or nested expressions

include?: Array<"static" | "dynamic" | "buckets">

Profile sections to return. Omit to return all sections. Pass a subset to reduce payload — e.g. [“buckets”] skips static and dynamic entirely.

One of the following:
"static"
"dynamic"
"buckets"
q?: string

Optional search query to include search results in the response

threshold?: number

Threshold for search results. Only results with a score above this threshold will be included.

minimum0
maximum1
ReturnsExpand Collapse
ProfileResponse { profile, searchResults }
profile: Profile { buckets, dynamic, static }
buckets?: Record<string, Array<string>>

Per-bucket memory lists, keyed by bucket key

dynamic?: Array<string>

Dynamic profile information (recent memories)

static?: Array<string>

Static profile information that remains relevant long-term

searchResults?: SearchResults { results, timing, total }

Search results if a search query was provided

results: Array<Result>

Search results for the provided query

id: string

Memory entry ID or chunk ID

metadata: Record<string, unknown> | null

Memory metadata

similarity: number

Similarity score between the query and memory entry

maximum1
minimum0
updatedAt: string

Memory last update date

formatdatetime
chunk?: string

The chunk content (only present for chunk results from hybrid search)

chunks?: Array<Chunk>

Relevant chunks from associated documents (only included when chunks=true)

content: string

Content of the chunk

documentId: string

ID of the document this chunk belongs to

position: number

Position of chunk in the document (0-indexed)

context?: Context { children, parents, related }

Object containing version history (parents/children via updates) and related memories (extends/derives)

children?: Array<Child>
memory: string

The contextual memory content

relation: "updates" | "extends" | "derives"

Relation type between this memory and its parent/child

One of the following:
"updates"
"extends"
"derives"
updatedAt: string

Contextual memory last update date

formatdatetime
metadata?: Record<string, unknown> | null

Contextual memory metadata

version?: number | null

Relative version distance from the primary memory (+1 for direct child, +2 for grand-child, etc.)

parents?: Array<Parent>
memory: string

The contextual memory content

relation: "updates" | "extends" | "derives"

Relation type between this memory and its parent/child

One of the following:
"updates"
"extends"
"derives"
updatedAt: string

Contextual memory last update date

formatdatetime
metadata?: Record<string, unknown> | null

Contextual memory metadata

version?: number | null

Relative version distance from the primary memory (-1 for direct parent, -2 for grand-parent, etc.)

One of the following:
documents?: Array<Document>

Associated documents for this memory entry

id: string

Document ID

createdAt: string

Document creation date

formatdatetime
updatedAt: string

Document last update date

formatdatetime
metadata?: Record<string, unknown> | null

Document metadata (only included when documents=true)

summary?: string | null

Document summary (only included when summaries=true)

title?: string

Document title (only included when documents=true)

type?: string

Document type (only included when documents=true)

filepath?: string | null

Filepath of the source document this memory or chunk came from

isAggregated?: boolean

Indicates if this memory was created by aggregating multiple source memories

memory?: string

The memory content (only present for memory results)

rootMemoryId?: string | null

ID of the root (first version) memory entry this one descends from. Null for memories that have never been superseded. Only present on memory results, not on standalone chunk results.

version?: number | null

Version number of this memory entry

timing: number

Search timing in milliseconds

total: number

Total number of search results

Get user profile

import Supermemory from 'supermemory';

const client = new Supermemory({
  apiKey: process.env['SUPERMEMORY_API_KEY'], // This is the default and can be omitted
});

const response = await client.profile({ containerTag: 'containerTag' });

console.log(response.profile);
{
  "profile": {
    "buckets": {
      "foo": [
        "string"
      ]
    },
    "dynamic": [
      "string"
    ],
    "static": [
      "string"
    ]
  },
  "searchResults": {
    "results": [
      {
        "id": "mem_abc123",
        "metadata": {
          "source": "bar",
          "confidence": "bar"
        },
        "similarity": 0.89,
        "updatedAt": "updatedAt",
        "chunk": "This is a chunk of content from a document...",
        "chunks": [
          {
            "content": "This is a chunk of content from the document...",
            "documentId": "doc_xyz789",
            "position": 0
          }
        ],
        "context": {
          "children": [
            {
              "memory": "Later version: API rate limit increased to 100 req/min on the free tier.",
              "relation": "extends",
              "updatedAt": "updatedAt",
              "metadata": {
                "foo": "bar"
              },
              "version": 1
            }
          ],
          "parents": [
            {
              "memory": "Earlier version: API rate limit is 50 req/min on the free tier.",
              "relation": "updates",
              "updatedAt": "updatedAt",
              "metadata": {
                "foo": "bar"
              },
              "version": -1
            }
          ],
          "related": [
            {
              "memory": "memory",
              "relation": "extends",
              "updatedAt": "updatedAt",
              "metadata": {
                "foo": "bar"
              }
            }
          ]
        },
        "documents": [
          {
            "id": "doc_xyz789",
            "createdAt": "createdAt",
            "updatedAt": "updatedAt",
            "metadata": {
              "source": "bar",
              "language": "bar"
            },
            "summary": "API rate limit policy: 100 req/min free, 1000 req/min pro.",
            "title": "API Rate Limiting Policy",
            "type": "web"
          }
        ],
        "filepath": "filepath",
        "isAggregated": false,
        "memory": "The user prefers detailed API responses over minimal ones.",
        "rootMemoryId": "mem_abc123",
        "version": 3
      }
    ],
    "timing": 0,
    "total": 0
  }
}
Returns Examples
{
  "profile": {
    "buckets": {
      "foo": [
        "string"
      ]
    },
    "dynamic": [
      "string"
    ],
    "static": [
      "string"
    ]
  },
  "searchResults": {
    "results": [
      {
        "id": "mem_abc123",
        "metadata": {
          "source": "bar",
          "confidence": "bar"
        },
        "similarity": 0.89,
        "updatedAt": "updatedAt",
        "chunk": "This is a chunk of content from a document...",
        "chunks": [
          {
            "content": "This is a chunk of content from the document...",
            "documentId": "doc_xyz789",
            "position": 0
          }
        ],
        "context": {
          "children": [
            {
              "memory": "Later version: API rate limit increased to 100 req/min on the free tier.",
              "relation": "extends",
              "updatedAt": "updatedAt",
              "metadata": {
                "foo": "bar"
              },
              "version": 1
            }
          ],
          "parents": [
            {
              "memory": "Earlier version: API rate limit is 50 req/min on the free tier.",
              "relation": "updates",
              "updatedAt": "updatedAt",
              "metadata": {
                "foo": "bar"
              },
              "version": -1
            }
          ],
          "related": [
            {
              "memory": "memory",
              "relation": "extends",
              "updatedAt": "updatedAt",
              "metadata": {
                "foo": "bar"
              }
            }
          ]
        },
        "documents": [
          {
            "id": "doc_xyz789",
            "createdAt": "createdAt",
            "updatedAt": "updatedAt",
            "metadata": {
              "source": "bar",
              "language": "bar"
            },
            "summary": "API rate limit policy: 100 req/min free, 1000 req/min pro.",
            "title": "API Rate Limiting Policy",
            "type": "web"
          }
        ],
        "filepath": "filepath",
        "isAggregated": false,
        "memory": "The user prefers detailed API responses over minimal ones.",
        "rootMemoryId": "mem_abc123",
        "version": 3
      }
    ],
    "timing": 0,
    "total": 0
  }
}