Skip to main content

Facts API

Query and manage atomic facts extracted from memories.

Overview

Facts are atomic, structured statements automatically extracted from memories. Each fact has a category, importance rating (1-10), and links back to its source memory.

Automatic Extraction: Facts are extracted using LLM-based processing when memories are created. You can also manually create or update facts.

List Facts

GET /knowledge/facts — List facts

Returns facts across your account. Filter by category, intent, importance, or memory.

Query Parameters

NameTypeRequiredDescription
space_idstringnoSpace UUID (required for hub-permission-scoped accounts).
categorystringnoFilter by fact category.
intentstringnoFilter by semantic intent type (preference, capability, activity, goal, …).
minImportancenumbernoMinimum importance score (1-10).
memory_idsstringnoFilter by memory UUIDs (comma-separated or JSON array).
limitintegernoMaximum facts to return. Default: 50, Max: 100.
offsetintegernoOffset for pagination. Default: 0.

Response (200)

Returns { facts, total, limit, offset, has_more }.

GET /knowledge/facts?category=preference&minImportance=7&limit=10
{
  "facts": [
    {
      "id": "<uuid>",
      "content": "John loves Italian food",
      "category": "preference",
      "importance": 8,
      "memory_id": "<uuid>",
      "is_active": true,
      "created_at": "2026-04-10T10:30:00Z"
    }
  ],
  "total": 1,
  "limit": 10,
  "offset": 0,
  "has_more": false
}

GET /knowledge/facts/intent-distribution — Intent distribution across facts

Returns the distribution of semantic intent types across the account's facts, optionally filtered by date.

Query Parameters

NameTypeRequiredDescription
start_datestringnoFilter facts created on or after this date (YYYY-MM-DD).
end_datestringnoFilter facts created on or before this date (YYYY-MM-DD).

Response (200)

Returns { distribution, total, filters? }.

Get Memory Facts

GET /memories/:id/facts — Get facts for a memory

Returns all facts extracted from a specific memory.

Path Parameters

NameTypeRequiredDescription
idstringyesThe memory UUID.

Response (200)

Returns { memory_id, facts, total }.

GET /memories/<uuid>/facts
{
  "memory_id": "<uuid>",
  "facts": [
    {
      "id": "<uuid>",
      "content": "John loves Italian food",
      "category": "preference",
      "importance": 8,
      "is_active": true
    },
    {
      "id": "<uuid>",
      "content": "John works at Acme Corp",
      "category": "work",
      "importance": 9,
      "is_active": true
    }
  ],
  "total": 2
}

Create a Fact for a Memory

POST /memories/:id/facts — Attach a manually authored fact to a memory

Creates a fact linked to the given memory. Facts are always scoped to a source memory in the current API.

Path Parameters

NameTypeRequiredDescription
idstringyesThe source memory UUID.

Body Parameters

NameTypeRequiredDescription
contentstringyesThe fact content as a clear, atomic statement (1-2000 chars).
importanceintegeryesImportance score (1-10).
categorystringnoFact category. Default: general.
metadataobjectnoOptional metadata bag.

Response (201)

Returns the created fact object.

Request body
{
  "content": "Alice manages the engineering team",
  "category": "work",
  "importance": 8
}
Response
{
  "id": "<uuid>",
  "content": "Alice manages the engineering team",
  "category": "work",
  "importance": 8,
  "memory_id": "<uuid>",
  "is_active": true,
  "created_at": "2026-04-12T10:00:00Z"
}

Note: There is no standalone POST /facts, PATCH /facts/:id, or DELETE /facts/:id endpoint. Facts are managed relative to their source memory. Updating or supersede/delete operations for individual facts are not yet exposed publicly — facts become inactive when their source memory is deleted.

Fact Categories

Built-in categories for organizing facts:

CategoryDescriptionExamples
preferenceLikes, dislikes, preferences"Prefers dark mode", "Loves coffee"
personalPersonal information, traits"Born in 1990", "Has two kids"
workJob, career, professional"Works as a developer", "Manages 5 people"
relationshipConnections to others"Married to Sarah", "Reports to Mike"
eventPast or upcoming events"Attended conference in March", "Birthday is July 15"
goalAspirations, plans"Wants to learn Spanish", "Planning to relocate"
skillAbilities, expertise"Fluent in Python", "Certified in AWS"
healthHealth-related information"Allergic to peanuts", "Runs 5K daily"
locationPlaces, addresses"Lives in San Francisco", "Office in building 4"
generalOther factsAny fact that doesn't fit other categories

Fact Object

The fact object contains the following fields:

FieldTypeDescription
idstringUUID identifier for the fact.
contentstringThe atomic fact statement.
categorystringFact category.
importanceintegerImportance rating from 1 (low) to 10 (critical).
memory_idstringSource memory UUID this fact was extracted from.
is_activebooleanWhether this fact is current. Facts are deactivated when their source memory is deleted.
metadataobjectCustom key-value pairs (e.g. intentType).
created_atstringISO 8601 timestamp of when the fact was created.
updated_atstringISO 8601 timestamp of when the fact was last updated.