memory-hnsw

memory-hnsw is a skill for Claude Code, Codex from abho7/mcp-memory-server. It costs 107 tokens per session (775 once invoked), scanned A, original, MIT.

A local memory system that saves notes in a searchable index and recalls them by meaning. The notes remain available after the agent restarts and are stored without sending them to an external API.

In plain words
What is it for?
Use it to save and retrieve long-term project facts, working preferences, past decisions, and environment instructions. It also supports listing and deleting saved memories.
Why use it?
It removes the need to repeat useful decisions, preferences, and project conventions in every session.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/abho7/mcp-memory-server/mcp-memory-server
Any agent
npx skills add abho7/mcp-memory-server --skill mcp-memory-server
Clone the repo
git clone --depth 1 https://github.com/abho7/mcp-memory-server

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for memory-hnsw

README.md
[![agentmods](https://agentmods.dev/badge/skills/abho7/mcp-memory-server/mcp-memory-server.svg)](https://agentmods.dev/skills/abho7/mcp-memory-server/mcp-memory-server)
Your own site
<a href="https://agentmods.dev/skills/abho7/mcp-memory-server/mcp-memory-server"><img src="https://agentmods.dev/badge/skills/abho7/mcp-memory-server/mcp-memory-server.svg" alt="Measured on agentmods" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 775 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00107 $0.00775
Opus 5 $0.00053 $0.00387
Sonnet 5 $0.00021 $0.00155
Haiku 4.5 $0.00011 $0.00077

Measured 3d ago against content hash a29a1076e864, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-hnsw scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

SKILL.md · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Persistent memory (HNSW)

Four MCP tools backed by a local vector index. Memories survive restarts; recall is by meaning, not keyword match.

Tool Signature Returns
store_memory (text: str, tags: list[str] = []) the new memory's id
search_memory (query: str, k: int = 5) k nearest memories, similarity-ranked
list_memories (tag: str = None) all memories, newest first, optional tag filter
delete_memory (id: str) confirmation

When to store

Store facts whose value outlives the current session:

  • Decisions and their reasoning — "We picked Postgres over MySQL because we need JSONB indexing"
  • Stable preferences — "Prefers short, specific review comments"
  • Project conventions not visible in the code — "Integration tests need Docker running"
  • Environment and process facts — "The staging deploy key rotates monthly"

Do not store: anything already in the repo (code structure, git history, CLAUDE.md), transient state ("the build is currently failing"), or secrets and credentials. The store is plaintext JSON on disk.

Write each memory as a self-contained sentence. "Use pnpm, not npm" is recallable in six months; "use that instead" is not.

Search before assuming you lack context — at the start of work on a familiar project, when the user references a past decision, or when a question sounds like it has an established answer. It is cheap; a miss returns nothing and costs one call.

Phrase the query as the question you actually have. Embeddings match on meaning, so "which database did we choose and why" finds a memory worded "We picked Postgres over MySQL..." despite sharing almost no words.

Tags

Tags are free-form, matched case-insensitively, and used only by list_memories. A small stable vocabulary works best: decision, preference, ops, testing, convention. search_memory ignores tags entirely — it ranks on the text.

Reading results

search_memory returns a cosine similarity in [-1, 1]. Judge hits relatively, not against a fixed threshold: the top result is the best available match, and MiniLM scores genuine paraphrase matches around 0.3–0.5 rather than near 1.0. Treat a top score below roughly 0.15 as probably unrelated, and say so rather than forcing a connection.

Read the full file on GitHub · 68 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 68 lines · 107 tokens per session scan A a29a1076e864

Subscribe to this mod's changes

memory-hnsw is a skill published in the GitHub repository abho7/mcp-memory-server (0 stars, last pushed 4d ago), licensed MIT. It adds 107 tokens to every session and 775 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

android-architecture

Default Android app architecture: MVVM, three Gradle modules, Jetpack Compose, Hilt, Coil, Ktor, Room, DataStore. Use when creating or changing Android, Kotlin, Jetpack Compose, Gradle modules, Activities, ViewModels, or Android libraries in an app that has not already chosen a different pattern.

sergenes/mini_agent · 71 tokens

ios-architecture

Default iOS and macOS app architecture: MVVM, SwiftUI, @Observable, async/await, URLSession. Use when creating or changing iOS, iPadOS, macOS, SwiftUI, ViewModels, Swift packages, or Xcode app targets that have not already chosen a different pattern.

sergenes/mini_agent · 67 tokens

new-project

Bootstrap a new product repository for agentic development. Use when starting a new app, empty repo, greenfield project, or when the user asks to stand up the factory, the start loop, or what to install before the first feature.

sergenes/mini_agent · 51 tokens

web-architecture

Default web app architecture: TypeScript, feature folders, a view / state / client split in the same spirit as MVVM. Use when creating or changing web UI, TypeScript/JavaScript frontend, React or similar SPA/SSR pages, CSS, or browser API clients in an app that has not already chosen a different pattern.

sergenes/mini_agent · 71 tokens

n8n-agents

Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain. AI node — an AI Agent, LLM chain, Text Classifier, or Information Extractor — and whenever the user mentions AI agents, LLM with tools, tool calling, $fromAI, system prompts, agent memory, sessionId, structured/JSON output…

czlonkowski/n8n-mcp · 156 tokens

agentcore-investigation

Investigate Bedrock AgentCore runtime sessions via CloudWatch Logs Insights — resolve session/trace IDs, query OTEL spans, filter noise, build timelines. Use when debugging AgentCore agent sessions, tracing tool calls, or analyzing latency.

awslabs/mcp · 52 tokens