Skip to main content
The Memories API allows you to store, retrieve, search, and manage memories for your AI applications.

Create Memory

Create a new memory. The memory is processed asynchronously with AI classification.
content
string
required
The memory content to store
project_id
string
default:"default"
Project ID for organizing memories
metadata
object
Additional metadata for the memory

Request

curl -X POST https://t0ken.ai/api/v1/memories \
  -H "Content-Type: application/json" \
  -H "X-API-Key: omx_your_api_key" \
  -d '{
    "content": "User prefers dark mode in all applications",
    "project_id": "default",
    "metadata": {
      "source": "user_settings",
      "category": "preferences"
    }
  }'

Response

{
  "success": true,
  "message": "Memory queued for processing",
  "task_id": "abc123def456",
  "status": "pending"
}

List Memories

Retrieve all memories for the authenticated user.
project_id
string
Filter by project ID
limit
integer
default:"100"
Maximum number of results
offset
integer
default:"0"
Number of results to skip

Request

curl "https://t0ken.ai/api/v1/memories?limit=10" \
  -H "X-API-Key: omx_your_api_key"

Response

{
  "success": true,
  "data": [
    {
      "id": "mem_123abc",
      "content": "User prefers dark mode",
      "project_id": "default",
      "cognitive_sector": "semantic",
      "importance_score": 0.85,
      "created_at": "2026-02-13T10:00:00Z",
      "updated_at": "2026-02-13T10:00:00Z"
    }
  ],
  "total": 1
}

Get Memory

Retrieve a specific memory by ID.
curl https://t0ken.ai/api/v1/memories/mem_123abc \
  -H "X-API-Key: omx_your_api_key"

Delete Memory

Delete a memory by ID.
curl -X DELETE https://t0ken.ai/api/v1/memories/mem_123abc \
  -H "X-API-Key: omx_your_api_key"

Response

{
  "success": true,
  "message": "Memory deleted successfully"
}

Search Memories

Search memories using vector similarity and keyword matching.
query
string
required
Search query string
project_id
string
Filter by project ID
limit
integer
default:"10"
Maximum number of results

Request

curl -X POST https://t0ken.ai/api/v1/memories/search \
  -H "Content-Type: application/json" \
  -H "X-API-Key: omx_your_api_key" \
  -d '{
    "query": "user preferences dark mode",
    "limit": 5
  }'

Response

{
  "success": true,
  "data": [
    {
      "id": "mem_123abc",
      "content": "User prefers dark mode in all applications",
      "score": 0.92,
      "cognitive_sector": "semantic"
    }
  ],
  "query": "user preferences dark mode"
}

Cognitive Sectors

Memories are automatically classified into cognitive sectors:
SectorDescriptionExample
episodicSpecific events/experiences”User visited Paris in 2024”
semanticFacts and general knowledge”User prefers dark mode”
proceduralSkills and how-to knowledge”User knows Python”
emotionalFeelings and preferences”User enjoys sci-fi movies”
reflectiveInsights and summaries”User values privacy”