MemorySync Documentation
Build persistent, user-scoped context for AI applications. Start with one write and one retrieval, then move to the pattern that matches your product.
Start here
Create an API key, store one memory, and retrieve it.
Learn what to store, how scope works, and what retrieval returns.
Apply memory to chatbots, agents, personalization, or RAG.
Go directly to request and response contracts.
Use the official Python or Node SDK with typed examples.
Plan reliability, observability, incidents, and deployment.
Configure GitHub, Notion, Drive, OneDrive, or web crawling.
Review usage, billing, SSO, roles, and enterprise controls.
Track product and documentation changes over time.
The three ideas to learn first
| Idea | What it means | Where to continue |
|---|---|---|
| Memory | Durable context your application can write and retrieve later. | What is a Memory |
| Scope | Organization, project, and end-user identifiers keep workloads separated. | Multi-tenant Applications |
| Retrieval | A natural-language query returns relevant memory for the same scope. | Retrieval Pipeline |
Your first useful result
The shortest successful path is: create a key, choose a project, identify an end user, write a useful fact, and query that fact back.
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",)memory = client.add("The user prefers concise answers and dark mode.",source="chat",metadata={'conversation_id':'conv-42'},)
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",)result = client.query("How should I format the answer?", k=5)for memory in result.memories:print(memory.text)
Safe defaults
- Keep API keys on your server and load them from environment variables.
- Use a stable, non-sensitive external identifier for
X-End-User-ID. - Store facts that improve future behavior—not complete prompts, secrets, or raw credentials.
- Use separate projects or keys when workloads have different access boundaries.