Give Cursor persistent memory across coding sessions using the Atlas SDK.
Cursor is an AI-first code editor. By wiring Atlas into it, you can have Cursor remember architectural decisions, project conventions, past bugs, and team preferences across sessions — even across different projects.
Create a file called atlas_memory.py in your project root. Cursor's AI features can call this directly.
Add these to your shell profile (~/.zshrc or ~/.bashrc) or a .env file in your project:
.env to your .gitignore. Never commit API keys.Go to Cursor Settings → Rules for AI and add the following rule. This teaches Cursor to consult Atlas before and after each significant response.
In Cursor's terminal:
Now open Cursor's chat and ask: "What database are we using and why?" — Cursor will retrieve and surface the answer from Atlas.
The best habit is to store a fact right after Cursor makes a recommendation you accept. Say: "Store this decision in Atlas" and Cursor will run `atlas_memory.py add` for you.
Set `ATLAS_PERSONA=<project-name>` so memories from different projects stay separated, even under the same user namespace.
Before asking Cursor a question about an existing system, prompt it with: "Search Atlas for context on X, then answer." This ensures it uses your stored knowledge before hallucinating.