# Gemdex [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/nikships/gemdex  
**GitHub Stars:** 5  
**npm Downloads (last month):** 415  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/gemdex

## Description
Persistent memory layer for AI coding agents: save, recall, update via Gemini plus LanceDB

## Tools
Capabilities this server exposes over MCP:

- **save_memory** — 
Persist a new memory to the user's global, durable memory layer.

🎯 **When to use**: proactively, as you work — you do NOT need the user to ask.
Save durable, reusable knowledge the moment you learn it: hard-won fixes and
root causes, project conventions and architecture decisions, setup/build/deploy
steps, credentials and paths the user shares, gotchas, and the rationale behind
choices. If it's likely to matter in a future session or repo, store it now
without waiting for permission. Explicit user requests ("remember that…", "save
this") are just one trigger among many. Keep memories to durable, reusable facts
— skip one-off trivia and anything easily re-derived from the current context.

Behavior: the content is chunked, embedded on-device (EmbeddingGemma 2 via MLX), and
stored globally (searchable from every repo and session). Returns the new
memory id.

Optionally pass `attachments`: images (.png .jpg .webp .gif), audio (.wav
.mp3 .m4a .flac .aac .aiff, up to 5 min) and video (.mp4 .mov .m4v .webm) are
embedded on-device from their bytes, so the memory is findable by what the
file shows or says. Text files (.txt, .json, .jsonl) are stored but not
searched — put anything about them that should be findable in `content`. A
`caption` per file is optional; it adds keyword matching and helps for audio,
whose content-only matching is weaker. Every attachment is readable later with
`read_attachment`. Each attachment is either a local file `path`
(preferred — the server reads the bytes, so you don't emit base64) or inline
base64 `data`. PDFs are not supported. Either `content` or at least one
attachment is required.

If the response includes a "⚠ similar existing memories already stored" block,
the store found near-duplicate/conflicting memories already there — read it and
consolidate with `update_memory` (or confirm with the user which should win)
rather than leaving both.

- **recall** — 
Search the user's global memory layer by natural-language query and/or example
media files, and return a cheap ranked title index (never full bodies).

🎯 **When to use**: proactively and by default — make checking memory a reflex,
not something you wait to be told to do. Recall at the start of a task, before
solving a problem, before setting up a tool or environment, before making a
design/convention decision, and before asking the user for information they may
have already given you. A title-index recall is cheap; prefer checking first
over assuming nothing is stored.

Behavior: hybrid semantic + BM25 search, fused by relevance. To ask "is there
anything in memory about this file?", pass the image, audio or video as
`attachments` (a local `path`), with or without a `query`; it is matched
against stored text and media alike. Always returns up to 10 hits as title + id only (plus a track-record line when outcome stats
exist). Most tasks end here with nothing useful — that is expected. When a
title looks clearly task-relevant, open THAT memory with `get_memory({ id })`.
Do not expect bodies from this tool.

Setting `GEMDEX_TRUST_RANKING=true` re-ranks the title index by track record
(off by default; ranking stays pure relevance until you opt in).

- **get_memory** — 
Load the full content of one stored memory by id.

🎯 **When to use**: after `recall` returns a title that looks clearly relevant
to the current task — or when you already have an exact id from `save_memory`.
This is the only MCP path that returns the full parent body. Most recalls need
no follow-up; only open memories you actually intend to use.

Behavior: returns title, id, relative age, optional track-record and attachment
metadata, and the full content. Use `read_attachment` afterward if you need
attachment/transcript bytes. Opening a memory counts as a recall for the
per-client outcome ledger (feeds track-record / optional trust ranking).

- **update_memory** — 
Revise an existing memory in place, identified by its id.

🎯 **When to use**: proactively whenever you discover a stored memory is
outdated, wrong, or duplicated — not only when the user asks
("the notarization step changed — update that memory"). If you learn a better
fact, or a `save_memory` response flags "⚠ similar existing memories already
stored", prefer correcting/consolidating the existing memory in place over
leaving stale or conflicting copies. Get the id from a prior save_memory,
recall, or get_memory result.

Two ways to change the text:
- `edits`: targeted find-and-replace — preferred for large memories. Pass an
  array of `{ oldText, newText, replaceAll? }`; you emit only the changed
  snippets instead of resending the whole note. Each `oldText` must match
  exactly and be unique (set `replaceAll: true` to change every occurrence).
- `content`: full replacement of the text. Use for small memories or rewrites.
`content` and `edits` are mutually exclusive.

Behavior: re-chunks and re-embeds the resulting content under the same id.
Omitted fields are preserved — leave out `content`/`edits` to keep the prior
text, leave out `attachments` to keep the prior attachments (pass
`attachments: []` to clear them). Supplied attachments replace the existing
ones and follow the `save_memory` rules: image/audio/video files are embedded,
text files are stored only. Each attachment is either a local file `path`
(preferred) or inline base64 `data`. To remove a memory entirely, use `delete_memory`.

- **report_outcome** — 
Report how acting on a recalled memory went, so the memory layer learns which
memories are trustworthy.

🎯 **When to use**: right after you used a recalled memory and the outcome is
clear — `worked` (followed it and it was correct), `failed` (its information
was wrong or broken), `stale` (clearly outdated, e.g. rotated credentials or
moved paths). One call per memory actually used; do not report memories you
merely saw in results. This is meta-feedback on the memory layer itself and is
the one gemdex tool you should call without being asked, whenever a clear
outcome exists.

Recorded locally in a per-client ledger keyed by memory id (not written back
into the memory itself). With `GEMDEX_TRUST_RANKING=true` it also adjusts
future `recall` ranking — proven memories rank higher, memories that have
burned the agent rank lower.

- **read_attachment** — 
Read an attachment on a stored memory: text files as UTF-8, images as an
image you can view, other media as base64.

🎯 **When to use**: after `get_memory` shows a memory with attachments —
especially chat digests that include a `file` attachment captioned
"Full transcript (source file)". Prefer this over opening the transcript's
original path, which may have moved or been deleted since it was ingested.

Args: `memory_id` (required), optional `attachment_id` (omit when there is
exactly one attachment, or a single transcript/`file` attachment), optional
`max_chars` (default ~1.5M; truncates with a clear overflow note).

- **delete_memory** — 
Permanently delete a stored memory by id (and its attachments/blobs).

🎯 **When to use**: when a memory is obsolete, wrong beyond repair, duplicated
after consolidation, or the user explicitly asks to forget something. Prefer
`update_memory` when the facts can be corrected in place. Get the id from a
prior save_memory, recall, or get_memory result.

Behavior: removes the memory and its attachment files from the local store.
Also clears this client's per-memory outcome
stats for that id. Irreversible via MCP — confirm with the user when unsure.


## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "gemdex": {
    "command": "npx",
    "args": ["-y","gemdex-mcp"],
    "env": {
      "GEMINI_API_KEY": "",
      "GEMDEX_TRUST_RANKING": "",
      "GEMDEX_SIMILAR_ON_SAVE": "",
      "GEMDEX_SIMILAR_THRESHOLD": ""
    }
  }
}
```

**Requires environment variables:** `GEMINI_API_KEY`, `GEMDEX_TRUST_RANKING`, `GEMDEX_SIMILAR_ON_SAVE`, `GEMDEX_SIMILAR_THRESHOLD` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Gemdex MCP server does

Gemdex MCP server provides a persistent memory layer for AI coding agents. An agent can save a finding once and retrieve it in a later session or from another repository using the same memory pool. Search returns matching titles and IDs rather than exposing every memory body, allowing the agent to inspect only relevant results.

The system can preserve full memory content, attachments, timestamps, and outcome history. Agents can record whether a retrieved memory worked, failed, or became stale. This makes the store useful for recurring implementation decisions, setup instructions, debugging discoveries, and workflow documentation.

Two deployment modes are available. The local mode runs through stdio on Apple Silicon Macs with macOS 14 or later. The self-hosted mode exposes Streamable HTTP MCP at `/mcp` and uses Postgres/pgvector with file or S3-compatible blobs. These modes use separate memory pools.

## How it works

Local installation downloads managed Python/MLX components and the EmbeddingGemma 2 model. Embeddings run on the device after setup, without an API key. LanceDB stores the local index and blobs under `~/.gemdex`. Local search combines semantic matching with BM25-style text matching, then resolves matching chunks to their parent memories.

The self-hosted deployment keeps embeddings and storage on the server. It supports Gemini multimodal embedding and media recall through its `/v1` interface, while MCP clients connect to `/mcp`. The supplied installer starts the database, server, HTTP MCP endpoint, and web manager, then checks save and recall operations.

Recall is intentionally lightweight: it returns up to 10 titles and IDs, never complete bodies. `get_memory` retrieves the selected memory and increments recall statistics. A trust-ranking option can use recorded outcomes when ranking titles; relevance-only ranking is the default. Local saves can also issue a similarity warning when an existing memory appears close to the new one, but the warning does not prevent saving.

## Setup and configuration

For local use, run `npx gemdex-mcp install`, then register the stdio command with an MCP client. The installation downloads roughly 1.3 GB of model and runtime assets. It requires native arm64 Node.js 24 or newer on macOS; Rosetta Node is unsupported.

For self-hosting, the repository provides a shell installer that starts the complete stack. The deployment can read `GEMINI_API_KEY` or prompt for a Google AI Studio key. The default exposure is loopback-only. LAN or public deployments require the documented authentication, HTTPS, and OAuth setup; Postgres and `/v1` should not be exposed publicly.

Gemdex MCP server also includes commands for ingesting chat history from Claude Code, Factory CLI, Codex, Antigravity, or a selected folder. Local digestion and hygiene use Claude Code inference, so Claude Code must be installed and authenticated for those workflows.

## Tools and capabilities

- `save_memory` stores text and supported attachments, returning an ID and title.
- `recall` searches memory and returns titles with IDs.
- `get_memory` returns the full parent memory, age, attachments, and track record.
- `update_memory` replaces content or applies literal edits, with optional title and attachment changes.
- `report_outcome` records a worked, failed, or stale result with an optional note.
- `read_attachment` returns attachment bytes as UTF-8 or base64.
- `delete_memory` permanently removes a memory and related client statistics; it is available only over stdio.

Local attachments are limited to text-oriented files, with up to four files of 20 MiB each. Supported formats include TXT, JSON, JSONL, and NDJSON. Local media embedding and media queries for images, audio, video, and PDFs are not supported. HTTP attachment inputs must use inline base64 rather than client filesystem paths.

The desktop app is maintenance-only for the local pool and is not a client for self-hosted deployments. Self-hosted installations use the web manager for human administration.

_Full upstream README: https://allmcps.com/mcp/gemdex/readme_

