On this page
Memory

Memory

GetLLM is the memory layer (/v1/memory/*). Ingest what the user says, then retrieve relevant context to inject into your own model calls — memory that survives across sessions, scoped to your key (optionally partitioned per end-user with sub_tenant).

Base path
https://www.getllm.ai/v1/memory

Same host and same gl-live-... key as the gateway — only the path prefix differs.

Ingest & Retrieve

GetLLM is the memory layer (/v1/memory/*). Ingest what the user says, then retrieve relevant context to inject into your own model calls — memory that survives across sessions, scoped to your key (optionally partitioned per end-user with sub_tenant).

# 1) Store a turn (optionally extracting durable facts)
curl https://www.getllm.ai/v1/memory/ingest \
  -H "Authorization: Bearer gl-live-..." \
  -H "Content-Type: application/json" \
  -d '{"user_said":"I prefer Python over Go","extract_facts":true}'

# 2) Retrieve relevant memory for the next prompt
curl https://www.getllm.ai/v1/memory/query \
  -H "Authorization: Bearer gl-live-..." \
  -H "Content-Type: application/json" \
  -d '{"text":"what languages do I like?","top_k":8}'
# → { "rendered": "...context to inject...", "items": [ ... ] }

Inject the returned `rendered` string as a system message in your own /v1/chat/completions call — that's the whole loop. Or skip building it yourself and use the Chat API below.

Scoping & isolation

Memory is isolated per API key by default. To run multi-tenant — one key serving many end-users — partition with sub_tenant so each user only ever recalls their own facts.

  • Per key — every /v1/memory/* call is scoped to the calling key's account; keys never see each other's memory.
  • Per end-user — pass sub_tenant on ingest and query to carve a key's memory into isolated partitions, one per end-user.
  • Your data, your call — export and deletion are always available; nothing is shared across accounts.
# retrieve only end-user-42's memory
curl https://www.getllm.ai/v1/memory/query \
  -H "Authorization: Bearer gl-live-..." \
  -H "Content-Type: application/json" \
  -d '{"text":"what does this user like?","sub_tenant":"end-user-42","top_k":8}'

Don't want to wire the loop yourself? The Chat calls ingest + query for you on every turn — see the Chat docs.