memory-lancedb-mcp CLAUDE.md

Project instructions for developing a TypeScript memory server that uses LanceDB, a database designed for storing and searching data. They cover design principles, Git workflow, commands, tests, and architecture.

In plain words
What is it for?
Guiding changes to the memory server, including linting, formatting, testing, schema migrations, and automated releases.
Why use it?
They set practical rules for reliable behavior, fallback handling, compatibility, and safe collaboration through branches and pull requests.

Instructions file

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 instructions/cablate/memory-lancedb-mcp/claude-md
Clone the repo
git clone --depth 1 https://github.com/cablate/memory-lancedb-mcp
Per session 1,019 This file is loaded in full into every session.
When invoked 1,019 The same file — it is already loaded in full.
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.01019 $0.01019
Opus 5 $0.00509 $0.00509
Sonnet 5 $0.00204 $0.00204
Haiku 4.5 $0.00102 $0.00102

Measured yesterday against content hash 74d6eb149cbe, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

memory-lancedb-mcp CLAUDE.md 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 yesterday.

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.

CLAUDE.md · 90 lines

How it starts

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

CLAUDE.md

Project Principles

  1. Zero-config worksEMBEDDING_API_KEY alone should give you a working memory server
  2. Graceful degradation — Rerank API down? Fall back to cosine. FTS index fails? Fall back to lexical scan. No LLM? Skip extraction
  3. Behavior over implementation — Tests validate what the tool does, not how it's coded internally
  4. Backward compatible — New features must not break existing configs. Metadata schema changes must include migration
  5. Noise-resilient — Filter junk at every layer: input, extraction, retrieval, output

Git Workflow

  • Never push directly to master. All changes go through feature branch → PR → CI pass → merge.
  • Flow: git checkout -b feat/xxxgit push -u origin feat/xxxgh pr create
  • Release is fully automated: merge to master → auto version bump → npm publish → GitHub Release

Development Commands

npm run lint          # ESLint
npm run format        # Prettier auto-fix
npm run format:check  # Prettier check (CI uses this)
npm run typecheck     # TypeScript (currently has known errors, not enforced in CI)
npm test              # All tests via node --test

Architecture

TypeScript executed directly via tsx/jiti — no build step.

Module Map

server.ts              ← MCP entry point: tool registration + request routing
config.ts              ← Config loading (env vars + JSON file → typed McpConfig)
bin/memory-lancedb-mcp.mjs ← CLI entry (tsx/jiti loader)

src/
├── store.ts           ← LanceDB CRUD with scope filtering, serialized updates, FTS index
├── embedder.ts        ← OpenAI-compatible embedding (LRU cache, multi-key rotation, auto-chunking)
├── retriever.ts       ← Hybrid retrieval pipeline: vector+BM25 → RRF → rerank → scoring → filter
├── scopes.ts          ← Multi-scope isolation (global, agent:, project:, user:, custom:)
├── decay-engine.ts    ← Weibull decay scoring (recency × frequency × intrinsic × tier)
├── tier-manager.ts    ← 3-tier lifecycle (Peripheral ↔ Working ↔ Core)
├── smart-metadata.ts  ← L0/L1/L2 metadata layers, temporal versioning, relation graph
├── smart-extractor.ts ← LLM-powered extraction (standalone, not wired in server.ts by default)
├── noise-filter.ts    ← Regex noise detection (denials, boilerplate, meta-questions)
├── access-tracker.ts  ← Debounced access count tracking with reinforcement
├── llm-client.ts      ← OpenAI chat wrapper for JSON extraction
├── chunker.ts         ← Semantic text chunking for oversized inputs
├── memory-categories.ts ← 6-category taxonomy + dedup behavior rules
├── workspace-boundary.ts ← Routes profile/identity facts away from LanceDB
└── reflection-*.ts    ← Reflection/governance stores (library code)

Read the full file on GitHub · 90 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. yesterday First seen · 90 lines · 1,019 tokens per session scan A 74d6eb149cbe

Subscribe to this mod's changes

memory-lancedb-mcp CLAUDE.md is an instructions file published in the GitHub repository cablate/memory-lancedb-mcp (0 stars, last pushed 4mo ago), licensed MIT. It adds 1,019 tokens to every session, about $0.0051 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.