DEV Community

J Jones AI
J Jones AI

Posted on

Your AI models can change. Your memory shouldn't.

Every six months the "best" model changes. GPT, Claude, Llama, Qwen, DeepSeek — the logo on the API key is not the asset.

Your notes, docs, and decisions are.

Most assistant stacks invert that. Your memory gets shipped into whichever frontier model is fashionable this quarter. Switch vendors and you rebuild context from scratch. Cancel a subscription and the "assistant that knew you" forgets you existed.

That is the wrong dependency graph.

Local-first means the memory lives with you

A local-first assistant API keeps the canonical store on your machine (or your VPS):

  • Notes and files stay in a local database you control
  • Search works offline
  • The model is a plugin, not the source of truth
  • Sensitive content can stay redacted until you approve it

Models become interchangeable. Memory does not.

What that looks like in practice (Python + FastAPI)

Here is the shape I teach in Build a Local-First AI Assistant API:

  1. FastAPI service with clear settings and health checks
  2. Local memory store (SQLite) with sensitivity tags and file ingest (Markdown, text, PDF)
  3. Offline search — full-text (FTS5) plus local embeddings, hybrid ranking
  4. /ask against a local model (Ollama by default), with citations and streaming
  5. Human-in-the-loop approval gate — policy decides content vs metadata vs nothing
  6. Provider plugins — local by default; optional cloud behind the same interface
  7. Strict mode — local data + local model only, tested to make zero outbound calls
  8. Ship it — tests, Docker, run as a background service

None of that requires renting your notes to a SaaS "second brain."

Strict / General / Full — modes, not vibes

Prompting "please don't send my data" is not a control plane.

Enforce modes in code:

Mode Data Model
Strict Local only Local only
General Controlled Local or approved cloud
Full Per policy Best available provider

If Strict can still phone home, it is not Strict.

Free outline vs full course

I published a public teaser outline (module titles only) so you can see the map before you buy:

Related: if you also want the hosting side of "own your stack," see Own Your Web (VPS + Caddy + DNS migration) — free outline on GitHub.

Who this is for

Python developers who are comfortable with functions and classes, and who are tired of rebuilding context every time the model carousel spins.

Who this is not for

Anyone looking for a one-click ChatGPT wrapper with no local store and no approval gate.


Support: support@jjones.ai · jjones.ai · malcolm.expert

Education product from Malcolm Frank / FranklySolutions LLC. Adapt everything to your own environment.

Want to promote these courses? Affiliates earn 15% → jjonesai.gumroad.com/affiliates

Top comments (0)