An opinionated memory system for thoughts that keep tugging at you.
Mentat is a local-first CLI app for selectively saving thoughts, links, notes, and research, then returning to them through hybrid search, semantic connections, temporal queries, AI-assisted chat, and constructive reflection across time.
See Mentat in action: Capture, explore, and synthesize from the terminal →
I built Mentat because most knowledge tools do not match how I actually think and work. Tabs pile up, links get bookmarked randomly, podcast notes turn into reminders, and good ideas end up scattered across apps. Highly structured tools can feel like extra work, while loose note dumps become hard to search later.
Mentat is not meant to capture your whole life. It is for the thoughts that keep coming back after the first moment has passed: an idea from a walk, a quote that keeps working on you, a research thread you want to reconnect later, a decision whose context matters, or a messy note that might become clearer after it sits for a few days. Mentat can add tags, entities, summaries, todos, and connections later, so useful structure can emerge without requiring perfect organization up front.
My goal was one terminal and agent-friendly memory system for people who think in multiple modes - sometimes structured, sometimes messy, sometimes searching for a specific thing, and sometimes just exploring what they already know.
Use Mentat for ideas with some gravity: thoughts that survive the noise, keep showing up, or may connect to other work later. Skip the disposable stuff. Mentat is intentionally more selective than a life logger and more opinionated than a generic notes folder.
Mentat starts quiet. Its search, chat, synthesis, reflection, and connections become more useful as you build a deliberate record and return to it over time. You do not need hundreds of memories before starting, but the first few captures are seeds, not a complete picture of your thinking.
If you already have useful material in Markdown files, an Obsidian vault, text notes, journals, or exported conversations, an agent with access to those files and the Mentat CLI can help you review it and capture the parts that still matter. The goal is not to import everything. It is to recover the ideas, questions, decisions, and recurring themes that deserve a place in your active memory. See Starting With Existing Notes for a review-first workflow.
- AI-assisted
/capturewith entity, theme, tag, and action-item extraction - Optional
/capture -wweb enrichment for selected entities that are novel or stale in your memory; useful for current, niche, ambiguous, or model-unknown terms - Hybrid search across saved memories with keyword, semantic, and entity-aware matching
- Natural language temporal search such as "what was I thinking about last week?"
- Context-aware CLI chat over your memory corpus
- One-shot
/reflectionthat identifies one difficult but constructive pattern, tests it against counterevidence, and suggests one practical action - Voice sessions through the CLI
/voicecommand - Journal Markdown v1 export/import for human-readable, Obsidian-friendly archives
- Open Knowledge Format (OKF) v0.2 export/import for portable knowledge bundles
- Named OpenRouter, Venice AI, local OpenAI-compatible, and native Ollama routes, plus an optional dedicated local capture model (
techieTransform23/mentat-capture-gemma4-e4b-4bit) viaCAPTURE_ANALYSIS_PROMPT_MODE=mentat-capture
git clone https://github.com/nmorton13/mentat.git
cd mentat
uv syncOn the first capture or semantic search, Mentat downloads its local embedding model from Hugging Face and caches it for subsequent use. See the installation guide for details.
Run the guided setup:
uv run mentat config initThe setup command creates or safely updates .env, configures OpenRouter,
Venice AI, Ollama, or another OpenAI-compatible endpoint, and activates the selected
model route. Run it again later to change the basic setup. Advanced settings
can still be edited directly in .env.
The 0.9.x release supports this clone-and-run source workflow. Portable wheel
installation and platform-specific user data directories are planned for a
later pre-1.0 release.
Voice is optional. Install its local audio dependencies with:
uv sync --extra voiceuv run mentatThe central loop is capture, return, and reconnect:
/capture <content>- analyze and save content; extracts entities automatically/capture -w <content>- capture with web enrichment for selected novel/stale entities to improve tagging and classification/search <query>- search saved memories/chat <query>- ask a context-aware question over your memories/latest [count]- view recent captures/project <name>- analyze project-related content
Additional ways to work with selected memories:
/voice- start a voice session/links- view saved links/link <url> [comment]- save a link and, ideally, why it matters to you; Mentat does not fetch the page/todo- show extracted actionable items/tag <tags>- search by tags/delete <number>- remove a numbered result after confirmation/model- inspect/switch chat routes and models (/model 1,/model local,/model ollama,/model venice,/model openrouter <id>)/summary [days]- generate an activity summary/reflection- receive one candid, constructive reflection across your saved memories/synthesize <topic>- combine related notes into a structured synthesis/save- capture a valuable AI response as a memory/help- show available commands
Top-level commands support shell automation without entering the interactive REPL:
uv run mentat latest 25 --json
uv run mentat search "machine learning" --json
uv run mentat links "research" --json
uv run mentat todo pending --json
uv run mentat chat "what changed recently?" --json
uv run mentat reflection
uv run mentat capture -
uv run mentat view 123
uv run mentat delete 123 --yes
uv run mentat mark todo_abc123
uv run mentat export markdown /path/to/journal
uv run mentat export okf /path/to/bundle
uv run mentat import markdown /path/to/journal --dry-run
uv run mentat import okf /path/to/bundle --dry-run
uv run mentat config show
uv run mentat config doctorJSON mode prints a single JSON object on stdout with a schema version, command name, success flag, and data or error payload.
Mentat can also serve as durable memory behind a conversational or voice-capable
agent. After talking through an idea with Codex or another agent that has access
to the CLI, you can say, "Capture this in Mentat." The agent can preserve your
words directly or, when you explicitly ask, prepare a summary and capture that.
Long voice notes and agent-prepared text can be passed through mentat capture -.
The same agent can query your memories: "What does Mentat think about X?" or
"What connections does Mentat see between X and Y?" can be handed to
mentat chat "..." --json and returned in the conversation. These answers
synthesize the memories you selected; they are not a complete record or Mentat's
own beliefs.
An agent can also run mentat reflection when you explicitly want MENTAT to
choose one candid, constructive pattern from across your saved record. Reflection
returns human-readable output and does not save its answer.
Memories, embeddings, runtime settings, and exports are stored locally.
When you choose OpenRouter, Venice AI, OpenAI, xAI, or another hosted endpoint, the content
needed for that request is sent to that provider. Chat requests may include
retrieved memories as context. Reflection requests include a bounded,
cross-timeline selection of personal memories—up to 100 for large corpora—so
use Ollama or another local endpoint when that material should remain on your
machine. Inspect effective routing with mentat config show or /model.
On Apple Silicon, you can also run Mentat's dedicated local capture model—techieTransform23/mentat-capture-gemma4-e4b-4bit, a 4-bit MLX Gemma 4 E4B fine-tune trained on 100% synthetic Mentat captures—for fast, consistent, offline /capture analysis with CAPTURE_ANALYSIS_PROMPT_MODE=mentat-capture while keeping any chat model you like. See the Configuration Guide for setup.
Mentat stores memories in SQLite. Journal exports default to data/markdown/,
and opt-in OKF bundles default to data/okf/. Both are personal runtime data,
not project source.