DEV Community

Lakshmi Sravya Vedantham
Lakshmi Sravya Vedantham

Posted on

I built a local memory layer for any LLM — stores your preferences, injects them into every session

Every AI session starts cold.

You open Claude, ChatGPT, or Gemini and immediately start re-explaining the same things:

  • "I prefer Python over JavaScript"
  • "I always use type hints"
  • "For this project, JWT not sessions"
  • "Keep commits short and imperative"

Every. Single. Session.

So I built recall.

pip install recall

recall remember "I prefer Python over JavaScript"
recall remember "Always use type hints"
recall remember "JWT for auth in synaptiq, not sessions"

recall inject                         # → clipboard, paste into any AI chat
recall inject --target claude         # → ~/.recall/injected.md for Claude Code
Enter fullscreen mode Exit fullscreen mode

How it works

Store: recall remember "text" appends to ~/.recall/memories.jsonl. Plain JSON lines. Human-readable. No database.

Rank: recall inject reads your current directory name and recent git commits to understand context. If ANTHROPIC_API_KEY is set, it sends your memories + context to claude-haiku and gets back the 8 most relevant. No key? It injects all of them.

Inject: The output is a clean Markdown block:

## My preferences and decisions
- I prefer Python over JavaScript
- Always use type hints
- JWT for auth in synaptiq, not sessions
- Short commit messages, imperative mood
Enter fullscreen mode Exit fullscreen mode

Clipboard for ChatGPT, Gemini, or any AI chat. Or written to ~/.recall/injected.md for Claude Code.

Claude Code integration

Add one line to your global ~/.claude/CLAUDE.md:

See: ~/.recall/injected.md
Enter fullscreen mode Exit fullscreen mode

Run recall inject --target claude once. Now every Claude Code session opens with your preferences already loaded. No paste. No re-explaining.

Smart ranking with ANTHROPIC_API_KEY

Without a key, all memories are injected. That's fine for 10-20 memories.

With a key, Claude Haiku reads your current directory and recent git commits, then picks the 8 most relevant memories for right now. Working on a Next.js project? It surfaces the frontend preferences. Debugging auth? It surfaces the JWT decision.

export ANTHROPIC_API_KEY=sk-ant-...
recall inject  # → 8 most relevant memories, ranked by Haiku
Enter fullscreen mode Exit fullscreen mode

What it stores

~/.recall/memories.jsonl
Enter fullscreen mode Exit fullscreen mode
{"id": 1, "text": "I prefer Python over JavaScript", "created_at": "2026-03-02T10:00:00+00:00", "tags": []}
{"id": 2, "text": "Always use type hints", "created_at": "2026-03-02T10:01:00+00:00", "tags": []}
Enter fullscreen mode Exit fullscreen mode

Plain text. Trivially portable. Back it up with one cp command.

The full CLI

recall remember "text"          # store a memory
recall list                     # show all memories with IDs
recall search "python"          # search by keyword
recall forget 3                 # delete by ID
recall inject                   # → clipboard
recall inject --target claude   # → ~/.recall/injected.md
Enter fullscreen mode Exit fullscreen mode

Why local-first matters

OpenAI has memory in ChatGPT. It's cloud-based, opaque, and only works in ChatGPT.

recall is:

  • Local~/.recall/ is yours, always
  • Universal — works with Claude, ChatGPT, Gemini, Cursor, anything
  • Transparent — plain JSONL, edit it with any text editor
  • BYOK — bring your own Anthropic key for smart ranking, or don't

Try it

pip install recall

recall remember "I prefer Python over JavaScript"
recall remember "Always use type hints"
recall inject
Enter fullscreen mode Exit fullscreen mode

Source: github.com/LakshmiSravyaVedantham/recall

PRs welcome — especially for tag-based filtering and integrations with other AI tools.


What preferences do you re-explain to AI every session? Drop them in the comments — I'll add them to my own recall list.

Top comments (0)