Core Concepts
Relationships & Summaries
Use relationships to connect known records and summaries to condense a selected set of memories. Both operations stay inside the authenticated memory scope.
Connect related memories
Create a relationship when your application knows how two memory records are connected. The source and target must be different records in the caller’s authorized scope.
| Type | Use |
|---|---|
supports / contradiction | Represent confirming or conflicting information. |
derived_from / summary_of / detail_of | Represent provenance or level of detail. |
continuation / extends | Represent an idea that continues another. |
caused_by / references / similar | Represent causal, reference, or similarity links. |
Create a relationship
import osfrom memorysync import MemorySyncClientclient = 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",)relation = client.create_relation(101,to_memory_id=102,relationship_type="supports",confidence=0.9,metadata={"note": "Confirmed by the later decision"},)
Summarize a selected set
Summarization creates a new memory from the IDs you provide. Review the result before using it as authoritative context.
import osfrom memorysync import MemorySyncClientclient = 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",)summary = client.summarize([101, 102, 103], lossless=True)
When to use each operation
| Need | Operation |
|---|---|
| Keep two records and describe their connection. | Create a relationship. |
| Reduce several related records into one concise record. | Create a summary. |
| Correct tags, importance, source, or metadata. | Update the original memory. |
| Remove information that should no longer be retained. | Forget the memory. |
Keep generated summaries reviewable
- Preserve source IDs when your workflow needs traceability.
- Do not treat a generated summary as a replacement for an authoritative source system.
- Do not create relationships from untrusted model output without validation.
- Use
losslessonly according to your product’s retention and re-expansion needs.