Type Reference
All types listed here are exported from @memsolus/sdk and available with full TypeScript autocomplete.
Core types
Memory
Represents a stored memory.
| Field | Type | Description |
|---|---|---|
id | string | UUID of the memory |
content | string | The memory text |
userId | string | undefined | Associated user ID |
agentId | string | undefined | Associated agent ID |
sessionId | string | undefined | Associated session ID |
layer | MemoryLayer | TASK or RAW |
priority | MemoryPriority | LOW, MEDIUM, or HIGH |
status | MemoryStatus | Processing status |
categories | string[] | Category tags |
metadata | Record<string, unknown> | undefined | Arbitrary key-value metadata |
score | number | undefined | Relevance score — only present in search results |
createdAt | string | ISO 8601 creation timestamp |
updatedAt | string | ISO 8601 last-updated timestamp |
MemoryEvent
Represents a single event in a memory's history timeline.
| Field | Type | Description |
|---|---|---|
id | string | UUID of the event |
memoryId | string | ID of the parent memory |
type | string | Event type: CREATED, UPDATED, PROMOTED, FEEDBACK_SUBMITTED, etc. |
payload | Record<string, unknown> | undefined | Event-specific data |
createdAt | string | ISO 8601 timestamp |
Knowledge
Represents a single knowledge entry in a specific category.
| Field | Type | Description |
|---|---|---|
id | string | UUID of the knowledge entry |
content | string | Compiled Markdown content for this category |
category | string | Category name (e.g., "tech-stack", "preferences") |
userId | string | undefined | Associated user ID |
sourceMemoryIds | string[] | IDs of memories that contributed to this entry |
createdAt | string | ISO 8601 creation timestamp |
MergedKnowledge
Returned by client.knowledge.list({ merged: true }). Combines all knowledge entries into a single Markdown document.
| Field | Type | Description |
|---|---|---|
userId | string | undefined | Associated user ID |
entries | Knowledge[] | Individual knowledge entries that were merged |
mergedAt | string | ISO 8601 timestamp of the merge |
Entity
Represents an entity in the knowledge graph.
| Field | Type | Description |
|---|---|---|
id | string | UUID of the entity |
name | string | Human-readable name |
type | EntityType | PERSON, ORGANIZATION, PLACE, or THING |
description | string | undefined | Optional description |
TraversalResult
Returned by client.graph.traverse.
| Field | Type | Description |
|---|---|---|
startEntity | Entity | The entity the traversal started from |
paths | TraversalPath[] | Connected entities and their relationships |
TraversalPath
| Field | Type | Description |
|---|---|---|
entity | Entity | Connected entity |
relationship | string | Relationship type (e.g., "WORKS_AT", "USES") |
depth | number | Number of hops from the start entity |
GraphQueryResult
Returned by client.graph.query.
| Field | Type | Description |
|---|---|---|
answer | string | Natural language answer |
entitiesUsed | Entity[] | Entities referenced to form the answer |
confidence | number | Confidence score from 0.0 to 1.0 |
SearchResult
Returned by client.memories.search.
| Field | Type | Description |
|---|---|---|
data | Memory[] | Matched memories ordered by relevance score |
meta.total | number | Total matching memories |
meta.mode | SearchMode | Search mode used: hybrid, semantic, or keyword |
PaginatedResult<T>
Returned by list operations (memories.list, knowledge.list, memories.history).
| Field | Type | Description |
|---|---|---|
data | T[] | Items on the current page |
meta.total | number | Total number of items |
meta.page | number | Current page number |
meta.pageSize | number | Items per page |
meta.totalPages | number | Total number of pages |
DashboardSummary
Returned by client.dashboard.summary.
| Field | Type | Description |
|---|---|---|
totalMemories | number | Total memories in the workspace |
totalSearches | number | Total search requests in the period |
totalTokens | number | Total tokens consumed in the period |
comparisonPeriod.memories | number | Memory count in the previous equivalent period |
comparisonPeriod.searches | number | Search count in the previous equivalent period |
comparisonPeriod.tokens | number | Token count in the previous equivalent period |
days | number | Time window in days |
MemoryProfile
Returned by client.profiles.get.
| Field | Type | Description |
|---|---|---|
userId | string | ID of the user |
summary | string | Narrative summary built from the user's memories |
topics | string[] | Main topics the user's memories cover |
entityCount | number | Number of entities linked to this user |
EntityItem
Returned by client.entities.list.
| Field | Type | Description |
|---|---|---|
userId | string | undefined | User ID (present for user entities) |
agentId | string | undefined | Agent ID (present for agent entities) |
memoryCount | number | Number of memories stored for this entity |
lastActivityAt | string | ISO 8601 timestamp of the last memory update |
Enums
MemoryLayer
Controls the retention behavior of a memory.
| Value | Description |
|---|---|
TASK | Temporary memory with an expiration (TTL). Use for session context. Promote to RAW with client.memories.promote to make it permanent. |
RAW | Permanent memory with no expiration. Default for most memories. |
MemoryPriority
Influences retrieval ranking and retention decisions.
| Value | Description |
|---|---|
LOW | Supplementary context — lower retrieval weight |
MEDIUM | Standard priority (default) |
HIGH | Important facts, preferences, and decisions — higher retrieval weight |
MemoryStatus
Tracks where the memory is in its processing lifecycle.
| Value | Description |
|---|---|
PENDING | Memory was created and is queued for processing |
PROCESSING | Memory is being enriched and indexed |
READY | Memory is fully processed and available for search |
FAILED | Processing failed — the memory may still be retrieved but will not appear in search |
SearchMode
Controls how query matching works.
| Value | Description |
|---|---|
hybrid | Combines semantic and keyword matching — recommended for most queries |
semantic | Matches by meaning — best for conceptual queries and paraphrases |
keyword | Exact term matching (BM25) — best for names, IDs, and codes |
EntityType
Type of entity in the knowledge graph.
| Value | Description |
|---|---|
PERSON | A person — user, team member, contact |
ORGANIZATION | A company, team, or institution |
PLACE | A location — city, country, office |
THING | A concept, tool, technology, project, or artifact |
FeedbackSignal
Quality signal submitted via client.memories.feedback.
| Value | Description |
|---|---|
POSITIVE | Memory was accurate and useful |
NEGATIVE | Memory was wrong, misleading, or irrelevant |
NEUTRAL | Neutral 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.
| Type | Used by |
|---|---|
CreateMemoryInput | client.memories.create |
SearchMemoriesInput | client.memories.search |
ListMemoriesInput | client.memories.list |
UpdateMemoryInput | client.memories.update |
FeedbackInput | client.memories.feedback |
MemoryHistoryInput | client.memories.history |
ListKnowledgeInput | client.knowledge.list |
GraphSearchInput | client.graph.search |
GraphTraverseInput | client.graph.traverse |
Related
- Memories — method signatures and examples
- Knowledge — knowledge list and get methods
- Knowledge Graph — graph search, traverse, and query
- Error Handling — error class definitions