memex README

The project's README from github.com/nicosuave/memex. As one markdown file: README.md.

memex

Search, browse, and revisit your local agent history. Memex indexes conversations from coding tools so you and your agents can find previous work, read the original transcripts, and resume sessions in their original tool where supported.

Keyword search uses BM25. Optional local embeddings add semantic and hybrid search. You can also search saved Claude and Codex memories, query history across machines over SSH, and track token usage from local logs.

Memex terminal session browser

Install

brew install nicosuave/tap/memex

Or use the installer:

curl -fsSL https://raw.githubusercontent.com/nicosuave/memex/main/scripts/setup.sh | sh

See installation and updates for Arch Linux, Nix, Cargo, source builds, and upgrade behavior.

Quickstart

memex index                              # Index local agent history
memex                                    # Browse sessions in the terminal
memex search "deployment rollback" --format text
memex session SESSION_ID                 # Read a transcript page

In the TUI, select a session to read it or use its resume action to continue in the original agent. Resume requires that agent to be installed and its session data to remain available. See the engine support table for exceptions.

Indexing discovers supported sources automatically. To select specific engines:

memex index --only-source claude --only-source codex
memex search "deployment rollback" --source codex --project my-project

Search defaults to conversations and JSONL output. Embeddings, plaintext reasoning, and token tracking are off by default. Searches refresh stale indexes automatically; for background indexing, run memex daemon enable --continuous.

Engine support

Support varies by capability. History means indexing, searching, and reading locally available conversations. Resume opens an existing session in its original tool. Import into creates a conversation in another tool using the experimental transfer feature.

Engine History Token usage Resume Saved memories Import into
Claude Code Yes Yes Yes Yes Experimental
Codex Yes Yes Yes Yes Experimental
Cursor Yes Yes CLI sessions No Experimental
OpenCode Yes Yes Yes No Experimental
Pi Yes Yes Yes No Experimental
Oh My Pi Yes Yes Yes No No
OpenClaw Yes Yes No No No
GitHub Copilot CLI Yes Yes Yes No Experimental
Grok Yes Yes Yes No No
Jcode Yes Yes Yes No No
Muse Yes Yes Yes No No
Antigravity Yes No Yes No No
IBM Bob Yes Yes Yes No No
ZCode Yes Yes No No No
Kiro CLI Yes Credits only No No No
Hermes No Yes No No No

See source discovery and memory retrieval and usage details for formats, paths, and limitations.

Ways to use Memex

Interface Use it for
CLI Search, bounded transcript reads, indexing, usage reports, and scripts
TUI Browse, search, preview, and resume sessions; view activity
Web UI Browse and search from a local authenticated browser
macOS app Native project and session browsing, lexical search, and local resume
Qt app Native desktop browsing, lexical search, and conversation reading
MCP server Give agents structured search and transcript retrieval tools
Search skill Teach agents to use the Memex CLI for source-backed recall
herdr plugin Browse and resume sessions from a herdr pane

The interfaces share Memex's data, but expose different workflows. The native app READMEs describe their capabilities and platform requirements.

For the macOS app:

brew install nicosuave/tap/memex-app

The native macOS app:

Memex native macOS app

The Qt companion:

Memex Qt companion

For the browser:

memex web serve

To keep indexing and the browser running in the background:

memex daemon enable --web-ui
memex web open

See background indexing and Web UI authentication.

Search and read

memex search "migration failure" --format text
memex search "migration failure" --source claude --limit 10
memex search "deployment decision" --content all
memex search "project conventions" --content memories
memex sessions --cwd . --limit 5
memex session SESSION_ID
memex show --record-id RECORD_ID --machine local

Search results identify the session, source, and machine so you can retrieve the original records. Transcript reads are bounded by default and return continuation information for longer content.

For semantic or hybrid search, first generate local embeddings:

memex index --embeddings
memex search "how we handled retries" --mode hybrid --format text

See search and reading for filters, output formats, pagination, reasoning inclusion, and memory retrieval; see embeddings and configuration for models and CPU, CoreML, or CUDA execution.

Agent integration

Install the shared search skill for Codex, OpenCode, Pi, and Oh My Pi:

memex skill install --target shared

For Claude Code:

memex skill install --target claude

Restart the agent after installing or updating its skill. The skill guides it to search progressively and verify relevant source records.

For MCP clients that launch a local process:

{
  "mcpServers": {
    "memex": { "command": "memex", "args": ["mcp", "--transport", "stdio"] }
  }
}

Memex also serves authenticated Streamable HTTP with memex mcp, or alongside background indexing with memex daemon enable --mcp. See the MCP guide for client setup, OAuth, remote access, and the retrieval tool contracts.

Multiple machines over SSH

Each machine keeps its own index. Memex queries configured machines over SSH and returns results with their originating machine attached. Unavailable machines produce partial results with a warning.

memex search "deployment rollback" --machine mini
memex session SESSION_ID --machine mini

Install Memex on each machine and add its SSH configuration to ~/.memex/config.toml. See multiple-machine setup for a complete example and remote reading and resume behavior.

Token usage

Enable local usage tracking in ~/.memex/config.toml:

token_usage = true
memex usage
memex usage --source codex --since 2026-09-01

Usage is reconstructed from each engine's local records. Costs prefer recorded request prices and otherwise use a built-in price catalog; calculated values are API-equivalent estimates, not subscription charges. Missing prices remain visibly unpriced. See usage and cost estimates for details.

Experimental session transfers

memex transfer imports an indexed conversation into Codex, Claude Code, Copilot CLI, Cursor, OpenCode, or Pi. This is experimental, and compatibility depends on the destination tool's version and storage format.

Transfers reconstruct conversation content; they do not migrate the complete agent runtime, workspace files, permissions, or executable tool state. Use native resume when you want to continue the original session in the same tool.

# Generate an intermediate transcript without importing into the destination
memex transfer SESSION_ID --source claude --to codex --dry-run

# Import the conversation into the destination tool
memex transfer SESSION_ID --source claude --to codex

The command reads the local Memex index. A dry run still writes a generated transcript file, but does not import it into the target. A successful import prints the destination information and a resume command; it does not validate that the destination can reproduce the original session's behavior.

Reference

Guide Contents
Installation and updates Package managers, source builds, Nix, skill updates, daemon upgrade migration
Indexing, search, and reading Sources, memories, filters, formats, record budgets, pagination
Configuration and embeddings Config file, models, execution providers, exclusions, resume templates
Background indexing and Web UI Services, browser authentication, index cleanup
Multiple machines SSH setup, remote reads, batch retrieval
MCP server Transports, authentication, client setup, retrieval tools
Token usage Counters, pricing, cache estimates, Hermes coverage
herdr integration Installation, actions, key bindings
Developer profiling Index/search traces and flamegraphs

memex (nicosuave/memex)

Searching Database…

267 ·GitHub
这是干什么的?Memex 会为你本地的编程代理对话(Claude Code、Codex、Cursor 等)建立索引,让你可以搜索以前的工作、查看原始对话记录,并在原来的工具里继续之前的会话。
它只是个命令行工具,还是有图形界面?首先是命令行界面(CLI)和终端界面(TUI),同样的数据还可以通过本地网页界面、macOS 原生应用、Qt 桌面应用、供代理使用的 MCP 服务器以及一个 herdr 插件来访问。
我怎么把它跑起来?运行安装脚本(或者用 Cargo、Nix、Arch 软件包,或从源码构建),然后运行 memex:支持的对话来源会自动发现,在 TUI 里你可以查看或恢复任意会话。
它能搜索哪些编程代理的记录?支持十六种引擎,包括 Claude Code、Codex、Cursor、OpenCode、Pi、OpenClaw、GitHub Copilot CLI、Grok 和 Antigravity。历史记录对所有引擎都可用;恢复会话、保存的记忆和 token 统计则因引擎而异。
是不是每个过去的会话都能恢复?不行——恢复会话需要电脑上还装着原来的代理,并且它的会话数据还在磁盘上,而且支持程度不一:OpenClaw 和 ZCode 的会话无法恢复,Hermes 只提供用量统计,会话迁移功能还处于实验阶段。
我的对话数据会不会被传到我的电脑之外?一切都留在本地:每台机器维护自己的索引,网页界面是一个需要本地登录的浏览器页面,跨机器搜索也只能通过 SSH 访问你在 ~/.memex/config.toml 里列出的机器。
我能把 Claude Code 的会话转移到 Codex 或其他工具里吗?可以,通过还在实验阶段的 memex transfer 命令,可以导入到 Codex、Claude Code、Copilot CLI、Cursor、OpenCode 或 Pi。模式有两种:compact(清理过的文本,默认)和 strict(把工具活动作为备注一并加上);--turns 可以限制包含的历史范围。这不是无损迁移。
我的编程代理自己怎么使用 Memex?把 memex 作为 MCP 服务器运行,代理就能进行结构化搜索和获取对话记录;或者为 Codex、OpenCode、Pi、Oh My Pi 和 Claude Code 安装共享搜索技能,让代理通过 CLI 做有出处可查的召回。
它能告诉我用了多少 token 吗?可以。token 统计是可选功能,从各个引擎的本地日志重建而来。费用基于记录的请求价格或内置的价格目录,是等价于 API 的估算值,不是订阅扣费或配额余额。
它也能搜索代理保存的记忆吗?可以——Claude 的项目记忆和 Codex 的记忆文件会与对话记录分开发现。用 --content memories 单独搜索它们,或用 --content all 把它们和对话混在一起搜索。
Creator
nicosuave
Size
8.5 MB
Stars
267
Age
9mo
Commits · 90 Days