memi
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@memiremember I prefer tabs over spaces as a global preference"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
memi
Local-first memory for AI agents. Memories live in one SQLite file on your machine, and agents reach them through an MCP server.
AI agents forget everything when a session ends. memi gives them somewhere to keep the things worth remembering: decisions and why they were made, how you like things done, mistakes not to repeat. The next session can search that instead of asking you the same questions again.
What it does
Stores memories in a single SQLite file, with no server to run and no account to make
Finds them by meaning and by keyword, using local embeddings from Ollama or OpenAI
Keeps global memories (about you, across every project) apart from project memories (about one codebase)
Lets you mark memories as important, pin the ones that must always be loaded, and sort them into categories
Runs as an MCP server, so any client that speaks MCP can use it
Comes with a CLI, a small local web UI for browsing and editing, and agent skills that teach an agent when to save and recall
Related MCP server: engram-mcp
Install
You need:
Node.js 22 or newer
One embedder: Ollama (runs locally) or an OpenAI API key
Install it globally to get a memi command:
npm install -g @pinkpixel/memiOr skip the install and let npx fetch it when it's needed. That's what the MCP setup below does:
npx -y @pinkpixel/memi doctorThe examples below say memi. If you didn't install globally, use npx -y @pinkpixel/memi in its place. To build it from source instead, see Development.
Quick start
The default embedder is Ollama with nomic-embed-text, so pull that first:
ollama pull nomic-embed-textCheck that everything is wired up:
memi doctorSave a few things, then search for them in different words:
memi add "I prefer tabs over spaces" --global --category preference
memi add "Deploys go through GitHub Actions to Cloudflare" --category fact
memi add "Keep answers short, with no summary at the end" --global --category preference
memi search "indentation style"
memi search "how do we ship releases"Neither search shares a word with the memory it finds. That's the embeddings at work. (The second memory has no --global, so it belongs to whichever project you ran the command in.)
If you'd rather use OpenAI:
export OPENAI_API_KEY=sk-...
memi config set embedder.provider openaiKeep in mind that memory text gets sent to OpenAI to be embedded when you do this.
Connect it to your agent
Claude Code
claude mcp add memi -s user -e MEMI_AGENT=claude -- npx -y @pinkpixel/memi serve
claude mcp list-s user makes memi available in every project, which is usually what you want for a memory. MEMI_AGENT is optional (more on that below).
The first start downloads the package, which takes a few seconds. After that npx reuses its cache, so starts are quick, and that cache can hold on to an older version. Use @pinkpixel/memi@latest in the command to always get the newest one. If you installed globally, you can use memi serve as the command instead, which starts fastest.
Other clients
Anything that can launch a stdio MCP server needs a command, its arguments, and optionally some environment variables. In the common mcpServers format:
{
"mcpServers": {
"memi": {
"command": "npx",
"args": ["-y", "@pinkpixel/memi", "serve"],
"env": { "MEMI_AGENT": "my-agent" }
}
}
}Restart the client after editing its config. I've only tested this with Claude Code so far, but other clients should work the same way.
What the agent gets
Tool | What it does |
| Loads the pinned and high-importance memories at the start of a session |
| Searches by meaning and keyword |
| Saves a memory, and points out similar ones that already exist |
| Changes a memory, or moves it between global and a project |
| Deletes a memory |
| Browses without a search query |
| Lists categories with counts |
Install the skills
The tools alone don't tell an agent when to use them, so there are three skills in skills/:
Skill | What it covers |
| The everyday habit: load context first, recall before deciding, save what's worth keeping, and never save secrets |
| Cleaning up a messy store. It proposes changes and waits for your approval before deleting anything |
| Installing, connecting, switching embedders, and reading |
They ship inside the package. Copy or symlink the folders into your client's skills directory. For Claude Code that's ~/.claude/skills/, and with a global install it looks like this:
ln -s "$(npm root -g)/@pinkpixel/memi/skills/"* ~/.claude/skills/Without a global install, grab the skills folder from the repo instead.
The CLI
Command | What it does |
| Save a memory. Options: |
| Search. Options: |
| Browse and filter. Same filters as search, plus |
| Change a memory: |
| Delete one. Asks first, or pass |
| List categories with counts |
| Show settings. |
| Rebuild the vector index. Asks first, or pass |
| Check the database, the embedder, the index, and project detection |
| Start the local web UI |
| Run the MCP server |
Known errors print one line starting with memi: and exit with code 1. Commands that need a confirmation won't guess when there's no terminal to ask in. Pass --yes in scripts.
The local UI
memi ui --openThis serves a small memory manager at http://localhost:4747. You can search, filter by scope, category, and importance, add and edit memories, pin them, and delete them. Deleting always asks first.
A few keys help: / jumps to search, n starts a new memory, Esc closes whatever is open, and Ctrl+Enter saves. It works on a phone-sized screen too.
It only listens on your own machine, and it ignores requests that don't come from localhost, since it can delete things. Pick another port with --port, or memi config set ui.port <n>.
Projects, scopes, and the agent name
Every memory is either global or belongs to one project. memi works out the project in this order:
A name you pass (
--project, or theprojectargument of a tool)The
MEMI_PROJECTenvironment variableThe folder name of the git repo you're in
The agent name, stored as
agent:<name>
That fourth one is for folders with no git repo. Set it with memi config set agent <name> or MEMI_AGENT. The agent name is also recorded on each memory, so you can see who wrote what.
With none of those, project memories can't be saved, and the error says what to set. Global memories always work.
One thing to know: the git check uses the folder name only. Two repos with the same folder name share a project. Pass an explicit project name if that bites you.
Embeddings
Provider | Default model | What you need |
|
| Ollama running, with the model pulled |
|
|
|
memi config # what's in effect right now
memi config set embedder.provider openai
memi config set embedder.model text-embedding-3-small
memi config set embedder.baseUrl http://localhost:11434The API key is only ever read from the environment. memi never writes it to a file.
Switching embedders
Different models make vectors of different sizes, so the vectors you already have can't be reused. When you change the embedder, memi notices and turns semantic search off, with a warning. Keyword search keeps working, and nothing is deleted.
To finish the switch:
memi reindexThat drops the vector table, rebuilds it for the new model, and re-embeds every saved memory. Your memories are kept. It asks before it starts. The embedding happens before anything is dropped, so if the new embedder isn't reachable, nothing changes. If you switch back to the original model, you don't need to reindex at all.
If a memory was saved while the embedder was down, it's still saved. It just has no vector yet. memi reindex --missing fills those in without dropping anything.
Configuration
Settings come from ~/.memi/config.json, and environment variables override them.
Setting | Config key | Environment variable |
Embedder |
|
|
Model |
|
|
Embedder URL |
|
|
Agent name |
|
|
UI port |
| none |
Force a project | none |
|
Data folder | none |
|
OpenAI key | none |
|
Setting embedder.provider clears the saved model and URL, so the new provider starts from its own defaults.
Where your data lives
Database:
~/.memi/memi.dbConfig:
~/.memi/config.json
Set MEMI_HOME to move both. SQLite runs in WAL mode, so you'll see memi.db-wal and memi.db-shm next to the database while memi is running. To back up, copy all three files while nothing is using the database, or run sqlite3 ~/.memi/memi.db ".backup backup.db".
How search works
Searches run two ways and merge the results: a keyword search (SQLite FTS5, with stemming) and a vector search (sqlite-vec, cosine distance). The two ranked lists are combined with reciprocal rank fusion. Importance and recency then give a small nudge, small enough that relevance still wins.
If vectors aren't usable, search falls back to keywords and tells you.
Limitations
Only tested on Linux so far
Only tested with Claude Code as the MCP client
Semantic search always returns its nearest matches, even when none of them are really relevant. There's no relevance cutoff yet
Search quality depends on the embedding model.
nomic-embed-textscores are fairly bunched together, so vague queries can rank oddlyTwo git repos with the same folder name share a project
The UI can't run
memi reindexyet. It shows the command to copy instead
Development
To build from source:
git clone https://github.com/pinkpixel-dev/memi.git
cd memi
npm install
npm run buildRun it with node dist/cli/index.js, or point an MCP client at it with an absolute path:
claude mcp add memi -s user -- node /absolute/path/to/memi/dist/cli/index.js serveChecks:
npm run typecheck
npm testThe tests are real ones. The end-to-end tests start the actual CLI and MCP server as child processes, and the UI tests run the real frontend modules against the real API. There are no mocks.
The semantic tests need Ollama running with nomic-embed-text pulled, and skip themselves if it isn't. One test, the embedder switch from 768 to 1024 dimensions, also needs a second model. It defaults to qwen3-embedding:0.6b, and you can use another with MEMI_TEST_ALT_MODEL. Without it, that one test is skipped.
The code is split up like this:
src/core/ storage, search, project detection, embeddings plumbing
src/embed/ Ollama and OpenAI providers
src/mcp/ the MCP server and its tools
src/cli/ the command line
src/ui/ the web UI's server
ui/ the web UI's files (plain HTML, CSS, and JavaScript, no build step)
skills/ the agent skills
tests/License
Apache 2.0. See LICENSE.
Made with 💖 by Pink Pixel
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Universal memory for AI agents and tools. Save, organize and search context anywhere.
Persistent memory for AI agents. Search and store durable facts, preferences and decisions.
Persistent memory for AI agents. Search, store, and recall across sessions.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceProvides persistent local memory functionality for AI assistants, enabling them to store, retrieve, and search contextual information across conversations with SQLite-based full-text search. All data stays private on your machine while dramatically improving context retention and personalized assistance.3-
- AlicenseAqualityCmaintenancePersistent semantic memory for AI agents. SQLite-backed, local-first, zero config. Semantic search via Ollama embeddings with keyword fallback. Tools: remember, recall, history, forget, stats.1737 npm1MIT
- AlicenseNot gradedqualityCmaintenanceGives AI coding agents persistent memory by storing observations, decisions, and learnings in a local SQLite database with vector search, full-text search, and a rules engine.4MIT
- AlicenseAqualityAmaintenanceGives AI agents persistent, local-first memory using SQLite and on-device embeddings, enabling semantic search and recall across sessions with no cloud calls.87MIT