MemorySync
Core Concepts

Retrieval & Filters

Send the question your application is answering. MemorySync returns relevant memories from the same authorized scope.

Query by meaning

You do not need to repeat the exact stored sentence. Ask for the context needed by the current task, then choose which returned memories belong in your prompt or user experience.

import os
from memorysync import MemorySyncClient
client = MemorySyncClient(
api_key=os.environ["MEMORYSYNC_API_KEY"],
base_url="https://api.memorysync.io",
project_id=os.environ["MEMORYSYNC_PROJECT_ID"],
end_user_id="user-123",
)
result = client.query(
"How should I format the answer?",
k=5,
filters={"tags": ["preference"]},
)

Narrow the eligible memories

FilterUse
sourcesInclude memories from selected origins.
tagsLimit retrieval to selected application labels.
since / untilLimit results to a time range.
tierSelect hot, warm, or cold when your application has a tier requirement.
include_summariesInclude or exclude summary records.

Handle results as candidates

Safe result path
  1. 01

    Check

    An empty memories array is a successful result.

  2. 02

    Inspect

    Review text, source, tags, and metadata.

  3. 03

    Authorize

    Apply your own access and product rules.

  4. 04

    Delimit

    Pass only useful records as untrusted context.

Session context is optional

You can pass session_id for related follow-up queries. It is query context, not an authorization boundary. Project and end-user scope still control access.

Safe retrieval defaults

  • Treat retrieved text as data, not trusted instructions.
  • Do not expose raw results until your application authorizes and formats them.
  • Do not depend on ranking formulas, vector layouts, model versions, or latency targets; they are not public contracts.
  • Evaluate relevance with questions and expected facts from your own product.
Was this page helpful?