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

Published: (March 2, 2026 at 05:29 PM EST)
3 min read
Source: Dev.to

Source: Dev.to

Introduction

Every AI session starts cold. When you open Claude, ChatGPT, or Gemini you often have to re‑explain the same preferences:

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

Doing this in every session quickly becomes tedious.

Installation

pip install recall

Core Commands

Store a memory

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

Each call appends a JSON line to ~/.recall/memories.jsonl.

Inject memories

# Copy a Markdown block to the clipboard (for any AI chat)
recall inject

# Write the block to a file for Claude Code
recall inject --target claude

The injected Markdown looks like:

## 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

You can paste the clipboard content into ChatGPT, Gemini, or any other AI interface, or let Claude read ~/.recall/injected.md automatically.

List, search, and delete

recall list                     # Show all memories with IDs
recall search "python"          # Find memories containing a keyword
recall forget 3                 # Delete memory with ID 3

Storage Format

Memories are stored as plain JSON Lines, human‑readable and portable:

{"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": []}

Back them up with a simple copy command, e.g., cp -r ~/.recall ~/backup/recall.

Smart Ranking with Anthropic

If the environment variable ANTHROPIC_API_KEY is set, recall inject will:

  1. Read the current directory name and recent Git commits to infer context.
  2. Send your memories + context to Claude Haiku.
  3. Receive the 8 most relevant memories, which are then injected.
export ANTHROPIC_API_KEY=sk-ant-...
recall inject   # → 8 most relevant memories, ranked by Haiku

Without a key, all stored memories are injected (suitable for a small set of 10–20 items).

Comparison

FeaturerecallOpenAI ChatGPT memory
LocationLocal (~/.recall/)Cloud‑based
TransparencyPlain JSONL, editable with any editorOpaque
Tool‑agnosticWorks with Claude, ChatGPT, Gemini, Cursor, etc.Limited to ChatGPT
RankingOptional BYOK (Anthropic)Built‑in but not user‑controllable
PortabilitySimple cp backupTied to OpenAI account

Usage with Claude Code

Add a line to your global Claude configuration (~/.claude/CLAUDE.md):

See: ~/.recall/injected.md

Run once:

recall inject --target claude

Now every Claude Code session starts with your preferences already loaded—no manual paste required.

Contributing

Source:

Pull requests are welcome, especially for:

  • Tag‑based filtering
  • Integrations with additional AI tools

Call to Action

What preferences do you find yourself re‑explaining to AI each session? Drop them in the comments, and I’ll add them to my own recall list.

0 views
Back to Blog

Related posts

Read more »

Google Gemini Writing Challenge

What I Built - Where Gemini fit in - Used Gemini’s multimodal capabilities to let users upload screenshots of notes, diagrams, or code snippets. - Gemini gener...