Documentation
Browse documentation

Reference and help

Build from source

You can build MemIndex yourself, run its tests and try your own build without touching your real memory. The code is at github.com/imogenlabs/memindex.

What you need

Node.js 20.12 or newer and Bun 1.1.31 or newer.

Build and test

git clone https://github.com/imogenlabs/memindex.git
cd memindex
npm ci
npm run typecheck
npm run build
bun test tests

Run tests and builds in an isolated environment with disposable data, separate from installed plugins and from any memory you care about. Keep them away from your real ~/.memindex.

Try your own build

MemIndex never runs a worker, hook or search script from the folder you are standing in, so a cloned repository cannot run its code with your memory and keys. That includes your own checkout. To try your build, do one of these:

  • Set MEMINDEX_WORKER_SCRIPT_PATH to the absolute path of plugin/scripts/worker-service.cjs in your checkout. MemIndex uses that file first.
  • Set MEMINDEX_DEV_HOOK_SOURCE=1 and run the command from the checkout. The checkout is then used only when no MemIndex is installed. An installed copy always wins. The same setting lets the agent installers read their files from the checkout.

Use a separate memory folder and port for a development service, so it never touches your real memory:

MEMINDEX_DATA_DIR=/tmp/mi-dev MEMINDEX_WORKER_PORT=38799 npx memindex start

Find your way around

Folder What is in it
src/cli, src/npx-cli The memindex command and the installer.
src/services/worker The service, its HTTP routes and the note-writing providers.
src/services/sqlite, src/storage The database layer.
src/servers The search server agents connect to.
src/hooks, src/services/hooks What the agent hooks run.
src/integrations, src/services/integrations The installer and adapter for each agent.
src/ui The viewer.
src/shared, src/utils Settings, paths and helpers.
plugin The plugin agents load. Its built files are produced by the build, so do not commit them.

The repository's CONTRIBUTING.md covers branches, commit messages and how to send a change.

Next steps