Skip to main content

Type Reference

All types listed here are exported from @memsolus/sdk and available with full TypeScript autocomplete.

import type {
Memory,
Knowledge,
MergedKnowledge,
Entity,
TraversalResult,
GraphQueryResult,
SearchResult,
PaginatedResult,
MemoryEvent,
DashboardSummary,
MemoryProfile,
EntityItem,
} from '@memsolus/sdk';

Core types

Memory

Represents a stored memory.

FieldTypeDescription
idstringUUID of the memory
contentstringThe memory text
userIdstring | undefinedAssociated user ID
agentIdstring | undefinedAssociated agent ID
sessionIdstring | undefinedAssociated session ID
layerMemoryLayerTASK or RAW
priorityMemoryPriorityLOW, MEDIUM, or HIGH
statusMemoryStatusProcessing status
categoriesstring[]Category tags
metadataRecord<string, unknown> | undefinedArbitrary key-value metadata
scorenumber | undefinedRelevance score — only present in search results
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last-updated timestamp

MemoryEvent

Represents a single event in a memory's history timeline.

FieldTypeDescription
idstringUUID of the event
memoryIdstringID of the parent memory
typestringEvent type: CREATED, UPDATED, PROMOTED, FEEDBACK_SUBMITTED, etc.
payloadRecord<string, unknown> | undefinedEvent-specific data
createdAtstringISO 8601 timestamp

Knowledge

Represents a single knowledge entry in a specific category.

FieldTypeDescription
idstringUUID of the knowledge entry
contentstringCompiled Markdown content for this category
categorystringCategory name (e.g., "tech-stack", "preferences")
userIdstring | undefinedAssociated user ID
sourceMemoryIdsstring[]IDs of memories that contributed to this entry
createdAtstringISO 8601 creation timestamp

MergedKnowledge

Returned by client.knowledge.list({ merged: true }). Combines all knowledge entries into a single Markdown document.

FieldTypeDescription
userIdstring | undefinedAssociated user ID
entriesKnowledge[]Individual knowledge entries that were merged
mergedAtstringISO 8601 timestamp of the merge

Entity

Represents an entity in the knowledge graph.

FieldTypeDescription
idstringUUID of the entity
namestringHuman-readable name
typeEntityTypePERSON, ORGANIZATION, PLACE, or THING
descriptionstring | undefinedOptional description

TraversalResult

Returned by client.graph.traverse.

FieldTypeDescription
startEntityEntityThe entity the traversal started from
pathsTraversalPath[]Connected entities and their relationships

TraversalPath

FieldTypeDescription
entityEntityConnected entity
relationshipstringRelationship type (e.g., "WORKS_AT", "USES")
depthnumberNumber of hops from the start entity

GraphQueryResult

Returned by client.graph.query.

FieldTypeDescription
answerstringNatural language answer
entitiesUsedEntity[]Entities referenced to form the answer
confidencenumberConfidence score from 0.0 to 1.0

SearchResult

Returned by client.memories.search.

FieldTypeDescription
dataMemory[]Matched memories ordered by relevance score
meta.totalnumberTotal matching memories
meta.modeSearchModeSearch mode used: hybrid, semantic, or keyword

PaginatedResult<T>

Returned by list operations (memories.list, knowledge.list, memories.history).

FieldTypeDescription
dataT[]Items on the current page
meta.totalnumberTotal number of items
meta.pagenumberCurrent page number
meta.pageSizenumberItems per page
meta.totalPagesnumberTotal number of pages

DashboardSummary

Returned by client.dashboard.summary.

FieldTypeDescription
totalMemoriesnumberTotal memories in the workspace
totalSearchesnumberTotal search requests in the period
totalTokensnumberTotal tokens consumed in the period
comparisonPeriod.memoriesnumberMemory count in the previous equivalent period
comparisonPeriod.searchesnumberSearch count in the previous equivalent period
comparisonPeriod.tokensnumberToken count in the previous equivalent period
daysnumberTime window in days

MemoryProfile

Returned by client.profiles.get.

FieldTypeDescription
userIdstringID of the user
summarystringNarrative summary built from the user's memories
topicsstring[]Main topics the user's memories cover
entityCountnumberNumber of entities linked to this user

EntityItem

Returned by client.entities.list.

FieldTypeDescription
userIdstring | undefinedUser ID (present for user entities)
agentIdstring | undefinedAgent ID (present for agent entities)
memoryCountnumberNumber of memories stored for this entity
lastActivityAtstringISO 8601 timestamp of the last memory update

Enums

MemoryLayer

Controls the retention behavior of a memory.

ValueDescription
TASKTemporary memory with an expiration (TTL). Use for session context. Promote to RAW with client.memories.promote to make it permanent.
RAWPermanent memory with no expiration. Default for most memories.

MemoryPriority

Influences retrieval ranking and retention decisions.

ValueDescription
LOWSupplementary context — lower retrieval weight
MEDIUMStandard priority (default)
HIGHImportant facts, preferences, and decisions — higher retrieval weight

MemoryStatus

Tracks where the memory is in its processing lifecycle.

ValueDescription
PENDINGMemory was created and is queued for processing
PROCESSINGMemory is being enriched and indexed
READYMemory is fully processed and available for search
FAILEDProcessing failed — the memory may still be retrieved but will not appear in search

SearchMode

Controls how query matching works.

ValueDescription
hybridCombines semantic and keyword matching — recommended for most queries
semanticMatches by meaning — best for conceptual queries and paraphrases
keywordExact term matching (BM25) — best for names, IDs, and codes

EntityType

Type of entity in the knowledge graph.

ValueDescription
PERSONA person — user, team member, contact
ORGANIZATIONA company, team, or institution
PLACEA location — city, country, office
THINGA concept, tool, technology, project, or artifact

FeedbackSignal

Quality signal submitted via client.memories.feedback.

ValueDescription
POSITIVEMemory was accurate and useful
NEGATIVEMemory was wrong, misleading, or irrelevant
NEUTRALNeutral observation — neither helpful nor harmful

Input types

The following types describe the parameters accepted by SDK methods. They are exported for use in your own wrappers or utilities.

TypeUsed by
CreateMemoryInputclient.memories.create
SearchMemoriesInputclient.memories.search
ListMemoriesInputclient.memories.list
UpdateMemoryInputclient.memories.update
FeedbackInputclient.memories.feedback
MemoryHistoryInputclient.memories.history
ListKnowledgeInputclient.knowledge.list
GraphSearchInputclient.graph.search
GraphTraverseInputclient.graph.traverse