Skip to main content

Knowledge

The Knowledge API provides access to structured knowledge compiled from processed memories. As memories are processed, Memsolus builds a categorized knowledge base per user — accessible here as paginated entries or a single merged Markdown profile.

Knowledge entries require the hasKnowledgeGraph entitlement on your plan.

Endpoint Overview

MethodPathPermissionDescription
GET/v1/knowledgeknowledge.readList knowledge entries or get merged profile
GET/v1/knowledge/:idknowledge.readGet a single knowledge entry by ID

Knowledge Entry Object

FieldTypeDescription
idstringUUID of the knowledge entry
user_idstringUser this knowledge belongs to
categorystringKnowledge category (e.g., tech_stack, preferences)
contentstringCompiled Markdown content for this category
versionnumberIncremented each time this entry is recompiled
created_atstringISO 8601 creation timestamp
updated_atstringISO 8601 last-update timestamp

Each (workspaceId, userId, category) combination is unique — there is exactly one entry per category per user per workspace.


List Knowledge

GET/v1/knowledge
API Key

List knowledge entries or get a single merged profile

ParameterTypeDescription
user_idstringFilter knowledge entries by user
categorystringFilter by knowledge category (e.g., `tech_stack`, `preferences`)
searchstringFull-text search within knowledge content
mergedbooleanWhen `true`, returns a single merged Markdown profile across all categories instead of a paginated list (default: false)
pagenumberPage number, starting at 1 (default: 1)
page_sizenumberResults per page, max 100 (default: 20)
curl "https://api.memsolus.com/v1/knowledge?user_id=user-123" \
-H "X-Api-Key: msk_live_..."
200Paginated list
{
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"user_id": "user-123",
"category": "tech_stack",
"content": "## Tech Stack\n\nThe user works primarily with TypeScript for backend and frontend development.\n\n- **Primary language**: TypeScript\n- **Backend**: API framework, Fastify\n- **Frontend**: React 18, TanStack Router",
"version": 3,
"created_at": "2026-01-10T08:00:00.000Z",
"updated_at": "2026-01-20T09:00:00.000Z"
},
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"user_id": "user-123",
"category": "preferences",
"content": "## Preferences\n\nThe user prefers dark mode in all tools. Values keyboard shortcuts and minimal UI.",
"version": 1,
"created_at": "2026-01-12T10:00:00.000Z",
"updated_at": "2026-01-12T10:00:00.000Z"
}
],
"total": 4,
"page": 1,
"page_size": 20
}

Get Merged Knowledge Profile

Setting merged=true returns a single unified object with all knowledge categories concatenated into one Markdown document. This is the recommended way to inject full user context at the start of a conversation.

curl "https://api.memsolus.com/v1/knowledge?user_id=user-123&merged=true" \
-H "X-Api-Key: msk_live_..."
200Merged profile
{
"content": "## Tech Stack\n\nThe user works primarily with TypeScript...\n\n## Preferences\n\nThe user prefers dark mode...\n\n## Work Context\n\nWorks on a SaaS product...\n\n## Communication Style\n\nPrefers concise, direct responses...",
"version": 7,
"categories": ["tech_stack", "preferences", "work_context", "communication_style"]
}

The version in the merged response is the sum of all individual entry versions, reflecting the total number of recompilation cycles across categories.


Get Knowledge Entry

GET/v1/knowledge/:id
API Key

Get a single knowledge entry by ID

curl https://api.memsolus.com/v1/knowledge/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "X-Api-Key: msk_live_..."
200Success
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"user_id": "user-123",
"category": "tech_stack",
"content": "## Tech Stack\n\nThe user works primarily with TypeScript for backend and frontend development.\n\n- **Primary language**: TypeScript\n- **Backend**: API framework, Fastify\n- **Frontend**: React 18, TanStack Router",
"version": 3,
"created_at": "2026-01-10T08:00:00.000Z",
"updated_at": "2026-01-20T09:00:00.000Z"
}

Returns 404 KNOWLEDGE_NOT_FOUND if the entry does not exist or does not belong to the current workspace.