Skip to main content
Memex keeps the core payload shape consistent across direct REST calls, MCP tool calls, and agent wrappers.

Surface envelope

  • REST returns the payload directly.
  • MCP returns the same payload inside result.structuredContent.
  • Skills and plugins should return the same payload object.

Search response

Search has two response modes:
  • default compact mode with raw: false or omitted, which is better when you want to send the response directly to an LLM
  • raw mode with raw: true, which is better when you want to process the response programmatically and preserve the original search graph
Some clients expose these as named response options:
  • llm means the compact mode. For REST, omit raw or send "raw": false.
  • full means the raw machine-readable mode. For REST, send "raw": true.
For saved views, use POST /search with viewIds when you need to choose between llm and full response modes. POST /execute-view-search returns the full shape directly.

Compact search response (raw: false, default)

Compact search results return a results array with a slim top-level contract:
  • top-level type, url, createdAt, title?, and text stay consistent across content types
  • media is opt-in per content type and only includes slim entries such as imageDescription, chunked transcriptChunks, and image assetUrls
  • web HTML is precompiled into markdown-like text
  • annotation text is precompiled with references resolved inline
  • annotation references resolve selector text/timestamps plus source title and summary into YAML blocks
  • user_notes contains annotations attached to the matched content entity when includeNotes is true
  • annotation-shaped compact results and user_notes can both expose a compact references object for directly referenced content
  • compact raw=false output omits chunk matches, extra entities, and other raw search scaffolding

Raw search response (raw: true)

Raw mode keeps the original search payload shape and adds nested annotation references where they matter. Use it when your application code needs the richer search graph for deterministic parsing, post-processing, or custom rendering:
  • referencesByResultId maps content and tag relationships by entity ID
  • when includeNotes is true, each matched result can expose annotations
  • each annotation in annotations includes resolvedReferences for direct reference entities
  • each annotation can also include references, which returns the direct reference entities inline
  • if one of those direct references is itself an annotation, that nested annotation gets its own references one level deep
Memex resolves these raw annotation and chat-thread references from both:
  • reference_content_ids
  • memex-reference nodes inside annotation JSON content or chat-thread message JSON content
This means the raw references field can describe:
  • annotations attached directly to a matched content entity through includeNotes
  • annotations or other entities directly referenced inside annotation content
  • annotations or other entities directly referenced inside chat-thread message content
usageMicrosCharged reports the dollar-denominated usage micros consumed by that search request. 1,000,000 micros equals $1.00. Search currently reports 0. Compact raw=false search defaults reranking on when the query is eligible for rerank. Raw raw=true search defaults reranking off unless enableRerank is explicitly set to true.

Compact example

Raw example

Save response

save-content-entity responses include related entities:
When responseMode: 'receipt' is passed, save-content-entity returns after the content processing request is queued:
save-content-by-url responses use this shape:

Shared supporting shapes

For search responses, Memex resolves url whenever it can derive a stable reference URL from the saved entity, including tweets, YouTube videos, Reddit posts, images, and other non-web items.

Content type shapes

Web

Twitter

YouTube

Image

Reddit

Other content entities

referencedEntities and some search results can contain additional Memex entity types:

Upgrade options shape

When Memex cannot charge a search request, upgradeOptions follows this shape: