agentleFS
LotargoLotargo/memory_plugin/skills/using-memory/SKILL.md

using-memory

Skill2 starsChanged 3 months agoMITView on GitHub

Persistent dual-layer memory engine with Notebook facts, curated RAG knowledge base, agent-driven knowledge graph, and general MCP helpers. Trigger proactively whenever user preferences, project conventions, technology stack choices, or architecture decisions are introduced, or when querying ingested documentation, indexing files/repos, managing persistent knowledge, looking up available MCP tool integrations, or handling ML model memory requests (CPU/RAM ↔ GPU/VRAM, idle auto-unload).

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. liujiarui0918/claude-code-codex-strongest★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 1 is distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow this exact sequence at the start of every session:

    line 18
  2. Very specific:

    Call memory_info for the current workspace.

    line 22
  3. Very specific:

    If it reports Identity: git and Registry: unlinked, immediately call link_project_memory for the current directory.

    line 23
  4. Very specific:

    If the link result reports migrated: true, call recall(scope: "all") again so the migrated facts enter the active context.

    line 24
  5. Very specific:

    If it reports Identity: no-git, do not create project memory and do not invent a remote.

    line 25
  6. Very specific:

    Ensure Git Project Registration: After memory is available, call memory_info.

    line 73
  7. Very specific:

    Be Proactive: When the user mentions a durable preference, personal fact, or constraint, save it immediately using remember with the …

    line 74
  8. Very specific:

    Check Knowledge Base First: If a query depends on ingested specialized documentation, APIs, code, or project architecture, call …

    line 76
  9. Very specific:

    Inspect Ambiguous Docs Directly: If querying produces low relevance scores on abstractly named documents, call …

    line 78
  10. Very specific:

    Keep Memory Clean: If a preference changes, call update_fact to edit it in place, or remember with supersedes to keep a version trail.

    line 79
  11. Very specific:

    Leverage MCP Servers: Use list-mcp-tools and mcp-reminder when unsure which connected platform tool fits the task.

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Using Memory, Hybrid RAG Knowledge Engine & MCP Helper Tools

You have access to a persistent dual-layer memory engine supercharged with an Agent-Driven Knowledge Graph and general MCP integration helpers:

  1. Layer 1: Notebook Store (Key-Value Facts): Stores high-signal personal preferences, project conventions, and durable rules in clean Markdown.
  2. Layer 2: Curated RAG Knowledge Base: Preserves selected external findings, documentation, repositories, and technical guides that are likely to matter again.
  3. Layer 3: Agent-Driven Knowledge Graph: Connects Notebook facts (Layer 1) to specific Knowledge Base documents, sections, and exact line ranges (Layer 2).
  4. Integration Layer (General MCP Helpers): Quickly discovers connected MCP servers and identifies appropriate tools for specific tasks.

Session Initialization (MANDATORY)

Follow this exact sequence at the start of every session:

  1. If the client has already supplied an auto-injected <MEMORY> block (native OpenCode), treat the active memory as loaded and do not call recall again merely for initialization. In clients without auto-injection, your very first step MUST be recall(scope: "all") with no restrictive filters — never mode: "headers". The default result is bounded: global facts and active directives are complete, project facts are the 10 newest (newest first) and the response states how many older ones are not shown. Treat the newest project facts as the current state and request more only when the task needs history: recall(offset=…) for the next page, recall(limit=0) for everything, or recall(query=…).
  2. Apply entries marked kind: "directive" as active user-selected personalization or working instructions. Treat kind: "fact" entries as descriptive context.
  3. Call memory_info for the current workspace.
  4. If it reports Identity: git and Registry: unlinked, immediately call link_project_memory for the current directory.
  5. If the link result reports migrated: true, call recall(scope: "all") again so the migrated facts enter the active context.
  6. If it reports Identity: no-git, do not create project memory and do not invent a remote; continue with global memory only.

1. Tool Selection Decision Matrix

Scenario / IntentTarget ToolKey Parameters
User shares identity, tech stack preference, or workflow rulerememberfact (English), title (concise 2-5 word headline), kind (fact context or directive active instruction), scope, optional directory (workspace path), docId, startLine, endLine
User asks what you remember about them, the project, or linked docsrecallscope ("all", "global", "project", "list_projects"), mode ("full", "headers"), offset, limit, optional query, tags, since, until, directory / project (at session start in clients without auto-injection, MUST call it once with scope: "all" and no query filters; project facts then arrive as the 10 newest, so use offset, limit (0 = everything) or query when you need older ones)
Get a single fact's text and metadata by IDget_factid (metadata id e.g. "8f3a2c"), scope, optional directory
User corrects/updates or reclassifies an old saved factupdate_factid (number/id/text), newText, optional kind, scope, optional directory
Replace a fact but keep a version trailrememberfact, supersedes (number/id/text), optional directory
Protect a fact from accidental forgetrememberkeep: true
Set a time-to-live on a factrememberttl ("90d", "2w", "24h", "12m")
Filter facts by keyword / tags / daterecallquery, tags, since, until, optional directory
Show storage paths, versions, fact & RAG stats, git identitymemory_infooptional directory
Connect a Notebook fact to a document, section, or line rangelink_knowledgeaction ("link", "list_links", "get_doc_links"), factText, docId, startLine, endLine, relationType, optional directory
Register current Git project identity / migrate legacy storesmemory_info then link_project_memory when Registry: unlinkeddirectory, optional remote
Remove path alias or purge project identityunlink_project_memorydirectory, purge (boolean)
Move or merge project memories to new target identityrelink_project_memorydirectory, remote (target remote URL)
User asks to index a documentation URL, file, or repositoryingest_documentcontent (text/file path/URL), type ("text", "file", "url"), title, path, scope (project default), optional directory
User asks a complex question about indexed docs or codequery_knowledge_basequery, scope (all default), limit, instruction, generateEmbeddings, optional directory
User needs multiple queries executed in batch (comparisons, multi-topic)batch_query_knowledge_basequeries (array), scope (all default), limit, instruction, generateEmbeddings, optional directory
Read full raw content of an ambiguous/abstract documentmanage_knowledge_baseaction: "read_document", docId
View DB stats, list indexed docs, read/delete docs, export/import snapshotsmanage_knowledge_baseaction ("stats", "list", "read_document", "delete", "export_snapshot", "import_snapshot"), docId, snapshotPath, optional directory
Re-embed all documents after switching embedding model / dimensionreindex_knowledge_basemodel, dimension (optional; defaults to active config)
Discover available MCP servers and their specific purposeslist-mcp-tools—
Ask which MCP tool / server is suitable for a specific taskmcp-remindertask (string, e.g., "db migration")

Detailed References

Load the relevant reference file only when the task requires details beyond the matrix above:

ReferenceContents
references/notebook.mdWhat to save, kind semantics, formatting, targeting project directory, linking to KB documents, fact line format & metadata, remember options, filtering & viewing, scope isolation & conflicts, update_fact, forget/keep, project identity management (link_project_memory, unlink_project_memory, relink_project_memory), memory_info diagnostics
references/rag.mdingest_document parameters & examples, scope isolation, shared sources, stable updates, hierarchy chunking, hybrid retrieval (query_knowledge_base), batch retrieval (batch_query_knowledge_base), query formulation rules (CRITICAL), reading ambiguous/abstract documents, manage_knowledge_base actions, reindex_knowledge_base
references/knowledge-graph.mdAgent-Driven Knowledge Graph architecture, how linked memory appears, linking strategies, relation types
references/mcp-helpers.mdlist-mcp-tools for discovering connected MCP servers, mcp-reminder for contextual tool reminders
references/models.mdML model memory management via memory-cli models — moving/unloading embedding & reranker models between CPU/RAM and GPU/VRAM, checking VRAM usage, configuring idle auto-unload

5. Core Directives for AI Agents

  1. Load Memory First (MANDATORY): At the very start of a session, use an auto-injected <MEMORY> block when present (native OpenCode) and do not duplicate it with a startup recall. In clients without auto-injection, your VERY FIRST STEP MUST BE recall(scope: "all") with no restrictive filters. Do not use mode: "headers" for initialization. Global facts and active directives arrive complete; project facts arrive as the 10 newest and the response states how many older ones are not shown. Fetch older ones yourself only when the task needs history.
  2. Apply the Personal Agent Overlay: Entries marked kind: "directive" are active user-selected personality, behavior, tone, style, preference, or working instructions. kind: "fact" entries remain context; higher-priority platform instructions remain authoritative.
  3. Ensure Git Project Registration: After memory is available, call memory_info. If the current Git identity is Registry: unlinked, call link_project_memory automatically. Re-run full recall only when legacy facts were migrated. Outside Git, stay global-only.
  4. Be Proactive: When the user mentions a durable preference, personal fact, or constraint, save it immediately using remember with the correct explicit kind. Do not wait for explicit user commands.
  5. Curate RAG Selectively: Preserve important web findings and current technical documentation that the project is likely to need again, especially knowledge newer than model training. Ingest the relevant whole source or excerpt with project scope, not everything encountered, and link it to the project fact it supports. Use global scope only for intentionally cross-project sources.
  6. Check Knowledge Base First: If a query depends on ingested specialized documentation, APIs, code, or project architecture, call query_knowledge_base using a concept-dense phrase. Do not use RAG for ordinary conversation or facts already present in Notebook memory. For multi-part queries, prefer batch_query_knowledge_base.
  7. Optimize Search Queries: Transform the user's natural language question into targeted search queries. "Compare revenue in Q1 vs Q3" → ["Выручка план факт Q1 2025", "Выручка план факт Q3 2025"]. Avoid raw conversational questions in RAG queries.
  8. Inspect Ambiguous Docs Directly: If querying produces low relevance scores on abstractly named documents, call manage_knowledge_base(action: "list"), then manage_knowledge_base(action: "read_document") to inspect the full text.
  9. Keep Memory Clean: If a preference changes, call update_fact to edit it in place, or remember with supersedes to keep a version trail. Use keep: true for facts that must survive accidental deletion, and give ephemeral facts a ttl.
  10. Resolve Context, Do Not Enforce Store Precedence: Global and current-project facts are both evidence. If they conflict, reason over both; do not apply an automatic global-wins or project-wins rule.
  11. Leverage MCP Servers: Use list-mcp-tools and mcp-reminder when unsure which connected platform tool fits the task.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.