Skip to main content
Glama

A totem stands watch over what a tribe has learned. Totem does the same for a codebase. It's a Git-aware memory server for coding agents: decisions, invariants, and gotchas persist across sessions, backed by evidence, and flagged the moment the code underneath them changes.

Why

AI coding agents lose engineering context between sessions. They re-discover the same gotchas, re-debate the same decisions, and forget invariants that were already established. totem persists this knowledge locally and serves it back to agents as structured context, ordered by relevance.

Related MCP server: arcane

Install

Requires Python 3.13+.

npm install @emiliano-go/totem
npx @emiliano-go/totem

The npx command auto-installs or upgrades the Python MCP server, pins its version, and configures enforcement plugins for OpenCode, Claude Code, and Kimi Code. For Kimi Code it also registers a user-level MCP entry (~/.kimi-code/mcp.json) so totem is available in every project.

Supported agents

Agent

Hook type

Auto-configured?

OpenCode

tool.execute.before JS plugin

Yes

Claude Code

PreToolUse/PostToolUse hooks (~/.claude/settings.json)

Yes

Kimi Code

[[hooks]] in ~/.kimi-code/config.toml

Yes

Features

  • 14 memory types with type-specific metadata validation

  • 67 MCP tools (core, typed wrappers, provenance, coverage, and memory maintenance)

  • Staleness detection via SHA256 content hashing on evidence

  • Conflict detection on overlapping evidence and contradictory claims

  • Full-text search via Turso FTS5

  • Hybrid memory (project + user databases)

  • Context assembly with scored pipeline and token budget

  • Agent enforcement blocks reads/grep/bash when memory exists, forces search-first workflow

  • Commit gates block all tools until agent registers file reads and writes

  • History audit on every create, update, and delete

  • Tamper-evident history: hash-chained events plus item state digests (totem audit)

  • Evidence-derived verification: memory_verify consumes a recorded check, not a claim

  • Calibrated trust: dependency-free Platt + split-conformal trust sets, advisory until validated

  • Hybrid ranking: FTS + deterministic dense encoder with reciprocal-rank fusion and MMR

  • Optional static embeddings: Model2Vec potion-retrieval-32M behind an extra, with a hash fallback

  • Corpus-wide retrieval: FTS, dense, evidence paths, symbols, tags, and relation hops, not a tag gate

  • Temporal validity: valid_from / valid_to with as_of retrieval

  • Feedback loop: record useful/wrong signals and train the reranker and calibrator

  • Abstention and consolidation: no noise when nothing is relevant; near-duplicate clustering

  • Bounded MCP tools: output caps, rate limits, deadlines, and a tool-manifest digest

  • Memory classes: operational, episodic, procedural, core, and semantic records

  • Entity graph: files, symbols, components, rules, pull requests, and packages linked to memories

  • Bi-temporal edges: recorded time plus validity windows on every relation

  • Hierarchical rollups: file TLDRs feed module and project summaries

  • Heat and decay: recency, importance, and access rank memories; stale operational state is archivable

  • Workflow memory: reusable procedures with preconditions, verification, and failure modes

Retrieval v2

engineering_context and memory_search build candidates over the whole memory database instead of starting from tag matches. Lexical, dense, path, symbol, tag, and two-hop relation signals are fused, then the deterministic scope and type precedence decides the final order. Tags are a boost; a memory without the requested tag can still surface when the task, code path, or a relation makes it relevant.

Temporal claims:

totem create --type gotcha --title "Old queue" --statement "..." --tags queue \
  --valid-from 2026-01-01T00:00:00Z --valid-to 2026-02-01T00:00:00Z
totem context --tags queue --as-of 2026-01-15T00:00:00Z

Feedback and learning:

totem feedback <id> --signal useful --query "retry queue" --tags queue
totem models train --min-examples 24
totem models status

memory_train_models fits a linear reranker over candidate features and a conformal calibrator over claim features. It refuses to train until feedback has both positive and negative examples, so the learned path stays advisory.

Consolidation is dry-run by default:

totem consolidate --threshold 0.92
totem consolidate --threshold 0.92 --apply

Context returns abstained: true with an empty body when no memory clears the score threshold (TOTEM_ABSTAIN_SCORE, default 0.12). Critical classes, path matches, and stale knowledge still surface.

File-state memory

File reads and writes can store one current-state TLDR per file instead of a change log. The TLDR is deterministic and keyed by the file content hash:

totem file-context src/auth.py

The result includes tldr, symbols, blobHash, and fresh. An unchanged file returns fresh: true without writing. A changed file returns changed: true and refreshes the same memory. This is the intended cache for avoiding re-reads: check fresh before asking the model to read the whole file.

memory_session_summary stores one compact summary per work session, keyed by session_id; repeated calls update the same record.

Legacy file-change records can be converted in place:

totem files backfill
totem files backfill --apply --prune-missing

File-state TLDRs are excluded from generic memory_search results. Pass --include-file-state when you want them.

Optional static embeddings

The default dense leg is dependency-free. For better paraphrase and vocabulary recall, install the optional static encoder:

pip install 'totem-mcp[embeddings]'
totem models pull          # downloads and warms potion-retrieval-32M
totem models status

minishlab/potion-retrieval-32M is a 32M Model2Vec model: CPU-only, numpy based, no torch. It is downloaded from Hugging Face on first use. Configure it with environment variables:

Variable

Values

Meaning

TOTEM_EMBEDDING_BACKEND

auto (default), model2vec, hash

auto uses Model2Vec when installed, otherwise the hash encoder.

TOTEM_EMBEDDING_MODEL

Hugging Face id or directory

Defaults to minishlab/potion-retrieval-32M.

TOTEM_EMBEDDING_LOCAL

local directory

Pre-pulled model path; wins over the model id for offline installs.

If the package or model cannot be loaded, Totem falls back to the hash encoder and reports the reason from totem models status.

How it works

Project and user memory flow into the context compiler, which hands the agent scored, provenance-aware context.

             ┌─────────────────┐
             │   User facts    │
             └────────┬────────┘
                      │
             ┌────────▼────────┐
             │     Project     │
             │      memory     │
             └────────┬────────┘
                      │
       ┌──────────────┼──────────────┐
       │              │              │
   evidence       relations     provenance
       │              │              │
       └──────────────┼──────────────┘
                      │
             ┌────────▼────────┐
             │ context compiler│
             └────────┬────────┘
                      │
             ┌────────▼────────┐
             │      agent      │
             └─────────────────┘
Agent reads file for the first time
  → commit-gate blocks → agent registers read → memory stored → done

Agent reads file again (memory exists)
  → blocked → redirected to memory tools
  → searches memory → finds context → done

Agent writes a file
  → commit-gate blocks → agent registers write with reason → change documented → done

Agent reads file but finds nothing in memory
  → allowed to read → commit-gate requires registration → done

Setup

OpenCode

Add to ~/.config/opencode/opencode.json (or let npx @emiliano-go/totem write it):

{
  "plugin": ["@emiliano-go/totem"],
  "mcp": {
    "totem": {
      "type": "local",
      "command": ["uvx", "totem-mcp==<version>"],
      "enabled": true
    }
  }
}

The installer pins <version> to the npm package version and pre-warms the uvx cache, so agent startups use the cached environment and never hit the network.

Claude Code

claude mcp add totem -- totem-mcp

Kimi Code

MCP server and hooks are auto-configured by npx @emiliano-go/totem: the MCP server goes in user-level ~/.kimi-code/mcp.json (every project), and the hooks go in ~/.kimi-code/config.toml.

Manual setup

If you prefer manual configuration:

# Initialize totem in your project
totem init

# For a different project
totem init --project /path/to/other

Quick start

MCP tools (from your agent)

# Store a decision
memory_create_tool(type="decision", title="Use FTS5 for search",
  statement="SQLite FTS5 is sufficient for our search needs",
  tags=["search", "sqlite"],
  metadata={"rationale": "No external dependency needed"})

# Get full context for a task
engineering_context_tool(tags=["api", "database"],
  current_task="Adding JWT refresh endpoint")

# Search memory
memory_search_tool(query="authentication", tags=["auth"])

# Store a command outcome
memory_create_tool(type="gotcha", title="uv pip install -e . works",
  statement="Editable install works with uv pip on PEP 668 systems",
  tags=["cmd:uv-pip-install", "python"])

CLI

# Create a memory item
totem create --type decision --title "Use FTS5 for search" \
  --statement "SQLite FTS5 is sufficient for our search needs" \
  --tags "search,sqlite" --metadata '{"rationale": "No external dependency needed"}'

# Search
totem search --query "FTS5" --tags "sqlite"

# Assemble context
totem context --tags "search,sqlite" --current-task "Implementing search" --budget 4096

# Export/import
totem export -o backup.json
totem import backup.json

# Check memory quality
totem quality

Memory types

Type

Purpose

Required metadata

decision

A choice that was made

rationale (recommended)

invariant

A rule that must hold

verificationMethod, condition

gotcha

A non-obvious pitfall

(none)

rejected_idea

A proposal declined

proposal, reasonRejected

assumption

A claim with epistemic status

claimCategory, basis

open_question

An unresolved question

question, impact, blocking

ambiguity

An ambiguous requirement

question, interpretations, impact

contract

Observable behavior

subject

constraint

Implementation restriction

constraint

hypothesis

Plausible explanation

hypothesis

observation

Something seen in code

observation

bug

A defect with state machine

symptom, severity, state

architecture

Component mapping

component, responsibility

implementation

Codebase facts

subject, kind, path

MCP tools (67)

Tool

Description

totem_init_tool

Initialize totem for a project

memory_create_tool

Create a memory item (warns on duplicate title)

memory_get_tool

Retrieve by ID with staleness check

memory_update_tool

Update any field (provides audit trail)

memory_delete_tool

Soft-delete (requires reason)

memory_list_tool

Filtered listing with sort and type/tag filters

memory_recent_tool

List recently created memories

memory_tasks_tool

List in-progress task memories (task:*)

memory_commands_tool

List command outcomes (cmd:*)

memory_search_tool

FTS5 full-text search with type/tag filters

resolve_conflict_tool

Mark conflict as resolved

engineering_context_tool

Scored context assembly with task relevance

memory_export_tool

Export all memories as JSON

memory_import_tool

Import memories from JSON (skips duplicates)

memory_gc_tool

Purge terminal-state memories past retention (dry-run default)

memory_quality_tool

Report signal ratio, provenance, stale evidence, conflicts, and digest composition

memory_aliases_tool

Add or list alternate phrasings

memory_provenance_tool

Add or list auditable sources

memory_coverage_tool

Inspect or update the extraction coverage ledger

memory_identity_tool

Find or merge duplicate claims

memory_argument_tool

Create, list, or simplify multi-premise arguments

memory_workflow_tool

Create or update a reusable procedure

memory_profile_tool

Write one always-on user profile block

memory_graph_tool

Show entities and the memories linked to them

memory_rollup_tool

Summarize file state into module and project memories

memory_heat_tool

Rank memories by recency, importance, and access

memory_touch_tool

Record that memories were read, feeding heat

memory_evidence_refresh_tool

Re-hash evidence, relocate symbols, and report orphaned paths

memory_decay_tool

Archive low-heat operational and episodic memories

memory_induce_workflow_tool

Turn a session summary into a workflow draft

memory_maintenance_tool

Run revalidation, rollup, decay, and consolidation

memory_export_markdown_tool

Export memories as Markdown notes

memory_import_markdown_tool

Import Markdown notes with wikilink relations

memory_verify_tool

Record that a memory was verified (sets verified_at/commit, confidence 1.0)

memory_revalidate_tool

Void verifications whose evidence changed

register_file_read_tool

Store facts learned from reading a file (auto-hashes)

register_file_write_tool

Register file changes with reason (auto-hashes)

*_create (14)

Typed wrappers for each memory type

flag_ambiguity

Convenience wrapper for ambiguity creation

CLI commands (46)

Command

Description

totem init

Initialize totem and install agent instructions

totem create

Create a new memory item

totem get <ID>

Retrieve by ID

totem update <ID>

Update an item

totem delete <ID>

Soft-delete (requires --reason)

totem list

List with filters

totem recent

List recently created memories

totem tasks

List in-progress task memories

totem commands

List command outcomes

totem resolve <ID>

Mark conflict as resolved

totem search

Full-text search

totem aliases

List or add alternate phrasings

totem provenance

List or add auditable sources

totem coverage

Inspect or update extraction coverage

totem identity

Find or merge duplicate claims

totem arguments

Create, list, or simplify argument chains

totem export

Export memories as JSON

totem import <FILE>

Import memories from JSON

totem gc

Purge terminal-state memories past retention (--apply)

totem verify <ID>

Record that a memory was verified

totem revalidate

Void verifications whose evidence changed (--apply)

totem context

Assemble scored context

Context assembly

Scoring formula:

score = 0.30*tag_match + 0.20*task_similarity + 0.25*importance
      + 0.15*confidence + 0.10*recency

Invariants, constraints, and ambiguities get a 1.25x multiplier. Potentially stale items get a 0.5x penalty.

Output sections (BLOCKING AMBIGUITIES, CONFLICTS, and STALE WARNINGS are never budget-truncated):

  1. TASK (if provided)

  2. BLOCKING AMBIGUITIES

  3. CONTEXT CONFLICTS

  4. CRITICAL CONSTRAINTS

  5. CRITICAL INVARIANTS

  6. RELEVANT CONTRACTS

  7. ARCHITECTURE

  8. DECISIONS

  9. KNOWN AMBIGUITIES (non-blocking)

  10. OBSERVATIONS

  11. GOTCHAS

  12. KNOWN BUGS

  13. HYPOTHESES

  14. CODEBASE FACTS

  15. OPEN QUESTIONS

  16. REJECTED IDEAS

  17. STALE KNOWLEDGE WARNINGS

Workspace scoping

totem auto-detects your project root via git rev-parse --show-toplevel. Override with --project <path> on any CLI command or project parameter on any MCP tool.

Hybrid memory

  • Project memories: .totem/totem.db

  • User memories: ~/.local/share/totem/totem.db

engineering_context searches both, with project memories taking precedence.

Trust and provenance

asserted_by records who asserted a claim (user, test, source, git, doc, runtime, agent); it is not a verification signal. Each provenance sets a default confidence: test 0.95, user/source/git/doc 0.9, runtime 0.7, agent 0.6 (hypotheses cap at 0.4). Nothing reaches 1.0 by provenance alone. A user-asserted claim is trusted, not proven.

Verification is separate and explicit. memory_verify (totem verify <ID>) records that a claim was checked: it sets verified_at and verified_commit (HEAD by default), raises confidence to 1.0, and writes a history event; an optional verified_by relation links the verification artifact. A verification holds only while its evidence still matches (truth maintenance: evidence is the premise, the verification the derived belief). When evidence changes, the verification is retracted and confidence drops back to its provenance default; memory_get does this on read, and memory_revalidate (totem revalidate) scans for it. The enforcement hook clears its verify:<file> gate only when a fresh verification record exists.

Deployment boundary

Totem is a single-user, local memory layer. It has no tenancy or authorization model, and this is intentional:

  • the user DB lives at ~/.local/share/totem/totem.db, owned by the OS user that runs totem (override with TOTEM_USER_DB);

  • the project DB lives in the project's .totem/ directory, scoped to whoever can read the checkout;

  • MCP tools run with the full privileges of that user.

Do not expose a totem MCP server to multiple untrusted users on one host, and do not point several OS users at one shared user DB. If you need multi-user isolation, run one totem instance (and one user DB) per user. The boundary is enforced by the filesystem and the OS user, not by totem itself.

Tag conventions

  • task:<name>: In-progress work. Query with memory_tasks_tool.

  • cmd:<command>: Command outcomes. Query with memory_commands_tool.

  • architecture:<module>: Structural facts about a module.

  • outcome:<what>: Measurable results (performance wins, bug fix impact, etc.).

Companion skill

The skills/precision-first/ directory contains a precision-first software engineering methodology designed to pair with totem.

Development

# Run JS tests
cd plugins/totem-enforce && node test-tokenize.js

# Run Python package tests
uv run pytest

# Run Python hook tests
cd plugins/totem-enforce && python3 test-enforce.py

License

MIT

Available Tools

62 tools
ambiguity_createC

Create an ambiguity memory. impact: low/medium/high/critical. high/critical = blocking.

Inputs: tags (required), title (required), impact (required), question (required), +5 more. Returns: result

architecture_createC

Create an architecture memory for component structure mapping.

Inputs: tags (required), title (required), component (required), statement (required), +7 more. Returns: result

assumption_createD

Create an assumption memory. classify: fact/assumption/hypothesis/guarantee.

Inputs: tags (required), basis (required), title (required), statement (required), +4 more. Returns: result

bug_createC

Create a bug memory. State machine: open→confirmed→fixed→verified.

Inputs: tags (required), title (required), symptom (required), severity (required), +7 more. Returns: result

constraint_createC

Create a constraint memory for implementation restrictions.

Inputs: tags (required), title (required), statement (required), constraint (required), +4 more. Returns: result

contract_createC

Create a contract memory for observable behavior of functions/APIs.

Inputs: tags (required), title (required), subject (required), statement (required), +7 more. Returns: result

decision_createA

Create a decision memory. Always provide rationale explaining WHY.

Inputs: tags (required), title (required), rationale (required), statement (required), +3 more. Returns: result

engineering_context_toolB

Assemble engineering context with output ordering.

Pipeline: tag match -> score -> sort -> truncate -> serialize. Conflicts and warnings are NEVER dropped for budget.

Args: tags: Tags to match against task: Optional task description (shown in output header) token_budget: Optional token budget for truncation types: Filter by memory types include_stale: Whether to include potentially stale items current_task: Description of what you're working on right now. Boosts scoring for memories relevant to this task. max_item_chars: Cap a single item so it cannot dominate the budget as_of: Evaluate temporal validity at this ISO timestamp include_expired: Include memories outside their validity window include_file_state: Include operational file-state TLDRs (default false) paths: Filter items whose evidence matches these file paths project: Optional project root path. Auto-detected from git root if omitted.

Inputs: tags (required), task, as_of, paths, +8 more. Returns: result

flag_ambiguityC

Flag an ambiguity. Convenience wrapper for ambiguity_create. impact: low/medium/high/critical.

Inputs: tags (required), title (required), impact (required), question (required), +3 more. Returns: result

gotcha_createC

Create a gotcha memory for non-obvious behaviors.

Inputs: tags (required), title (required), statement (required), details, +2 more. Returns: result

hypothesis_createB

Create a hypothesis memory. Never auto-promote to invariant/decision.

Inputs: tags (required), title (required), statement (required), hypothesis (required), +6 more. Returns: result

implementation_createC

Create an implementation memory for codebase facts (API, function, module, type, config, schema).

Inputs: kind (required), path (required), tags (required), title (required), +8 more. Returns: result

invariant_createD

Create an invariant memory. Requires verificationMethod and condition.

Inputs: tags (required), title (required), condition (required), statement (required), +4 more. Returns: result

memory_audit_toolC

Verify the history hash chain and each item's recorded state digest.

Inputs: project. Returns: result

memory_check_record_toolB

Record an observed check (command, exit code, output hash) for a memory.

Args: id: The memory item the check supports name: Short check name, e.g. "pytest tests/test_auth.py" command: The command that was run cwd: Working directory the command ran in exit_code: Observed exit code (0 is a pass) output: Optional captured output (hashed, not stored verbatim) output_hash: Pre-computed SHA256 of the output evidence_hash: Evidence digest the check ran against (defaults to now) commit: Git commit the check ran at (defaults to HEAD) ran_at: ISO timestamp of the run project: Optional project root path. Auto-detected from git root if omitted.

Inputs: id (required), name (required), cwd, commit, +7 more. Returns: result

memory_commands_toolA

List command outcome memories (gotchas tagged with cmd:*).

Args: limit: Maximum items to return (default 20) project: Optional project root path. Auto-detected from git root if omitted.

Inputs: limit, project. Returns: result

memory_consolidate_toolA

Cluster near-duplicate memories and optionally supersede duplicates.

Args: apply: Apply the consolidation (default is a dry run) threshold: Cosine similarity needed to join a cluster (default 0.92) project: Optional project root path

Inputs: apply, project, threshold. Returns: result

memory_create_toolB

Create a new memory item.

Args: type: One of: decision, invariant, gotcha, rejected_idea, assumption, open_question, ambiguity, contract, constraint, hypothesis, observation, bug, architecture, implementation title: Short title for the memory statement: The factual claim being stored tags: At least one tag for categorization details: Optional additional details confidence: 0 to 1; derived from asserted_by when omitted (user 1.0, test 0.95, source/git/doc 0.9, runtime 0.7, agent 0.6; hypotheses cap at 0.4) importance: 0 to 1, default 0.5 evidence: List of evidence objects with path, startLine, endLine, contentHash related_memory_ids: IDs of related memory items metadata: Extra metadata. Decision items accept 'rationale' (strongly recommended: explain WHY this decision was made, alternatives considered). Invariant items require 'verificationMethod' and 'condition' asserted_by: Who established the claim: user, test, source, git, doc, runtime, agent (default agent) applicability: current, legacy, deprecated, planned (orthogonal to status) scope: user, project, path, task — or JSON {"kind": "...", "value": "..."} valid_from: ISO timestamp when the claim starts being true valid_to: ISO timestamp when the claim stops being true supersedes_id: ID of a memory this one replaces (marks it superseded) project: Optional project root path. Auto-detected from git root if omitted.

Inputs: tags (required), type (required), title (required), statement (required), +17 more. Returns: result

memory_decay_toolC

Archive low-heat operational and episodic memories past their TTL.

Inputs: days, dry_run, project, min_importance. Returns: result

memory_delete_toolB

Soft-delete a memory item. Reason is required.

Args: id: The memory item ID reason: Required reason for deletion project: Optional project root path. Auto-detected from git root if omitted.

Inputs: id (required), reason (required), actor, project, +3 more. Returns: result

memory_evidence_refresh_toolC

Re-hash evidence, relocate symbols, and report orphaned paths.

Inputs: ids, actor, dry_run, project, +1 more. Returns: result

memory_export_markdown_toolC

Export active memories as Markdown notes with wikilink relations.

Inputs: directory (required), project. Returns: result

memory_export_toolA

Export all memories and conflicts as portable JSON.

Args: project: Optional project root path. Auto-detected from git root if omitted.

Inputs: project. Returns: result

memory_feedback_list_toolC

List recorded retrieval feedback.

Inputs: id, limit, project. Returns: result

memory_feedback_toolC

Record whether a memory was useful, wrong, irrelevant, or stale.

Args: id: Memory item id signal: useful, wrong, irrelevant, verified, or stale query: Task or query the item was considered for tags: Tags supplied with that query weight: Relative weight in [0, 10] (default 1) project: Optional project root path

Inputs: id (required), signal (required), tags, query, +2 more. Returns: result

memory_file_context_toolA

Return and refresh a file's current-state TLDR, keyed by content hash.

Use this after reading a file to store what the file now does, or before a read to check whether a cached TLDR is still fresh. An unchanged file returns fresh: true without writing.

Args: path: File path, relative to the project or absolute reason: Why the file state was captured statement: Optional override for the generated TLDR details: Optional additional details tags: Extra tags refresh: Update the stored TLDR when the content changed title: Optional title override project: Optional project root path

Inputs: path (required), tags, title, reason, +4 more. Returns: result

memory_gc_toolA

Purge terminal-state memories older than a retention window.

Only superseded/invalidated/resolved items untouched for retention_days and not referenced by any relation are eligible. Defaults to dry-run.

Args: retention_days: Age threshold in days (default 90) dry_run: Report candidates without deleting (default True) project: Optional project root path. Auto-detected from git root if omitted.

Inputs: actor, dry_run, project, retention_days. Returns: result

memory_get_toolA

Retrieve a memory item by ID with staleness check.

Args: id: The memory item ID include_evidence: Whether to check evidence staleness (default True) project: Optional project root path. Auto-detected from git root if omitted.

Inputs: id (required), project, include_evidence. Returns: result

memory_graph_toolC

Return entities and the memories linked to them.

Inputs: limit, entity, project. Returns: result

memory_heat_toolC

Rank memories by recency, importance, and access.

Inputs: limit, project. Returns: result

memory_history_toolC

Show the immutable timeline of a memory: created, updated fields, deleted.

Inputs: id (required), project. Returns: result

memory_import_markdown_toolC

Import Markdown notes produced by memory_export_markdown.

Inputs: directory (required), project. Returns: result

memory_import_toolA

Import memories from a previously exported dict. Skips duplicate IDs.

Args: data: The export dict containing 'items' and optionally 'conflicts' project: Optional project root path. Auto-detected from git root if omitted.

Inputs: data (required), project. Returns: result

memory_induce_workflow_toolC

Turn one session summary into a reusable workflow draft.

Inputs: session_id (required), name, apply, project. Returns: result

memory_list_toolA

List memory items with optional filters.

Args: type: Filter by type (decision, invariant, gotcha, rejected_idea) tags: Filter by tags (items must have at least one) status: Filter by status (active, potentially_stale, invalidated) sort: Sort by 'created_at', 'updated_at' (default), or 'importance' limit: Maximum items to return (default 50) project: Optional project root path. Auto-detected from git root if omitted.

Inputs: sort, tags, type, limit, +2 more. Returns: result

memory_maintenance_toolC

Run revalidation, rollup, decay, and consolidation in one cycle.

Inputs: apply, project. Returns: result

memory_profile_toolC

Create or update one always-on user profile block in the user database.

Inputs: content (required), section (required), source. Returns: result

memory_quality_toolB

Report signal ratio, provenance, stale evidence, conflicts, and digest quality.

Inputs: project. Returns: result

memory_recent_toolA

List most recently created memories.

Args: limit: Maximum items to return (default 5) project: Optional project root path. Auto-detected from git root if omitted.

Inputs: limit, project. Returns: result

memory_relate_toolB

Create a typed relation between two memories.

Args: from_id: Source memory ID to_id: Target memory ID kind: supersedes, contradicts, invalidates, derived_from, verified_by, refines, depends_on, touches (supersedes/invalidates update the target status) valid_from: Optional ISO start of the relation validity window. valid_to: Optional ISO end of the relation validity window. source_episode: Optional session or episode id that recorded the edge. project: Optional project root path.

Inputs: kind (required), to_id (required), from_id (required), actor, +7 more. Returns: result

memory_relations_toolC

List the typed relations involving a memory.

Inputs: id (required), project. Returns: result

memory_revalidate_toolB

Void verifications whose evidence changed since they were made.

Args: dry_run: Report candidates without changing them (default True) project: Optional project root path. Auto-detected from git root if omitted.

Inputs: actor, dry_run, project. Returns: result

memory_rollup_toolC

Summarize file-state memories into module and project memories.

Inputs: apply, project, min_files, path_prefix. Returns: result

memory_search_toolB

Hybrid tag + full-text search.

Args: query: Search query (full-text via Turso FTS5) types: Filter by memory types tags: Filter by tags include_stale: Whether to include potentially stale items limit: Maximum results (default 20) as_of: Evaluate temporal validity at this ISO timestamp include_expired: Include memories outside their validity window include_file_state: Include operational file-state TLDRs (default false) project: Optional project root path. Auto-detected from git root if omitted.

Inputs: query (required), tags, as_of, limit, +5 more. Returns: result

memory_session_summary_toolA

Create or update one compact summary for a work session.

Args: session_id: Stable session id; repeat calls update the same record summary: One or two sentences describing what changed and why files: Changed file paths tools: Tool names used in the session commit: Git commit, defaults to HEAD title: Optional title override reason: Optional reason for the update project: Optional project root path

Inputs: summary (required), session_id (required), files, title, +4 more. Returns: result

memory_tasks_toolA

List in-progress task memories (tagged with task:*).

Args: limit: Maximum items to return (default 10) project: Optional project root path. Auto-detected from git root if omitted.

Inputs: limit, project. Returns: result

memory_touch_toolB

Record that memories were read, feeding the heat score.

Inputs: ids (required), project. Returns: result

memory_train_models_toolC

Fit the reranker and calibrator from recorded feedback.

Inputs: project, min_examples. Returns: result

memory_update_toolB

Update a memory item. Reason is optional but strongly recommended.

Args: id: The memory item ID reason: Why this update was made (strongly recommended for audit trail; defaults to 'maintenance') title: New title statement: New statement details: New details tags: New tags status: New status (active, potentially_stale, invalidated, resolved, superseded) confidence: New confidence (0-1) importance: New importance (0-1) evidence: New evidence list metadata: New metadata valid_from: New validity start (empty string clears it) valid_to: New validity end (empty string clears it) project: Optional project root path. Auto-detected from git root if omitted.

Inputs: id (required), tags, actor, title, +14 more. Returns: result

memory_verify_toolA

Record that a memory was verified: sets verified_at and verified_commit.

Verification, not provenance, is what earns confidence 1.0. Pass check_id from memory_check_record_tool for evidence-derived verification; without it the verification is recorded as an assertion.

Args: id: The memory item ID to mark verified method: How it was verified (stored in history) commit: Git commit verified at (defaults to HEAD) confidence: Confidence to set (default 1.0) verified_by_id: Optional memory ID holding the verification artifact check_id: Recorded check ID that justifies the verification project: Optional project root path. Auto-detected from git root if omitted.

Inputs: id (required), actor, commit, method, +7 more. Returns: result

memory_workflow_toolC

Create or update a reusable procedure with steps and verification.

Inputs: name (required), steps (required), tags, scope, +6 more. Returns: result

observation_createC

Create an observation memory. Never auto-promote to invariant/decision.

Inputs: tags (required), title (required), statement (required), observation (required), +4 more. Returns: result

open_question_createC

Create an open question memory. impact: low/medium/high/critical.

Inputs: tags (required), title (required), impact (required), blocking (required), +5 more. Returns: result

register_file_read_toolA

Register facts learned from reading a file. Auto-hashes content, updates existing or creates new.

Call this after reading a file to store what you learned. Prevents re-reading the same file in future sessions.

Args: path: File path (e.g. 'src/auth.py') statement: What you learned (e.g. 'getUser() returns User | null, takes user_id: int') subject: What the fact is about (e.g. 'getUser()') kind: What kind of code fact (api/function/module/type/config/schema) tags: Tags for categorization start_line: Optional line range start (auto-detected if omitted) end_line: Optional line range end (auto-detected if omitted) title: Optional title (defaults to 'File: {filename}') details: Optional additional details symbol: Optional symbol the fact is about (e.g. 'UserService.authenticate'); makes evidence survive line moves project: Optional project root path. Auto-detected from git root if omitted.

Inputs: kind (required), path (required), tags (required), subject (required), +7 more. Returns: result

register_file_write_toolA

Register a file write/modification. Auto-hashes content, updates existing or creates new.

Call this after editing or writing a file to document what changed and why. The commit-gate hook will block all other tools until you register the write.

Args: path: File path (e.g. 'src/auth.py') statement: What changed (e.g. 'Added input validation to getUser()') reason: Why the change was made (e.g. 'Fix: getUser() crashed on null input') tags: Tags for categorization start_line: Optional line range start end_line: Optional line range end title: Optional title (defaults to 'File: {filename}') details: Optional additional details symbol: Optional symbol the change touches project: Optional project root path. Auto-detected from git root if omitted.

Inputs: path (required), tags (required), reason (required), statement (required), +6 more. Returns: result

rejected_idea_createB

Create a rejected idea memory. Prevents re-proposing dead ends.

Inputs: tags (required), title (required), proposal (required), statement (required), +4 more. Returns: result

resolve_conflict_toolC

Mark a conflict as resolved.

Args: conflict_id: The conflict ID resolution: Description of how the conflict was resolved (e.g. 'Kept existing: X') project: Optional project root path. Auto-detected from git root if omitted.

Inputs: resolution (required), conflict_id (required), actor, project, +3 more. Returns: result

totem_embedding_status_toolB

Report the configured retrieval encoder and its fallback state.

Inputs: no named parameters. Returns: result

totem_eval_toolB

Evaluate context ranking on a golden case file (or an auto smoke set).

Args: cases_file: JSON file of cases; omitted means derive cases from memories k: Cutoff for recall@k baseline_file: Optional prior report to gate against tolerance: Allowed recall/MRR regression p95_ms: Latency budget for the gate project: Optional project root path

Inputs: k, p95_ms, project, tolerance, +2 more. Returns: result

totem_init_toolA

Initialize totem for a project. Creates .totem/ directory and DB if missing.

Args: project: Optional project root path. Auto-detected from git root if omitted.

Inputs: project. Returns: result

totem_manifest_toolC

Return the stable digest of the registered tool surface.

Inputs: no named parameters. Returns: result

totem_validate_models_toolD

Gate the calibrated trust head on a temporal held-out slice.

Inputs: project, min_test, tolerance. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.4/5.0

    Scored across 62 tools

    Disambiguation2/5

    A generic memory_create_tool that accepts all 14 memory types coexists with 14 type-specific create tools (contract_create, bug_create, assumption_create, etc.), so an agent cannot tell which path is canonical. Several other clusters overlap heavily: register_file_read_tool vs memory_file_context_tool, flag_ambiguity vs ambiguity_create, memory_export_tool vs memory_export_markdown_tool, and a fleet of list/search variants (memory_list_tool, memory_recent_tool, memory_tasks_tool, memory_commands_tool, memory_search_tool, memory_heat_tool). Descriptions mitigate some confusion, but boundaries are genuinely blurry in many places.

    Naming Consistency2/5

    Conventions are mixed: noun_verb forms (contract_create, memory_relate_tool), verb_noun forms (flag_ambiguity, resolve_conflict_tool, register_file_write_tool), and a large block carrying a redundant _tool suffix (memory_get_tool, totem_init_tool) next to ones without it (contract_create, memory_workflow_tool is suffixed but memory_feedback_tool vs contract_create are inconsistent). No single predictable pattern lets an agent guess a name.

    Tool Count1/5

    At 62 tools this is far past a workable agent surface, and several are internal evaluation/training utilities (totem_eval_tool, totem_validate_models_tool, memory_train_models_tool, totem_manifest_tool, totem_embedding_status_tool) that do not belong in everyday tool selection. Many operations should have been consolidated (one create tool with a type parameter, one export/import pair, one list tool with filters).

    Completeness5/5

    The lifecycle is essentially exhaustive: create/get/update/delete for memories, typed relations, history, verification and check recording, evidence refresh, revalidation, GC, consolidation, maintenance, audit/quality reporting, feedback, and both JSON and Markdown export/import. No obvious operation is missing for a persistent engineering-memory domain.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Gives AI coding agents persistent, evolving knowledge about a codebase, enabling them to store and retrieve observations about architecture, conventions, gotchas, and recent work context.
      10
      48 npm
      3
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Provides persistent, searchable memory and knowledge capture for AI-assisted development, enabling agents to retain decisions, bugs, and patterns across sessions and projects.
      69 PyPI
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP agents to maintain durable, evidence-aware project knowledge, retrieve precise excerpts on demand, and track decisions, conflicts, and revisions across sessions.
      1
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI coding agents to create, search, read, write, and manage persistent structured repository context such as facts, decisions, regressions, preferences, sessions, and changelog entries. This helps agents orient themselves, avoid repeating past mistakes, and retain knowledge across coding sessions.
      136 npm
      2
      MIT