Skip to content
iglo.tech

iglo.memory

Install, quick start, use with your agent, commands, privacy and troubleshooting.

View source on GitHub

Project memory for your coding agent.

Write down what your project knows, in plain Markdown, right in the repository. Your agent asks a question in plain words and gets back the passages that answer it, even when the note uses different words.

One command-line tool and nothing else to run: no server, no database, no background process. Results come back as JSON, ready for your agent to read.

Install

curl -fsSL https://raw.githubusercontent.com/iglo-tech/iglo.memory/main/install.sh | sh

That’s it. iglo.memory lands in ~/.local/bin. If that folder isn’t on your PATH, the installer prints the line to add, then your next step: iglo.memory init. Check the install with iglo.memory --version, which prints {"version":"0.1.0"}. Runs on Linux (x64 and arm64, glibc) and macOS (Intel and Apple silicon). See other install options.

You also need an OpenRouter API key with credit on the account. Indexing and search use paid models through OpenRouter.

Quick start

Inside any Git repository, run this yourself, in a terminal:

iglo.memory init

It sets up .agent/ and asks for your OpenRouter key once, with input hidden. From then on, you and your agents run prepare and search with no prompts.

Add a first note. Later, write your own in .agent/knowledge/ and .agent/decisions/.

mkdir -p .agent/knowledge && cat > .agent/knowledge/auth.md <<'EOF'
# Authentication

## Sessions

The web client keeps a short-lived access token in memory and a refresh
token in an HttpOnly cookie. Access tokens expire after 15 minutes.

## Refresh tokens

When the access token expires, the web client calls `POST /auth/refresh`.
The server rotates the refresh token on every use and revokes the whole
token family if an old refresh token is reused. Refresh tokens expire after
30 days of inactivity.
EOF

Index your notes, then ask:

iglo.memory prepare
iglo.memory search "How do refresh tokens work?"

prepare tells you what it indexed:

{
  "project": "my-app",
  "preparedAt": "2026-11-30T18:23:57.894Z",
  "documents": 1,
  "chunks": 3,
  "reusedVectors": 0,
  "embeddedVectors": 3
}

search returns the passages that answer, best first:

{
  "query": "How do refresh tokens work?",
  …
  "results": [
    {
      "score": 1,
      …
      "source": ".agent/knowledge/auth.md",
      "heading": "Refresh tokens",
      "startLine": 8,
      "endLine": 13,
      "snippet": "## Refresh tokens\n\nWhen the access token expires, the web client calls …",
      …
    },
    { "score": 0.5, "source": ".agent/knowledge/auth.md", "heading": "Sessions", … }
  ]
}

That is real output from a repository named my-app with just this note, shortened where you see ….

Is it a good fit?

It’s built for projects whose agents keep rediscovering what the team already wrote down. Your knowledge stays in Git, next to the code, and search works by meaning, not just exact words.

It’s not the right tool if your notes must never leave your machine (see Privacy), if you need exact text matches (grep or rg do that offline), or if you want automatic indexing, a UI, or one index for many repositories.

Use it with your agent

Add this to your AGENTS.md, CLAUDE.md or similar:

## Project memory

- Before answering questions about how this project works or why it was built
  this way, run `iglo.memory search "<question>"` and read `results`.
- Save lasting knowledge in `.agent/knowledge/` and decisions in
  `.agent/decisions/`. Run `iglo.memory prepare` after changing them.

Each result names the file (source), the heading and the lines (startLine–endLine), with a short snippet. score is the rank, not a confidence. An empty results list means nothing relevant was found. Every field is described in how it works.

Commands

Run them from anywhere inside your repository.

Command What it does
iglo.memory init Creates .agent/ and its config. Asks for your key if none is set.
iglo.memory prepare Indexes your notes. Run it again after you change them.
iglo.memory search "<question>" Finds up to 8 passages that answer the question.
iglo.memory status Shows what is in the index. Makes no network calls.
iglo.memory gc Deletes leftover index files that are no longer used.
iglo.memory init --reset-credentials Replaces your saved OpenRouter key.
iglo.memory --version Prints the installed version.

Every command prints one JSON object. Errors print {"error":{"code":"…","message":"…"}} and exit with status 1. See Troubleshooting.

How it works

  • Markdown files in .agent/knowledge/ and .agent/decisions/ are indexed. .agent/inbox/ is for rough drafts and stays out. Your notes are never edited.
  • prepare builds the index in .agent/memory-index/. Unchanged passages are reused, so reruns are quick and cheap.
  • search reads only the index, so run prepare after you edit notes. It matches words and meaning, tries a few rephrasings of your question, and lets a hosted model put the best passages first. All of it runs through OpenRouter.
  • Each Git worktree has its own index. Commit it, and teammates and CI can search without running prepare. Or add it to .gitignore.

The full picture: how it works.

Privacy

Everything below goes through OpenRouter, which passes it to the company that runs each model. Their data policies apply.

  • prepare sends each new or changed passage for embedding, with your project name, file path and headings.
  • search sends your question and rephrasings generated from it. It also sends your question with up to 40 matching passages (with the same context) to put them in order.

Never sent: files outside the two indexed folders, including .agent/inbox/. Unchanged passages are not sent again. init, status and gc make no network calls, and neither does searching an empty index. Nothing goes anywhere except OpenRouter. See which model receives what.

Your key stays outside the repository, in ~/.config/iglo.memory/credentials.json, readable only by your user. OPENROUTER_API_KEY overrides it.

Never put secrets in indexed Markdown. Anything there can be sent.

Configuration

init creates .agent/memory.json. You rarely need to touch it. It holds the project name (the repository folder name by default) and the embedding.model. After changing either, run iglo.memory prepare again; every passage is re-embedded. Details.

Your API key:

  • init asks for it once (input is hidden) and saves it for all your repositories.
  • iglo.memory init --reset-credentials replaces it.
  • OPENROUTER_API_KEY overrides the saved key without changing it. Use it in CI and other non-interactive setups.

prepare and search never prompt. The tool never runs on its own. To keep the index fresh, run prepare from your own cron job or Git hook (example).

Troubleshooting

Error code What it means What to do
REPOSITORY_INVALID You are not inside a Git repository. cd into your repository and retry.
CONFIG_INVALID .agent/memory.json is missing or broken. Run iglo.memory init, or fix the JSON (see Configuration).
ARGUMENT_INVALID Unknown command, or a bad or missing search question. Check the commands. Quote the question. It cannot start with -.
INDEX_NOT_READY This worktree has no index yet. Run iglo.memory prepare.
INDEX_INVALID The index is damaged or incomplete. Run iglo.memory prepare.
INDEX_INCOMPATIBLE The index was built with other settings or by an older version. Run iglo.memory prepare.
INDEX_BUSY Another prepare, search, status or gc is using the index. Wait for it to finish and retry.
INDEX_WRITE_FAILED prepare or gc could not write to .agent/memory-index/. Check folder permissions and free disk space, then run prepare.
SOURCE_INVALID A note could not be read. Look for symlinks (not allowed), unreadable files or files that are not UTF-8 in the indexed folders.
API_KEY_MISSING No OpenRouter key is set. Run iglo.memory init in a terminal, or set OPENROUTER_API_KEY.
CREDENTIALS_INVALID The saved key file, or its folder, is broken or has unsafe permissions. Fix permissions: chmod 700 ~/.config/iglo.memory && chmod 600 ~/.config/iglo.memory/credentials.json. Or delete the broken file and run init again, or set OPENROUTER_API_KEY.
CREDENTIALS_SAVE_FAILED The key could not be saved. Check free disk space and the permissions of ~/.config/iglo.memory, then run init again.
SETUP_REQUIRES_TTY --reset-credentials was run without a terminal. Run it in an interactive terminal.
SETUP_CANCELLED You cancelled the key prompt. Nothing changed. Run init again when ready.
EMBEDDING_FAILED The embedding request to OpenRouter failed. Check your key, credit and network. If you changed embedding.model, check that name.
EXPANSION_FAILED The request that rephrases your question failed. Check your key, credit and network, and OpenRouter status, then retry.
RERANK_FAILED The request that orders the results failed. Check your key, credit and network, and OpenRouter status, then retry.
SEARCH_TIMEOUT Search took longer than 30 seconds. Retry.
QUERY_TOO_LARGE The question is too long. Ask a shorter question.
INTERNAL_ERROR Something unexpected failed. Retry. If it keeps happening, open an issue.

Errors from OpenRouter also include stage (embedding, expansion or rerank) and reason (transport, rate_limit, provider, invalid_response or budget). Temporary network errors and rate limits are retried automatically before you see an error.

Other install options

Set these before sh:

  • Pin a version: IGLO_MEMORY_VERSION=v0.1.0.
  • Choose a folder: IGLO_MEMORY_INSTALL_DIR=/some/bin.
  • Install from your own copy: IGLO_MEMORY_DOWNLOAD_URL points at a folder (https:// or file://) holding the tarballs and SHA256SUMS. It overrides IGLO_MEMORY_VERSION.

Or download by hand: each release has iglo.memory-<os>-<arch>.tar.gz files (linux-x64, linux-arm64, darwin-x64, darwin-arm64) and a SHA256SUMS file. Check the sum, unpack, and put iglo.memory on your PATH. Each tarball also carries build provenance you can check with gh attestation verify; see verifying a release.

The installer installs nothing unless the download’s SHA-256 matches. It needs curl (not wget), tar, and sha256sum or shasum. x64 builds need a CPU with AVX2. Alpine and other musl-based Linux systems are not supported. To build from source, see CONTRIBUTING.md.

Migrating from iglo.mem

The tool used to be called iglo.mem. Your old key at ~/.config/iglo.mem/credentials.json keeps working: it is read when the new file does not exist, and init tells you which file it uses. To move the key to the new location, run:

iglo.memory init --reset-credentials

Then delete the old file. Moving it by hand also works.

If you get CREDENTIALS_INVALID while only the old file exists, the old file or its folder is damaged or has unsafe permissions. The simplest fix is iglo.memory init --reset-credentials: it saves your key in the new location and never reads the old file. Or fix the old permissions:

chmod 700 ~/.config/iglo.mem && chmod 600 ~/.config/iglo.mem/credentials.json

Prior art

iglo.memory is modeled on QMD and differs from it on purpose:

  • The index lives in each worktree under .agent/memory-index/ and can be committed, rather than in a user-level index as QMD does by default.
  • One explicit prepare command scans and embeds; search never refreshes the index.
  • Embeddings, query expansion and reranking run remotely through OpenRouter, not on local models.
  • There is no daemon or MCP server, and it ships as a single self-contained executable.

See provenance and prior art.

More

Rendered from README.md in iglo.memory at commit 89c6341.