Retainr icon

Retainr

Store, search, and retrieve AI agent memories.

Actions6

Memory → Get Context

AI-generated

Summary

Retrieve pre-formatted memory context for LLM prompts.

Inputs

  • query (required) — Natural language query to retrieve relevant context.
  • format — Output format for the context block. Default: system_prompt.
  • namespace — Group memories by any string. Leave empty for global scope. Default: empty string.
  • contextAdditionalFields — Additional filtering and limiting options for context retrieval.

Output shape

API response from POST /v1/memories/context, containing the formatted memory context as JSON.

The operation posts to the retainr API endpoint /v1/memories/context with a body composed of the query and format parameters, plus optional namespace, tags (parsed from the comma-separated string), limit (derived from maxMemories), and threshold (from contextAdditionalFields). The result is returned as the n8n item's JSON data.

Links

Discussion