Stop searching the internet for problems you've already solved.
MEM is a terminal-native "second brain" that indexes your technical life. It captures your terminal sessions, configuration snippets, and project notes, making them instantly searchable through local, private AI.
mem ask(The Magic): Search your experience using natural language. Ask "how did I fix the nginx 502 error last year?" and get the exact steps.mem watch(Zero Effort): Record your terminal session. Solve a problem, then usemem rememberto turn your command history into a searchable recipe.mem save: Instantly store code snippets, one-liners, or architecture notes.- CLI-First: Built for developers who live in the terminal. No context-switching to heavy GUI apps.
Traditional tools like grep fail if you don't remember the exact words. MEM uses Semantic Search: it understands the intent behind your query. A search for "deployment" will find a note titled "Server Setup".
Everything stays on your machine. MEM uses Local Vector Embeddings and a Local LLM to process your data. Your proprietary code and private server configs never touch the cloud.
- Embeddings: Your data is converted into high-dimensional vectors (mathematical representations of meaning) using a local model.
- Semantic Retrieval: When you ask a question, MEM finds the most mathematically similar "memories" in your local database.
- Local Synthesis: A local LLM reads those memories and provides a concise, relevant answer based solely on your experience.
# Save a specific setup sequence
mem save "Postgres Replication Setup" -c "apt install postgresql-15; sed -i 's/wal_level = replica/wal_level = logical/' /etc/postgresql/15/main/postgresql.conf"
# Find it 6 months later
mem ask "how did I enable logical replication?"# Save that 3-line find/xargs combo
mem save "delete all empty directories" -c "find . -type d -empty -delete"
# Recall it instantly
mem ask "how to clean empty folders?"# Record your flow while fixing a bug
mem watch
# $ ssh production-server
# $ journalctl -u api-service -n 100
# $ systemctl restart api-service
mem remember "restart api-service on prod"
# Later, ask how you handled the crash
mem ask "how did I fix the api-service crash?"Requirements: Go 1.26+, a C toolchain (LanceDB is linked via cgo), and Ollama running locally.
ollama pull nomic-embed-text # embeddings (required)
ollama pull llama3.2 # answers for `mem ask --answer` (optional)
make build # downloads LanceDB native libs on first run
./mem --helpData lives in ~/.mem/ (mem.db for SQLite, vectors/ for LanceDB, sessions/ for mem watch).
| Command | What it does |
|---|---|
mem save "title" -c "cmd" [-c ...] [-t tag] [-d "description"] |
Save commands/notes as a memory |
mem ask "question" [-n 5] [--min-score 0.4] [--answer] [--llm llama3.2] |
Semantic search. Each result shows its similarity (0–1); weak matches and ones far behind the best are hidden (--min-score 0 shows everything). --answer also asks a local LLM to summarize the results |
mem watch [--shell bash|zsh] |
Start a recorded subshell; every command is logged until exit |
mem remember "title" [-t tag] [-d "..."] [-n N] |
Turn the recorded session (or its last N commands) into a memory. Works inside the watched shell too |
mem list [-t tag] [-n 20] |
List recent memories |
mem show <id> / mem delete <id> |
Inspect or remove a memory |
mem reindex [--all] [--model name] |
Embed memories saved while Ollama was down, rebuild the index, or switch embedding model |
Commands starting with a space are not recorded by mem watch if your shell ignores them for history (HISTCONTROL=ignorespace in bash, setopt HIST_IGNORE_SPACE in zsh).
# Save your first command
mem save "list files by size" -c "ls -lhS"
# Ask your past self
mem ask "how to list large files?"
ls -lhS # list files by size MEM grows with you. One week in, it's a notebook. One year in, it's your most valuable asset.