Configure
Who writes your notes
A model service turns what your agent did into short notes. This is separate from the agent you work in: you can use one agent and a different service to write its notes. Choose the service once and MemIndex keeps using it.
Your choices
| Service | MEMINDEX_PROVIDER |
You need | Default model |
|---|---|---|---|
| Your Anthropic plan or API key | claude |
A Claude Code sign-in, or an API key | haiku (the current Haiku model) |
| Your Codex account | codex |
The Codex command, signed in with ChatGPT | Codex's own default |
| Gemini | gemini |
A Gemini API key | gemini-flash-latest |
| OpenRouter | openrouter |
An OpenRouter API key | cohere/north-mini-code:free |
| Another OpenAI-compatible service | openai-compatible |
An address, a model, and usually a key | The preset's model |
| MemIndex hosting | host (installer flag) |
A hosting plan | Set by hosting |
Each service uses its own allowance or charges its own rates. Using your plan shares its usage with your own work.
Pick one
The installer asks. To skip the question, name it:
npx memindex install --provider claude
npx memindex install --provider codex
npx memindex install --provider gemini
npx memindex install --provider openrouter
To change later, open the viewer's Settings, or edit ~/.memindex/settings.json and restart with npx memindex restart. A change takes effect for the next session of notes; work already running finishes on the old service.
If the service you chose has no key, MemIndex quietly uses Claude instead. Run npx memindex doctor and read the Note writer row: it fails when the chosen writer cannot work and says why, without sending any request.
Set up each one
Anthropic plan. Nothing to add if you are signed in to Claude Code. If the sign-in keeps expiring, run claude setup-token and put the token in ~/.memindex/.env as CLAUDE_CODE_OAUTH_TOKEN=<token>. For an API key, put ANTHROPIC_API_KEY=<key> in the same file. MEMINDEX_MODEL changes the model.
Codex. Run codex login, then:
npx memindex install --provider codex --runtime worker
Gemini. Set MEMINDEX_GEMINI_API_KEY, and MEMINDEX_GEMINI_MODEL if you want a model other than the default.
OpenRouter. Set MEMINDEX_OPENROUTER_API_KEY and MEMINDEX_OPENROUTER_MODEL. MemIndex turns reasoning off for these requests by default so a thinking model cannot spend the whole reply and leave no note.
OpenAI-compatible. Set MEMINDEX_PROVIDER to openai-compatible, then MEMINDEX_OPENAI_COMPAT_API_KEY, and either MEMINDEX_OPENAI_COMPAT_PRESET (nvidia-nim, deepseek, groq, together, vllm, ollama or lmstudio) or your own MEMINDEX_OPENAI_COMPAT_BASE_URL and MEMINDEX_OPENAI_COMPAT_MODEL. A service running on your own computer does not need a key.
Keys belong in settings.json or .env in your memory folder. Keep both private.
Different writers for different agents
MEMINDEX_PROVIDER_BY_SOURCE picks the writer for each agent. For example, to write Codex sessions with Codex and Claude Code sessions with Claude:
{
"MEMINDEX_PROVIDER_BY_SOURCE": "{\"codex\":\"codex\",\"claude\":\"claude\"}"
}
An agent that is not listed uses MEMINDEX_PROVIDER.
What leaves your computer
Only the service you chose sees your activity, to write notes under its own terms. Private tags and secret filtering run before anything is sent. See Privacy.
Every provider setting and its default is in Settings.