
Security News
pnpm 11.5 Adds Support for Recognizing npm Staged Publishes
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.
rag-memory-epf-mcp
Advanced tools
Project-local RAG memory MCP server — knowledge graph + multilingual vector + FTS5 in a single SQLite file. Per-project isolation, 30 MCP tools, codepoint-safe chunking (Korean/CJK/emoji).
A project-local RAG memory MCP server — knowledge graph + multilingual vector search + FTS5 full-text search, all in a single SQLite file per project.
.memory/rag-memory.db. Multiple projects run simultaneously without interference.substr, Python slicing, and JS [...str] iteration. Korean/CJK/emoji documents stay aligned. Verified by a publish-time invariant test.{
"mcpServers": {
"rag-memory": {
"command": "npx",
"args": ["-y", "rag-memory-epf-mcp@latest"],
"env": {
"DB_FILE_PATH": "/path/to/your-project/.memory/rag-memory.db"
}
}
}
}
Place this .mcp.json in each project folder with its own DB_FILE_PATH. Each project maintains completely isolated memory.
| Tool | Description | Annotation |
|---|---|---|
createEntities | Create entities with observations and types (upsert) | idempotent |
createRelations | Establish relationships between entities | idempotent |
addObservations | Add contextual information to entities (dedup) | idempotent |
updateRelations | Update relationship confidence and metadata | idempotent |
deleteEntities | Remove entities and relationships | destructive |
deleteRelations | Remove specific relationships | destructive |
deleteObservations | Remove specific observations | destructive |
| Tool | Description | Annotation |
|---|---|---|
storeDocument | Store documents with metadata | idempotent |
chunkDocument | Create text chunks with configurable parameters | — |
embedChunks | Generate 1024-dim embeddings + auto-link entities | idempotent |
embedAllEntities | Batch embed all entities (32 parallel) | idempotent |
extractTerms | Extract potential entity terms | — |
linkEntitiesToDocument | Link entities to chunks where they actually appear (text-matched) | idempotent |
deleteDocuments | Remove documents and associated data | destructive |
listDocuments | View all stored documents | readOnly |
syncDocumentFromFile | One-call server-side sync: reads file + delete/store/chunk/embed/link, content stays off model context. Atomic (embed-first transaction swap) + content_hash dedup (skips unchanged files) | idempotent |
| Tool | Description | Annotation |
|---|---|---|
hybridSearch | Vector + FTS5 BM25 + graph traversal (3-signal). Degrades to FTS5-only (search_mode) when the embedding model is down | readOnly |
searchNodes | Semantic entity search with since/until temporal filtering | readOnly |
openNodes | Retrieve specific entities by name | readOnly |
readGraph | Get complete knowledge graph | readOnly |
getNeighbors | Multi-hop graph traversal (depth 1-5, cycle detection) | readOnly |
getDetailedContext | Get full context for a chunk | readOnly |
exportGraph | Export full graph as JSON (backup) | readOnly |
importGraph | Import graph from JSON (merge or replace) | destructive |
getKnowledgeGraphStats | Knowledge base statistics | readOnly |
| Tool | Description | Annotation |
|---|---|---|
getMigrationStatus | Check database schema version | readOnly |
runMigrations | Apply pending migrations | idempotent |
rollbackMigration | Revert to a previous schema version | destructive |
| Tool | Description | Annotation |
|---|---|---|
getGraphMetrics | Per-entity centrality (degree, betweenness, closeness, pagerank) | readOnly |
detectCommunities | Louvain community detection + modularity score | readOnly |
analyzeGraphStructure | Density, connected components, clustering coefficient | readOnly |
storeDocument(id, content, metadata)
→ chunkDocument(documentId, maxTokens, overlap)
→ embedChunks(documentId)
├── generates vector embeddings for each chunk
├── auto-links entities to chunks (word boundary + CJK aware)
└── returns { embeddedChunks, linkedEntities }
┌─────────────────────────────────────────────┐
│ MCP Client (Claude Code, Gemini CLI, etc) │
└──────────────────┬──────────────────────────┘
│ stdio (MCP SDK 1.27.1)
┌──────────────────▼──────────────────────────┐
│ rag-memory-epf-mcp │
│ ┌────────────┐ ┌─────────────┐ ┌────────┐ │
│ │ Knowledge │ │ RAG Document│ │ Search │ │
│ │ Graph CRUD │ │ Pipeline │ │ Engine │ │
│ └─────┬──────┘ └──────┬──────┘ └───┬────┘ │
│ │ │ │ │
│ ┌─────▼───────────────▼────────────▼─────┐ │
│ │ SQLite (WAL mode, per-project file) │ │
│ │ ├── entities + relationships │ │
│ │ ├── documents + chunk_metadata │ │
│ │ ├── chunks (sqlite-vec, 1024-dim) │ │
│ │ ├── entity_embeddings (sqlite-vec) │ │
│ │ ├── entities_fts + chunks_fts (FTS5) │ │
│ │ └── 11 migrations (auto-applied) │ │
│ └────────────────────────────────────────┘ │
│ │
│ bge-m3 (ONNX, 100+ langs) │
└──────────────────────────────────────────────┘
| Variable | Default | Description |
|---|---|---|
DB_FILE_PATH | rag-memory.db (server dir) | Path to project-local SQLite database |
EMBEDDING_MODEL | Xenova/bge-m3 | HuggingFace model ID for embeddings |
syncDocumentFromFile: embeddings are computed before any DB write, then applied in a single synchronous transaction, so a failed embedding (e.g. model still loading) leaves the existing document fully intact instead of a half-deleted or partially-embedded state.content_hash dedup: unchanged files short-circuit the delete/chunk/embed pipeline (skipped: true), with a completeness gate that still re-processes a partially-embedded document.hybridSearch returns BM25 (full-text) results tagged search_mode: 'fts-only' instead of failing the whole query.syncDocumentFromFile: one-call server-side document sync - reads a file on the server and runs the full pipeline (deleteDocuments → storeDocument → chunkDocument → embedChunks → linkEntitiesToDocument) in a single call, returning only a terse summary { documentId, bytes, chunks, embeddedChunks, linkedEntities, warning? }. File content is read server-side and never routed through the model context, collapsing the usual 5 tool calls per document into one and keeping conversation context flat (the dominant cost of large sync runs). 30 → 31 tools.npm run verify:invariants (wired as prepublishOnly) catches chunkText offset regressions before they ship. Tests ASCII / Korean / emoji-heavy / mixed CJK + supplementary plane / pure supplementary inputs against the codepoint-slice contract.chunkText extracted to src/chunkText.ts — algorithm now testable in isolation. The class method is a thin wrapper. No user-facing API change.start_pos/end_pos that disagreed with SQL substr and Python slicing for any chunk crossing a supplementary character. chunkText now maintains parallel UTF-16 + codepoint cursors and reports codepoint offsets.chunk_metadata.start_pos/end_pos from UTF-16 units to codepoints by re-locating each chunk via indexOf and counting codepoints.ALTER TABLE idempotency guards — some databases from early v3.x experiments (Ollama dimension swap) had recorded a migration at version 9, causing the new v9 migration to silently no-op. Bumped to version 10 and added PRAGMA table_info guards so the column-add is safe to re-run.chunk_metadata — added start_token/end_token columns. Existing start_pos/end_pos are reinterpreted as character offsets into documents.content. Backfill migration recomputes char offsets via indexOf with a per-document cursor; misses leave NULL so callers can re-chunk to repair.getGraphMetrics (degree / betweenness / closeness / pagerank), detectCommunities (Louvain + modularity), analyzeGraphStructure (density / components / clustering). 27 → 30 tools.autoLinkEntities silent failure — was JOINing a non-existent observations table (observations are stored as JSON array column in entities). Changed to direct column select + JSON.parse().linkEntitiesToDocument — entities are now linked only to chunks where they actually appear (using buildEntityMatcher word-boundary/CJK matching), instead of blanket-linking to all chunks. Fixes search result domination by heavily-linked documents.@huggingface/transformers with bge-m3 (1024-dim). No external services required..memory/dictionary.json for custom translation pairssrc/tools/ with structured registrysrc/migrations/ with versioned schema upgradesgetNeighbors tool with WITH RECURSIVE CTE, depth 1-5, cycle detection, bidirectionalEMBEDDING_MODEL env var to use alternative embedding modelsembedAllEntities processes 32 entities in parallelsearchNodes with since/until ISO 8601 date filterssafeRowid() validation for vec0 operations[YYYY-MM-DD] prefix for staleness trackinggit clone https://github.com/bripin123/rag-memory-epf-mcp.git
cd rag-memory-epf-mcp
npm install
npm run build
npm test # build + invariant verification
npm run verify:invariants # standalone invariant test (assumes dist/ built)
npm publish automatically runs prepublishOnly (build + verify:invariants); a chunk-offset regression blocks the publish at the source.
MIT License. See LICENSE.
| Component | License | Details |
|---|---|---|
| bge-m3 | MIT | Model card |
| @huggingface/transformers | Apache 2.0 | JS inference runtime |
Model weights are downloaded at runtime and not bundled in this package.
Built with: TypeScript, SQLite (WAL + FTS5 + sqlite-vec), bge-m3, MCP SDK 1.27.1
FAQs
Project-local RAG memory MCP server — knowledge graph + multilingual vector + FTS5 in a single SQLite file. Per-project isolation, 30 MCP tools, codepoint-safe chunking (Korean/CJK/emoji).
We found that rag-memory-epf-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.

Security News
Federal audit finds NIST lacked a plan to clear the NVD backlog, wasted funds on duplicate work, and delayed use of CISA data.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.