Blog·Engineering

I reverse-engineered Instinct's memory. Here's exactly how it works

Instinct keeps its memory as git-tracked markdown files, found with grep rather than vectors. Here is the whole system as far as black-box probing can reconstruct it, and how to rebuild it on supermemory in about 60 lines.

By Dhravya Shah·9 min read

Reverse-engineering Instinct's memory

Instinct has taken the world by storm over the last two weeks — it's one of the best iMessage assistants I've used. As with every product, I decided to reverse-engineer Instinct's memory to find out exactly how it works.

I've been working on agent memory for the last 3 years, and I'm the founder of supermemory. The industry is constantly changing and there's no right answer to "how to do agent memory". Each product has different needs and constraints. Surprisingly, Instinct's memory aligns with our views of memory, and you can fully replicate it with supermemory — how-to at the end.

Because I've been doing this for so long, I have somewhat of a good intuition of how memory systems typically work, so I can reverse-engineer memory systems by just probing on the surface of the agent (the iMessage interface).

This is gonna be a bit long.

Instinct is powered by git-tracked markdown files

At its core, the memories are stored as git-tracked markdown files, but with a lot of harness-specific engineering done to make it seamless and fast.

The answering model (likely an open-weights model) receives:

  • Current conversation context
  • An identity "profile" of the user
  • A memory one-pager (of what's going on)
  • A compaction recap
  • A to-do / tasks board
Conversation messages ────────────────→ Current conversation context
        │                                         │
        └→ Background processing [unknown]         │
                      │                           │
             Accessible Markdown files            │
                 │              │                 │
       One-pager generation     Search / reads    │
       [mechanism unknown]      [on demand]       │
                 │              │                 │
                 └──────────────┴─────────────────┤
Identity profile + todo index + compaction recap ─┤

                                            Agent's answer
Caveat
We reconstructed this by a lot of probing with questions, navigating through general assumptions and then trying to verify them. Most of it should be correct, but because I haven't seen their code, some things may be wrong.

Apart from the files, Instinct has about 4,250 tokens of somewhat of a "profile" and ~10k tokens of compacted conversation context (which, obviously, depends on the conversation).

So let's start there.

Block Reported contents Reported size / timing
Identity profile Name, timezone, account email Tiny; no timestamp
Memory one-pager Life context, autonomy calibration, channel communication style ~4,250 tokens; labeled derived from filesystem memory and updated daily; no generation timestamp
Active todos IDs, owner markers, titles; details require todo tools ~25 pending and 7 in progress in this snapshot; no timestamps
Compaction recap Conversation anchors, open loops, exact identifiers, completed work ~8,750 tokens; this instance covered September 19; labeled written by the agent at compaction
Session identifier Current chat-session identifier One identifier

Profile and memory one-pager

A profile is essentially a gist of what the model always needs to know about the user. Instinct's profile has:

  • Life context: a summary of selected user circumstances and relevant people or work.
  • Autonomy calibration: selected preferences about when the assistant should act or ask.
  • Channel communication style: selected preferences about how to communicate.

These are the "headers" that Instinct sees.

PS: supermemory has profiles built in — see user profiles — and has the same learnings. We split it into static and dynamic parts of the profile.

How are these profiles formed?

The best-supported reconstruction I could find is a derived summary of saved records. We do not know whether the generator reads all files, changed files, search results, earlier summaries, or independently stored facts. The generator (or dreaming, or learning) model, prompt, scheduling, conflict handling and response to forget requests all remain unknown.

A complete one-pager backing file was not found in the agent's accessible copy; that does not establish where it is actually stored. So this profile is likely not a file, but just an ad-hoc created cache of sorts.

This profile is also not kept very fresh. In some cases I was able to find a 2-day profile lag, but because there are dates in it, the agent is able to assume that it's not fully trustable.

In supermemory, the profiles are formed automatically and always kept fresh.

The files and folders

Now let's come to the file structure that Instinct uses. In my few days of using it, here's the file structure it came up with:

Location Contents
entities/people/ People and their relationships
entities/orgs/ Organizations
knowledge/facts/ Durable facts
knowledge/preferences/ User preferences
knowledge/decisions/ Decisions and their context
comms/phone/ Conversation digests
timeline/daily/ Daily event summaries
timeline/weekly/ Weekly summaries
workstreams/active/ Ongoing work
workstreams/completed/ Completed work

I was able to find a lot of redundant, stale or duplicate information, but that likely just helps the agent find the answer better.

Instinct reported that commit 899f88a added the preference to a communications digest, daily timeline and dining note. The README described raw, hourly and monthly timeline tiers, but those directories were absent from its accessible copy.

File structures

Files reportedly use structured headers followed by prose and bullets. This is an illustrative example:

---
id: dining
type: preference
aliases: [food, lunch, restaurants, takeout, delivery, dining]
---
- **Pasta:** Loves pasta; stated on 2026-09-15.
- Related context: [[related-record-id]]

A few things stand out from the file structure:

  • Files have names, but also IDs.
  • There are about 4 types in my account: preference, person, organization and conversation.
  • Information itself is in the form of a list of facts, despite it being in a file.
  • [[links]] connect related files, by ID.

So yes, it's a densely interconnected set of files, and the links make it graph-like.

Aliases are included — we'll get to why in the harness-specific stuff later.

Creating, updating, organizing info

It seems like the reconciliation commits do more than just append information:

  • Move temporary details into workstreams.
  • Shorten durable records while linking to fuller notes.
  • Turn examples into broader traits.
  • Remove incidental details.
  • Replace incorrect facts with dated corrections.
Revision Reported change
c12e56c Moved pending transfer detail from a person record to a workstream
59b7f36 Compressed narrative and generalized a behavioral example
61fb47e Replaced literal one-time codes with generic wording
7e9e1c2 Replaced a travel-fee claim with corrective wording

Versioning

Old information can remain in git history. It can also remain in a dated note even after a current fact file changes. This info can only be brought back if the model explicitly looks for older versions.

supermemory's ingestion works in a similar way, and is done by a specialized model. We also automatically include old versions, so the model doesn't have to look for them.

Forgetting

Instinct does forget things based on when the ingestion runs, but this is not "automatic" right now.

So an explicit "this is not happening" will be forgotten, but "I have my exams this weekend" will remain in the records, unless the model looks at it and chooses to remove it.

supermemory has forgetfulness embedded into the system, so things automatically forget and evolve instead of an agent having to do it.

When does ingestion even happen?

Right now the ingestion works once every 24 hours. I'm assuming this because a preference took approximately 23 hours 16 minutes from message to reported commit. By the way, if you text Instinct too much in 24 hours it will quite literally tell you to come back tomorrow, since you can't compact beyond a certain token threshold.

So it's likely a cron job running every day to maintain the set of files and edit the current ones.

Harness: bringing memory to the agent

Ok, so now we know how Instinct arranges the files. But how is the agent actually using this info?

Instinct quite literally just uses keyword matching / grep-style queries to look things up in the file system. This is why every file has aliases associated, so that every file has a good chance of showing up when the agent is looking for it.

I found out by running multiple different queries in different ways.

Query Reported result
pasta Dining ranked first
Italian noodles I enjoy No hits at limits 5 and 50
takeout Dining ranked first
pazta No hits
Known person's name, my gf, romantic partner Same person ranked first
Person's name with an extra character Same person ranked first

Full structure

Instinct seems to be using bash-like tools to do grep, list and inspect git, plus a few tools to manage its todo list.

  1. At the start of the conversation, a profile is injected.
  2. Instinct makes use of the tools available to look up more information. A part of the profile is an index for the available things.

Memory is read-only, at least for the agent.

This is something I'm personally a big believer in. A background process does the work of combining things, not the main agent.

Performance of Instinct's memory

It's hard to benchmark from the agent surface, but here's my vibe-test rubric for Instinct's memory:

Capability Verdict
Single-fact recall
Multi-hop across sessions Weak ☑️
Temporal / recency
Update & contradiction
Abstention
Forgetting / decay Partial — automatic forgetting missing, pruning present
Performance at >1M tokens or months Untested, but good vibes ☑️
Procedural / skill memory ❌ Not present — none of the memories we could find were directional
Test-time learning ✅ Corrected behavior within conversation; durable learning unverified
Implicit personalization ❌ "Buy me a monitor" should know I'm a founder with a new office, and suggest premium choices
Explicit personalization
Multimodal ❌ Weak — "you know how my room looks, what colored blankets should I buy?"
Write-side cost ☑️ Likely expensive, but untestable

On write-side cost: we know writes will get exponentially more expensive for the agent to work through, as it has to read through current info to write more info, and consolidate and manage things. This should be fine for the personal agent use case, but we're not sure yet.

Overall: capable under explicit retrieval instructions, inconsistent in natural personalization, with forgetting guarantees unresolved.

Really, really good.

Implementing it with supermemory

There are some benefits to using supermemory here, and it is actually super obvious to implement.

  1. Buckets for entities and relationships. supermemory supports profile buckets. Each user can get their own set of buckets, which is dynamic. This is like having a folder of info that the LLM can access — see profile buckets.
  2. Profile at the start of the conversation. supermemory has a profile system built in, so that would be included at the start.
  3. Search tools. Give the agent search tools, with a few specific options like including forgotten memories and history, in case it needs those — see search memory entries.
  4. Ingest every 1-day conversation. An Instinct-like interface would run memories.add() every turn, with the current day being the ID of the conversation. supermemory's ingestion automatically handles forgetfulness, reconciliation and conflict resolution — see dreaming keeps the graph alive. It also automatically handles multi-modal ingestion.

supermemory is specialized towards memory, so it is much cheaper to run and much faster, while being fully composable at the same time. Instead of git, we have our own versioning system that's embedded with our data structure. Instead of full files, we construct files on demand, which also makes sure that info is always fresh.

Below is the full Instinct memory system, in supermemory, working almost exactly like Instinct. Just 60 lines of code.

import { streamText, tool } from "ai";
import { openai } from "@ai-sdk/openai";
import { withSupermemory, searchMemoriesTool, addMemoryTool } from "@supermemory/tools/ai-sdk";
import { z } from "zod";

const API_KEY = process.env.SUPERMEMORY_API_KEY!;
const userId = "user_alex";                            // containerTag — stable per user
const todayId = new Date().toISOString().slice(0, 10); // e.g. "2026-09-20"

// 1. Profile injected automatically at the start of every turn (static + dynamic + buckets)
const model = withSupermemory(openai("gpt-5"), {
  containerTag: userId,
  customId: todayId, // one document per day -> ingest every 1-day conversation
  mode: "full",      // profile + query search
});

// 2. Dynamic bucket tools: list existing buckets, create new ones on the fly
const listBucketsTool = tool({
  description: "List the profile buckets configured for this user",
  inputSchema: z.object({}),
  execute: async () => {
    const res = await fetch("https://api.supermemory.ai/v4/profile/buckets", {
      method: "POST",
      headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
      body: JSON.stringify({ containerTag: userId }),
    });
    return res.json(); // { buckets: [{ key, description }, ...] }
  },
});

const createBucketTool = tool({
  description: "Create or add a new topical bucket for this user's profile (space-level, additive)",
  inputSchema: z.object({
    key: z.string().describe("lowercase slug, letters/digits/-/_ only"),
    description: z.string().optional(),
  }),
  execute: async ({ key, description }) => {
    const res = await fetch(`https://api.supermemory.ai/v3/container-tags/${userId}`, {
      method: "PATCH",
      headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
      body: JSON.stringify({ profileBuckets: [{ key, description }] }),
    });
    return res.json();
  },
});

// 3. Search tool with forgotten/history options exposed to the agent
const searchTool = searchMemoriesTool(API_KEY, {
  containerTag: userId,
  // lets the agent opt into forgotten memories / relationship history when needed
});

const result = await streamText({
  model,
  prompt: "What buckets do we have for me, and what's changed recently?",
  tools: {
    listBuckets: listBucketsTool,
    createBucket: createBucketTool,
    searchMemories: searchTool,
    addMemory: addMemoryTool(API_KEY, { containerTag: userId }),
  },
});

So yes — that's how Instinct's memory works, and how you can implement Instinct's memory system with supermemory completely.

  1. An update to supermemoryWe've discontinued the supermemory company brain and Nova. Everyone who was charged has been refunded, our MCP and plugins continue to run, and we're going all in on the memory engine.
  2. Scaling Conversations: How Adapta Grew Usage Without Losing ContextAdapta added Supermemory as a persistent memory layer so every conversation keeps its context — letting the team scale usage without losing the thread.
  3. How Chatarmin Ditched RAG and Went Memory-Only with SupermemoryChatarmin replaced a heavy RAG pipeline with Supermemory's memory layer — cutting average AI response time from 40s to 12s and token usage by 40–50%.
  4. SMFS: making agentic retrieval 55% cheaper AND more accurateWe launched SMFS.ai (Supermemory Filesystem) a few weeks ago, with a simple bet: We can redesign the filesystem specifically for agents, with special files, structures, and commands that it can use for it's tasks. Today, SMFS is used by hundreds of companies to power their agents.
  5. Introducing Dynamic Dreaming: supermemory now connects the dots, for you.Dreaming is magical. TLDR: We're launching Dynamic Dreaming in supermemory today, which automatically works if you're using supermemory in any way - API, OpenClaw, Hermes agent, etc.
  6. Dear reader, we just made supermemory insanely cheap... the Context CloudWhen I first started building supermemory, I had one goal: To build the best memory system for AI. I would talk to customers, and find out that memory was not the only thing they needed - They were all setting up 7-8 different vendors at the same time.
  7. Introducing @supermemory/tools v2.0.0Today we're releasing v2.0.0. This release unifies the API across all agents sdk integrations from AI SDK to Mastra, makes conversation identity a first-class concept, and ships with memory saving on by default.
  8. Solving the Precision-Recall Tradeoff: Search Result AggregationWhen you're building memory for AI, search is your foundational layer. The way search generally works is straightforward: the user defines a query, and then sets a limit (top-K) on how many search results they want returned. Usually, this is set to 10 or 20.
  9. OpenClaw Memory Problems: Why It Forgets and How to Fix It (2026)TLDR: Today, we are releasing a new version of our openclaw plugin - https://github.com/supermemoryai/openclaw-supermemory. This post is going to be a bit technical, so bear with me (or bookmark for later!) In this post, I will talk about what we do about OpenClaw memory, and how we fix it.
  10. Stateful Coding Agents with Memory: Build Long-Running Agents (2026)We built a plugin for Claude Code and OpenCode that gives your coding agent persistent memory. It remembers your preferences, learns your codebase, and never loses context mid-conversation. The result is an agent you can run for months without starting over.
  11. Clawd / Molt bot's memory SUCKS. We gave it supermemory.I'm the founder of supermemory. Clawd/Molt bot is blowing up right now, with many, many use cases. I set it up, too, and have been using it through telegram. TLDR: just go to https://supermemory.ai/docs/integrations/clawdbot to set up supermemory for your clawd bot.
  12. Catch up with our UNFORGETTABLE Launch WeekOver the last year, one belief has guided almost everything we’ve built at Supermemory AI becomes meaningfully useful only when it remembers. Memory shouldn’t be something developers rebuild from scratch. It shouldn’t be fragile, expensive, or trapped inside a single tool.
  13. Empowering the Next Generation of Founders: Supermemory Startup ProgramIf there’s one thing we’ve learned while building Supermemory, it’s that most startups don’t fail because they didn't build features; they fail when infrastructure slows them down, or they built too slow.
  14. Building code-chunk: AST Aware Code ChunkingAt Supermemory, we're building context engineering infrastructure for AI. A huge part of that is dealing with code: ingesting repos, understanding structure, and making it searchable. The problem is that most code chunking solutions are terrible. We built code-chunk to fix this.
  15. Supermemory raises $3 million with the best memory engine for LLMsToday, I am excited to announce our first funding round to accelerate our mission of building an interoperable, scalable and reliable memory for LLMs and agents. Memory is one of the hardest challenges in AI right now.
  16. Mem0 vs Supermemory: Why Scira SwitchedScira AI moved its production memory layer from Mem0 to Supermemory. This is what failed, what improved, and how the team evaluated the two systems.
  17. Never Record Again: How Montra Uses Supermemory to Rethink Video CreationCampbell Baron, the founder of Montra, has been making videos since he was twelve. By thirteen, he was already doing brand work. Today, he’s betting on a very different future for creators: a world where recording is the exception, and most videos are generated from scratch.
  18. Unified Memory That Works Where You Work: Your Second Brain With SupermemoryHi everyone, I’m Dhravya, the founder of Supermemory. I want to start with a little story behind why this product means so much to me. You can also skip straight to what it is and how it works below.
  19. Supermemory just got faster on PlanetScaleWhat is Supermemory? Supermemory completes the missing part of the LLM puzzle: memory. Just as memory is crucial for human intelligence, it's essential for truly intelligent AI systems.
  20. Faster, smarter, reliable infinite chat: Supermemory IS context engineering.People are obsessed with prompts and prompt engineering. Sure, what you say is important, but what the model knows when you say it is the difference between a stateless text generator and an intelligent AI system. In short, context is the most crucial component.
  21. We solved AI API interoperabilityOne API to rule them all, One spec to find them, One library to bring them all and in the TypeScript, bind them. When we were building the the Infinite Chat API, initially, we only supported the OpenAI format. This was fine, until a lot of our customers started asking, asking for more.
  22. The Wow Factor of Memory - How Flow Used Supermemory To Build Smarter, Stickier ProductsOverview: Flow is a note-taking app built around a bold vision: to create a more personal, context-aware writing experience powered by AI. At the heart of this mission is memory.
  23. The UX and technicalities of awesome MCPsLast month, we launched the Supermemory MCP, mostly to test our own infrastructure and get some initial traction. It blew up. To my absolute surprise, the initial launch itself got half a million impressions (!!!). Then, we launched and got #2 on ProductHunt too.
  24. Architecting a memory engine inspired by the human brainLanguage is at the heart of intelligence, but what truly powers meaningful interaction is memory — the ability to accumulate, recall, and contextualize information over time. Large Language Models (LLMs) have mastered language, but memory remains their Achilles’ heel.