# EMET [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/dreamforgestudiollc/EMET  
**GitHub Stars:** 1  
**npm Downloads (last month):** 1775  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/emet

## Description
Persistent shared memory for AI agents, with verified writes and a transcript tier.

## Tools
Capabilities this server exposes over MCP:

- **emet_initialize** — START HERE. Call this FIRST in every session, before answering anything that might have prior context, and always when the user opens with 'initialize', 'start', 'begin', 'hello' or similar. It is the only setup step a user should ever have to know about. A large startup comes in pages: read `page_notice` first and call again with the page it names until the last page, before replying. If this memory store is new it returns a short interview to run conversationally; if it is established it returns who you are, how you speak (`character`, when the store keeps one - authoritative on voice for the whole session), who you are serving, and where things were left. The user never needs to know which case applied.
- **emet_status** — Diagnostic in one call (replaces emet_setup_status, get_status and emet_verify_connection, 2026-09-27). Reports environment, database, collections, vector index, whether identity and user documents exist, and per-layer counts and health. Pass probe: true to also prove the write path - connect, write a probe document, read the same value back, remove it; a read alone cannot reveal a broken write path. Pass session_id to read that session: `session.state` is open, closed, or absent, or unreadable when the session row cannot be read (the rest of the status still returns, and the asked id is not echoed). A part id is read as its base session. Prefer emet_initialize for a normal session start. Also reports checkpoint on every call: due when an open session's last verbatim save, or the open itself when no transcript is saved, is at least 24 hours old. A session covered by a current conforming records/ disposition (templates/SESSIONDISPOSITION.md) is not listed as checkpoint-due. A row that names an inserted_id dispositions that transcript only and does not close the session. The disposition is not a receipt. Save that verbatim text with emet_transcript_append or save_transcript, under the open session or the daily YYYY-MM-DD_chat-daily session. emet_session_close cites the saved parts. A store that cannot be read sets checkpoint.unread and does not claim the save is current.
- **emet_setup_complete** — First-time setup, the owner's only: record the user's interview answers as bootstrap/IDENTITY.md, bootstrap/CHARACTER.md and bootstrap/USER.md and as an identity-layer entry, and create the owner person. Every write is read-back verified. Refused under a bot tag. On a store that is already set up it is refused unless reissue is true (the owner's explicit word): a re-run writes new versions of the user's identity documents; prior versions are archived, never destroyed. answers.more_than_one_bot is optional. Absent or no leaves sub-keys off. yes writes EMET_SUBKEYS=1, a generated pepper and EMET_SUBKEY_PEPPER_VERSION=1 into .env only when that file is the config source, after the store writes succeed, and does not turn the flag on in this process. A hosted server refuses yes and returns the three variables to set, then redeploy. See docs/SUBKEYS.md. answers.bot_team_backup is optional. Yes or no, in the user's words, the same way as more_than_one_bot. Yes and Yes. record the flag. yes is the recommended choice. Absent or no leaves bot-team backup off. Anything else, including a non-string, is refused before a write. Setup does not copy prompts or settings.
- **corpus_recall** — Semantic search over an optional supplementary knowledge corpus that the user has loaded separately from memory. Returns nothing unless a corpus has been populated; this is not where session memory lives.
- **recall** — Search memories by keyword. Ranked by how many of your words match, then by importance. Current entries come first in every order. Pass order: 'latest' for time order. A standalone latest, newest, or most recent, together with other words, also asks for time order: it reorders those matches and does not change which rows match. A hyphenated word such as latest-budget, a negated 'not the latest', and a bare 'latest' are ordinary keywords. Expired and superseded entries stay in the result, marked with their end date and what replaced them. Pass history: true to read ended entries when current ones fill the limit.
- **query_layer** — Query a specific memory layer with structured filters
- **save_to_layer** — Save memory to a specific layer with full control over metadata. PASS session_id - your transcript session from emet_session_open - on every save made inside a session: the server stamps derived_from with the exchange in progress. Semantic and procedural entries are REFUSED without a source (session_id, or metadata.derived_from); nothing is written when refused.
- **revise_memory** — Supersede an existing entry with a revised one (supersession, not mutation). Creates a NEW entry carrying metadata.supersedes=<target_id> and marks the target with superseded_by and superseded_at. The old entry stays readable: it is not hidden and is_live is not cleared. Recall, query_layer and semantic_recall return it marked with that end date and the id of the new entry. The current entry is listed first. Episodic revision is prohibited - events are immutable.
- **revise_transcript** — Supersede a stored transcript part with a corrected one. Nothing is edited or deleted: a NEW document is written under the same session_id with an incremented revision and a pointer to its parent, and the parent is marked superseded. Use when a saved part has a mispaired, missing or wrong exchange. The reason parameter is required - an unexplained correction is a silent rewrite. To ADD a new part, use save_transcript instead. Allowed on a closed session (a correction deletes nothing), but there a revision may only correct the exchanges the part already holds - never add new ones - and must carry exactly the same exchange numbers (none dropped or repeated; numbers sent as text are stored as numbers).
- **query_transcripts** — Retrieve session transcripts - the second tier, word for word. Reads the live store written by save_transcript AND the legacy archive (exchanges written by earlier hosts, June 2025 to June 2026), grouped into the same session shape; every result carries `source` naming the collection it came from. Nothing is migrated between them. Use it when a layer entry is relevant but thin: the transcript around its timestamp holds the depth the layer compressed out.
- **save_transcript** — FALLBACK. The primary path is emet_session_open then emet_transcript_append after every reply; use this only where a host cannot append per reply. Saves the full word-for-word dialog of a session - full transcripts only, no summaries. Pass exchanges in the call. The server does not read a file. Refused for a session that was closed complete.
- **emet_session_open** — Open a transcript session. Returns session_id, dated in the configured local time zone (EMET_TIMEZONE, default America/New_York). A slug that already begins with YYYY-MM-DD_ (month 01-12, day 01-31) is not dated again, even when that date is not the local day. A slug whose id is already CLOSED is never reopened: the session opens as <id>-2, -3, ... and the result's `notice` says so. Pass load_id from your startup pages (startup_page.load_id on every emet_initialize page) so the startup page check runs on your own startup; an open without load_id, or with a page of that startup never fetched, is refused (the refusal says how to pass). After every reply, call emet_transcript_append with that id and the one exchange that just happened. Do not dump the whole chat at close.
- **emet_transcript_append** — Append ONE exchange to the session transcript. Call after every reply. Idempotent on exchange_index. Rolls to a new part after 8 exchanges. After a complete close the session takes exactly ONE more append - its closing exchange, numbered next, within EMET_CLOSE_GRACE_MINUTES (default 5) of the close; it is written into the session's last part whatever session_id it names, and the result's `closing_exchange` says it was accepted and that the session is now locked. A retry of that exchange number is answered as already saved and writes nothing. exchange_index, when given, must be a whole number of 1 or more (a number or its text). Any other append to a closed session is refused and nothing is written; that exchange belongs in the next session you open the usual way. THE FIRST APPEND OF A SESSION IS CHECKED: its assistant_message must carry the measured machine line - a machine name from the install notes plus the clock reading, as the shell returned them - or the words `no local shell MCP`. Without one of those the append is refused and the transcript does not start.
- **read_doc** — Read a continuity document from the versioned document store. A document longer than one page (18,000 UTF-8 bytes by default) comes back in pages: the result then carries `page` with `next_offset` - call again with that offset (and `expected_version` set to the first page's `version`) until `next_offset` is null, and do not act on a document you have only part of. If the document changes between pages the read is refused: restart from offset 0. `sha256` and `size` (characters; `size_bytes` in UTF-8 bytes) always describe the WHOLE document.
- **read_doc_history** — Read a RETAINED revision of a document, or list the revisions retained for it. Every write archives the prior copy (nothing is deleted); this is the reader for that archive. Without a version: the list of retained revisions with their digests and dates. With a version: that revision's full content, re-hashed against its stored digest. Read-only. Use it for an audit question - what did this document say at version N - or to compare a document with what it replaced.
- **write_doc** — Write or update a continuity document in the document store (versioned, prior copy archived to documents_history and marked obsolete, sha256 read-back verified). RECORDS - the handoff (HANDOFF.md) and any id in EMET_RECORD_DOCS - are superseded, never amended: patch_doc is refused on them, and a new revision is written here WHOLE with `supersedes` set to the version currently in force (ISO 9001 7.5.3 / 13485 4.2.5).
- **write_doc_begin** — Open a staged write when a document will not fit in one write_doc argument. The stage is not a document and does not change the current revision. Send each part with write_doc_append, then write_doc_commit. A record (HANDOFF.md and any id in EMET_RECORD_DOCS) still needs supersedes and reason; commit writes one whole revision through write_doc. Limits: 16000 characters per part, 128 parts, 2000000 characters total, 30 minutes from begin, 4 open stages per writer. Same source, session, and writer stamp as write_doc.
- **write_doc_append** — Append the next ordered chunk of an open stage. part starts at 1 and increases by one. The same part with the same bytes is a no-op. A different byte string, a skipped part, or a chunk over 16000 characters is refused and the current document is unchanged.
- **write_doc_commit** — Assemble an open stage, check part_count and the sha256 of the exact assembled text (the concatenation of the parts in order, before this server redacts it), then write one revision through write_doc. A mismatch or a write_doc refusal leaves the current document unchanged and the stage open. A second commit of the same sha256 returns the first receipt and does not write another revision. A record is still one whole revision: it is superseded, never patched or appended.
- **write_doc_abort** — Drop an open stage. The current document is unchanged. Aborting a stage that is already aborted reports that abort and writes nothing.
- **list_docs** — List continuity documents (metadata only; optional doc_id prefix filter, e.g. 'threads/'). Current documents come first. Retired documents stay in the list, marked with retired_at and, when a rename replaced them, what replaced them.
- **retire_doc** — Mark a continuity document OBSOLETE. Nothing is deleted: the document keeps its id, its full content, its version and its digest, and read_doc still returns it, flagged retired, with the reason. list_docs and the startup scan keep it too, after the current documents, with retired_at and what replaced it. A retired drop is not an unhandled drop. This is document control as ISO 7.5.3 describes it - issue the revision, mark the prior copy obsolete, retain it - and it is the document-store counterpart of revise_memory superseding a layer entry. THE STORE HAS NO DELETE, BY DESIGN. Use for genuine litter: tombstones, merged staging documents, test scratch. Reversible: write_doc on the same id brings it back into the working view.
- **rename_doc** — Reissue a continuity document under a new doc_id. The destination is written first through the normal write path (same redaction, digest, versioning and sha256 read-back), and only then is the old id marked obsolete with retire_doc. NOTHING IS DELETED: the old id keeps its content and stays readable at its own id, flagged retired with the reason 'Reissued as <new_id>'. list_docs keeps it after the current documents and names the new id in replaced_by. No tombstone document is needed, because the retired original IS the tombstone and it still carries the real content. Refuses if the destination already exists, because a rename onto an occupied id is a merge decision and merges are not guessed.
- **restore_doc** — Write a retained revision back as the current document. The retained row is copied through the normal write path, with a reason. Nothing is deleted.
- **validate_doc** — Check a controlled document against the template that governs it, WITHOUT writing anything. The same check the write path runs on every document write - this is the freestanding form, for auditing records written before validation existed, for counting what adoption will mark before it marks anything, and for checking new content before it is stored. Pass doc_id to check a stored document (the previous revision is pulled from the archive so the carry-forward check runs). Pass content, with template_id or a doc_id the map covers, to check text that is not stored. Checks FORM and CONTINUITY only: sections present, in order and filled; no placeholder left unfilled; NOT COMPLETED carrying a reason; a board's counts matching its rows; every row on the previous revision still present or dispositioned. It cannot check whether an answer is true, or whether a 'none' states its scope honestly - those stay with the author and the reader.
- **accept_nonconformance** — Record the written disposition for a nonconformance that will not be corrected. A marker is never cleared silently: it leaves either because a later revision passes, or because someone accepts it in writing here. The marker is RETAINED with the acceptance beside it, and the acceptance covers only the revision it names - the next write is validated fresh, and accepted markers stay counted at session start, separately from open ones. The reason must be at least 10 characters: it is what an audit reads later.
- **patch_doc** — Replace one exact substring in a document (str_replace semantics) without resending the whole file. THE PREFERRED WAY TO MAKE SMALL EDITS to large docs like STATE.md. old_str must match EXACTLY ONCE - zero or multiple matches are rejected rather than guessed. Pass new_str as an empty string to delete. Same versioning, archiving, and sha256 read-back as write_doc.
- **semantic_recall** — Semantic (meaning-based) memory search across all six memory layers via Atlas Vector Search autoEmbed. Finds conceptually related memories even without keyword overlap. Complements keyword-based recall/query_layer.
- **emet_page** — Read one compiled topic page for an area slug (areas/<slug>.md). A page is a view of current records. It is not a record: this tool writes nothing, stores nothing, and the result is never written back and is not returned by recall. Every displayed line cites its source as [mem:<id> · <layer> · <client> · <YYYY-MM-DD>] or [doc:<doc_id>@v<version>]. A line with no source is dropped. Superseded and retired records stay out of the current sections; pass include_history true to show them under History only. A line is marked stale when its source has not been confirmed or revised within the area's staleness window (default 30 days; the area document may set its own). Owner only. Computed on every call, so cache_hit is false.
- **emet_pages** — List current area documents. For each area: line count, stale count, and the time of the newest source the page read. Read-only. Owner only. Computed on every call. The page body is not stored.
- **emet_error_report** — Read the operational error log and show a report the owner can send on. Owner only. Read-only: it writes nothing and sends nothing. EMET has no mail sender and opens no network connection for this tool. The result is the full report, then a mailto link, then a structured email {to, subject, body_text, short_id, version} a calling assistant can pass to its own email tool. The calling assistant may send this report only after showing the report to its user and getting their OK.
- **emet_page_lint** — Flag problems in topic pages and the records they read. Read-only: it never edits a record. Findings cover contradictions (two current records that share a subject and disagree), superseded or retired records still claimed as current, lines with no source, duplicates, broken links, and statuses unconfirmed longer than the area's staleness window. It builds on the emet_gaps classifiers. A fix is a person's revise_memory, retire_doc, or accept_nonconformance. Owner only. Omit area to lint every area.
- **emet_gaps** — The record's honesty about its own holes, as a query. Read-only; identifies and never fills. Counts, with the ids behind them, for each gap class: unsourced assertions, unattributed inferences, ambiguous attribution (by tag and by session), uncertain routing, unattestable rows (pre-2026-09-05 boundary), digest mismatches (the alarm - expect zero), pointer disagreements against the transcript store, broken supersession, expired-but-live rows, consolidation candidates (tag families; a list for a person), and redacted spans by source. Call it when asked how trustworthy the record is, before a consolidation pass, or after any migration. Closing a gap is a person's decision: revise_memory with a real derived_from where the source is knowable; otherwise the gap stands as a fact.
- **emet_floor** — Read the floor: the standing description of how this assistant engages with the person using it. It ships in the server code, so setup cannot overwrite it and no install can lose it - the character document holds the user's modifiers on top of it. emet_initialize already returns the whole floor at session start; call this to read it again without re-running initialize. Use `compact: true` for the short form partway through a long session, when the start of the conversation is far behind. Pass `gem` to read one installed GEM's floor; reading does not turn that GEM on. Read-only, and re-reading is not the same as being bound by it.
- **emet_client_approve** — Approve or deny a pending client tag, or prepare a new writer. decision prepare drafts a writer request: client, claimed tag, door (member or guest), reason, and correlation_id. Master Hub prepares that draft. The server validates it. Validation is a check and is not approval. Alex decides a new writer on /owner/chooser with the owner session. No AI grants a writer, including Master Hub and the retired owl account. The owner login may still approve or deny a pending client tag. Pending client tags are listed in emet_initialize and emet_status as client_approvals.
- **emet_invite_create** — EMET Guest Access: create a one-time code for a guest. They paste it on the connect screen instead of the passphrase. Default access is read-only. Only the owner can create a guest code. EMET Member Access is a different door.
- **emet_member_access_create** — EMET Member Access: create a one-time code for a new person with read and write access. They paste it on the connect screen instead of the passphrase. This is not EMET Guest Access, and it never makes them the owner. Only the owner can create it. Off unless EMET_MEMBER_ACCESS=1.
- **emet_session_close** — Call this when the session is ending - the user says goodbye, asks you to wrap up, mentions restarting or opening a new session, or you are about to run out of room. An acknowledgement of the turn just completed - thanks, great, perfect - is not a session end; if it is ambiguous, ask rather than close. Checks whether this session's work has actually been written to the store and reports exactly what is missing. It does not write anything itself. RECEIPTS ARE REQUIRED: pass `receipts` naming what you wrote and read back for each close step - working documents, the episodic session record id, the board and its version, the transcript part ids and highest exchange index as query_transcripts returned them, and the handoff version (written last). Each receipt is compared with the store; omitted or mismatched receipts, a handoff that was not the last write, or a transcript no layer entry cites (derived_from) return state 'blocked'. Each missing line carries a `scope`: touch only what it names. THREE blocked closes on one session return state 'escalate': stop retrying, say the `speak` lines, and hand the user the list - the counter does not reset on a changed receipt, only with a new session. Say every line of the returned `speak` to the user, in order - a wrap that leaves it out is a failed close. A records/ session disposition is not a receipt and does not make this call complete. Never tell the user their session is saved unless this returns state 'complete'.

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

```json
"mcpServers": {
  "emet": {
    "command": "npx",
    "args": ["-y","@dreamforgestudiollc/emet"],
    "env": {
      "EMET_TIMEZONE": "",
      "EMET_CLOSE_GRACE_MINUTES": "",
      "EMET_SOURCE_TAGS": "",
      "EMET_SUBKEYS": "",
      "EMET_SUBKEY_PEPPER_VERSION": "",
      "PUBLIC_URL": "",
      "EMET_OAUTH_PASSPHRASE": "",
      "EMET_ACTIVE_GEMS": ""
    }
  }
}
```

**Requires environment variables:** `EMET_TIMEZONE`, `EMET_CLOSE_GRACE_MINUTES`, `EMET_SOURCE_TAGS`, `EMET_SUBKEYS`, `EMET_SUBKEY_PEPPER_VERSION`, `PUBLIC_URL`, `EMET_OAUTH_PASSPHRASE`, `EMET_ACTIVE_GEMS` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What EMET does

EMET stores shared agent memory in MongoDB, using six layers for identity, semantic knowledge, episodic events, procedures, metadata, and working context. It also maintains a separate transcript tier that preserves conversations word for word rather than relying on summaries. MongoDB Atlas and self-hosted MongoDB are supported; semantic search requires Atlas Vector Search.

The server is designed for one owner, with optional Guest and Member access. Writes are attributed to their client, and new clients can be restricted to reading until approved. EMET does not provide deletion for memory entries, documents, or transcripts. Instead, records remain available and are revised, superseded, retired, or restored.

## How it works

A normal session begins with `emet_initialize`, which returns startup context in pages when necessary. Agents can then open a transcript session, append each exchange after replying, and close the session. Transcript parts roll over after eight exchanges. `save_transcript` provides a fallback for hosts that cannot append one exchange at a time.

Keyword search is available through `recall`, structured layer queries through `query_layer`, and meaning-based search across all six layers through `semantic_recall`. `corpus_recall` searches a separately loaded supplementary corpus rather than session memory. `emet_page` and `emet_pages` build read-only views of current area records with source citations and staleness information.

Every write is read back before it is reported as successful. Memory revisions create new entries and retain the original with supersession metadata. Transcript corrections also create a new revision and require a reason. Episodic events cannot be revised.

## Setup and configuration

The repository supports local stdio operation and remote HTTP operation with OAuth. Local installation can use the package through `npx -y @dreamforgestudiollc/emet`; running from a checkout uses `npm ci && npm start`. Remote deployments require a public URL and an OAuth passphrase. MongoDB can be hosted in Atlas or run locally.

The first-run flow uses `emet_setup_complete` to record identity, character, and user documents after an interview. Optional subkeys and bot-team backup settings are captured during that setup. Set `EMET_SOURCE_TAGS` before allowing multiple hosts or bots to write so source-tag restrictions are active.

## Tools and capabilities

- Initialize sessions and inspect store health with `emet_initialize` and `emet_status`.
- Store and search layered memory with `save_to_layer`, `recall`, `query_layer`, and `semantic_recall`.
- Preserve, retrieve, and correct transcript parts with `emet_session_open`, `emet_transcript_append`, `query_transcripts`, and `revise_transcript`.
- Manage versioned documents with `read_doc`, `write_doc`, `list_docs`, `restore_doc`, `retire_doc`, and `rename_doc`.
- Stage large document writes with `write_doc_begin`, `write_doc_append`, `write_doc_commit`, and `write_doc_abort`.
- Validate controlled documents and record written dispositions for accepted nonconformances.

## Limitations and notes

EMET is a 0.x project, so stored document shapes may change before 1.0. It supports document-control workflows associated with ISO 9001 and ISO 13485 but does not claim certification or conformity. The server retains obsolete and superseded data by design, which means cleanup is handled through lifecycle markers rather than deletion.

GEM add-ons can provide additional behavior, but client-side GEM tools execute on the client; EMET verifies the resulting record rather than running the computation. The bundled Neurendipity and Lean Six Sigma GEMs are disabled unless explicitly activated.

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

