Skip to main content

Reflect

POST /api/v2/containers/{container_tag}/reflect

Reflect recalls eligible memory, assembles bounded context, and returns a grounded answer. It is useful for applications that want UnifiedMemory to do both memory retrieval and answer synthesis.

Reflect does not silently save the generated answer. Use Writeback for durable post-turn capture.

Request fields

FieldRequiredTypeDefaultDescription
queryYesstringQuestion to answer with memory.
answer_modeNostringgroundedSynthesis style. Grounded mode should cite memory context.
recall_limitNointeger6Number of memory candidates to retrieve.
trust_policyNostringbalancedTrust policy for recall.
max_tokensNointeger1200Output budget.
temperatureNonumber0.35Synthesis temperature.
save_memoryNobooleanfalseWhether to create a separate memory candidate from the reflection.
metadataNoobject{}Integration-specific request metadata.

Schema from OpenAPI

This section is generated from /openapi.public.json. Edit the OpenAPI source or generator, not this block.

POST /api/v2/containers/{container_tag}/reflect

  • Operation ID: reflect_memories_api_v2_containers__container_tag__reflect_post
  • Declared response statuses: 200, 422

Request schema

Schema: ReflectRequest

FieldRequiredTypeNullableDefaultConstraints
agent_idNostringYes--
answer_modeNostringNo"grounded"-
app_idNostringYes--
contextNostringYes--
context_tagsNoarray of stringYes--
context_typesNoarray of stringYes--
max_tokensNointegerNo1200minimum=128.0, maximum=4096.0
memory_planeNostringYes--
memory_scopeNostringYes--
org_idNostringYes--
priority_idsNoarray of stringYes--
queryYesstringNo-minLength=1
recall_limitNointegerNo6minimum=3.0, maximum=12.0
request_idNostringYes--
rewrite_contextNobooleanNotrue-
run_idNostringYes--
save_memoryNobooleanNofalse-
source_appNostringYes--
temperatureNonumberNo0.35minimum=0.0, maximum=1.0
user_idNostringYes--

200 response schema

Schema: ReflectResponse

FieldRequiredTypeNullableDefaultConstraints
container_tagYesstringNo--
diagnosticsNoobjectNo--
memory_captureNoobjectYes--
modelNostringYes--
queryYesstringNo--
recall_contextNostringNo""-
replyYesstringNo--
sourcesNoarray of objectNo--
usageNoobjectNo--

Example

curl https://edge-api.jithendranara.dev/api/v2/containers/jeethendra/reflect \
-H "Authorization: Bearer $UNIFIED_MEMORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "How should agents decide what to retain?",
"answer_mode": "grounded",
"recall_limit": 5
}'

Response shape

{
"answer": "Agents should retain atomic facts, decisions, tool outcomes, and durable preferences. They should avoid raw transcripts and assistant dumps.",
"memories": [
{
"id": "mem_bad_candidates",
"content": "Full assistant answer dumps should be forensic residue unless atomic outcomes are extracted.",
"trust_bucket": "trusted"
}
],
"citations": [
{
"memory_id": "mem_bad_candidates",
"courtroom_url": "/memories?view=courtroom&case=mem_bad_candidates"
}
],
"tokens_injected": 112,
"trust_policy": "balanced",
"saved_memory_id": null
}

Common outcomes

StatusMeaning
200Reflection completed.
401Missing or invalid key.
403Key lacks recall/reflect capability.
404Container not found or not visible.
422Missing or invalid query.
200 degradedSynthesis provider unavailable; response may include recall context and an unavailable status.

Next steps

  • Use Recall when the caller wants memory context only.
  • Use Courtroom when an answer depends on a disputed memory.