Semantic Memory for AI Assistants

Semantic Memory for AI Assistants

December 2025. Managing dozens of projects with AI assistants. Context kept vanishing between sessions. Built semantic memory to fix it.

Every time Claude started a new session in a different project, it was blank. "What did we decide about X?" No idea. "Where's that research from last week?" Gone.

Grep doesn't work when you can't remember exact words. Tags help but you have to remember to search for them. I needed semantic search - find documents by meaning, not keywords.

Built mem-cli - command-line tool backed by PostgreSQL with pgvector. Uses multilingual-e5-small embeddings. Simple interface: mem search "query" finds documents by semantic similarity. mem add "content" "tags" stores them. mem bytag worklog pulls everything tagged as a worklog.

Project binding solved the categorization problem. Every project gets a MEMORY.md file with a unique GUID. When you're working in that directory, documents automatically link to that project context. No manual categorization. No folder hierarchies. Just mem register "what I did" "type:worklog,date:2025-12-30".

Deployed December 28-30. Already have 600+ documents indexed. Used daily by AI agents across multiple projects. Zero-friction operations - single command for search, add, recent, bytag.

Tag system adds structure without complexity. Type tags like worklog, decision, research. Date tags for chronological retrieval. Combined with semantic search, you can be vague ("that thing about webhooks last month") and it finds the right documents.

Not perfect. Sometimes semantic search misses obvious keyword matches. Tag discipline varies between projects. Query quality matters - garbage in, garbage out.

But it solved the core problem. AI assistants now have persistent, searchable memory across projects and sessions. When I open a project, mem find shows the entire history. When I need research from weeks ago, mem search "topic" surfaces it even if I misremembered the details.

Built for AI assistants, not humans. Semantic search works better than grep for vague queries. CLI is fast enough for daily use. Project markers solve the "what was I doing here" problem without manual organization.

← Back to blog