A universal persistent memory layer for AI chat platforms.
Your personal context — automatically injected into every conversation.
Every time you open a new conversation on Claude, ChatGPT, Grok, or Gemini, the AI has zero context about who you are, what you're working on, or what you prefer. You end up repeating yourself — your tech stack, your project details, your preferences — over and over.
AI Memory Layer maintains a persistent store of your personal context and automatically prepends it to your messages across all major AI chat platforms. The AI always knows who you are without you typing it every time.
[MY CONTEXT - ignore if not relevant]
[work] Senior full-stack developer at Acme Corp, working with TypeScript and Next.js
[projects] Building an e-commerce platform with Stripe integration
[preferences] Prefer concise answers with code examples. Use functional patterns.
[END CONTEXT]
How should I structure my checkout flow?
The AI sees your context. You just type your question.
- 🧠 Persistent Memory — Store facts about yourself, your work, projects, and preferences
- 🔄 Auto-Injection — Context is prepended to your messages automatically before submission
- 📌 Pinned Memories — Pin important context so it's always included first
- 🏷️ Tagged Organization — Categorize memories as Work, Projects, Personal, Preferences, or Other
- ⚡ Token Budget — Capped at 800 tokens (~3,200 chars) to avoid bloating prompts
- 🔒 Fully Local — All data stored via
chrome.storage.sync. No backend, no API calls, no tracking - 🌐 Cross-Platform — Works on Claude, ChatGPT, Grok, and Gemini
- 🎛️ Granular Control — Master toggle + per-site toggles to control where injection happens
- 📤 Export / Import — Backup and restore your memories as JSON
| Platform | Domain | Status |
|---|---|---|
| Claude | claude.ai |
✅ Supported |
| ChatGPT | chatgpt.com |
✅ Supported |
| Grok | grok.com |
✅ Supported |
| Gemini | gemini.google.com |
✅ Supported |
This is an unpacked Chrome extension — no web store needed.
-
Clone the repository
git clone https://github.com/srinath2098/ai-memory-layer.git
-
Open Chrome Extensions
- Navigate to
chrome://extensions - Enable Developer mode (toggle in the top-right corner)
- Navigate to
-
Load the extension
- Click Load unpacked
- Select the cloned
ai-memory-layerfolder
-
Pin the extension
- Click the puzzle icon in Chrome's toolbar
- Pin AI Memory Layer for easy access
- Click the 🧠 extension icon
- Go to the Add tab
- Type your memory (e.g., "I'm building a SaaS dashboard with React and Supabase")
- Select a tag and optionally toggle Pin
- Click Save Memory
- Navigate to any supported AI chat platform
- Focus the chat input and type your message
- Press Enter — the extension prepends your memory context automatically
- The AI receives your context + your message as a single prompt
- Memory tab — View all saved memories, pin/unpin, or delete
- Settings tab — Toggle injection on/off globally or per-site
- Export — Download all memories as a
.jsonbackup - Import — Restore memories from a previously exported file
ai-memory-layer/
├── manifest.json # Manifest V3 configuration
├── background.js # Service worker — storage CRUD, payload builder
├── content.js # Content script — input detection & injection
├── popup.html # Popup UI markup
├── popup.css # Dark theme with glassmorphism
├── popup.js # Popup logic — tabs, CRUD, settings
└── icons/
├── icon16.png
├── icon48.png
└── icon128.png
┌──────────┐ chrome.runtime ┌────────────────────┐ chrome.storage.sync
│ Popup │ ◄──── sendMessage ────► │ Background Worker │ ◄──────────────────► Storage
│ (UI) │ │ (Service Worker) │
└──────────┘ └────────────────────┘
▲
│ chrome.runtime
│ sendMessage
▼
┌────────────────────┐
│ Content Script │ ──► DOM (chat input)
│ (claude/chatgpt/ │
│ grok/gemini) │
└────────────────────┘
| Decision | Rationale |
|---|---|
chrome.storage.sync |
Data syncs across devices where the user is signed into Chrome |
| 800-token cap | Prevents prompt bloat while keeping enough room for meaningful context |
| Pinned + recency sorting | Ensures the most important and recently-used memories are prioritized when trimming |
Capture-phase keydown |
Runs before the site's own submit handler so injection happens pre-submission |
execCommand('insertText') |
Works with React/framework state management in contenteditable inputs |
| MutationObserver + interval | Handles SPA navigation where the input element may be swapped dynamically |
No build step. No dependencies. Just plain HTML/CSS/JS.
To make changes:
- Edit any file in the project
- Go to
chrome://extensions - Click the reload icon on the AI Memory Layer card
- Changes are applied immediately
- Popup: Right-click the extension icon → Inspect Popup
- Content Script: Open DevTools on the AI chat page → Console → look for
[AI Memory Layer]logs - Service Worker:
chrome://extensions→ click Service Worker link on the extension card
MIT — use it however you like.