agentleFS
Yash-SukhdeveYash-Sukhdeve/universal-workflow-system/.claude/skills/vector-memory/SKILL.md

vector-memory

Skill0 starsChanged 45 days agoMITView on GitHub

UWS vector-memory protocol for the mcp__vector_memory_local and mcp__vector_memory_global servers. Use when storing a memory (phase completion, bug resolution, agent handoff, verification), searching memories at session resume, choosing a category or tag, or doing memory maintenance, recovery or category migration.

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. cablate/ai-toolkit★ 15same 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.

  • In this repository10 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. About 0 are common, 14 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After storing a bug-fix or architecture memory to local DB, the memory-gate skill auto-invokes (via description matching) to evaluate 3 …

    line 63
  2. Very specific:

    If any fail, local only. See .claude/skills/memory-gate/SKILL.md.

    line 66
  3. Distinctive:

    Before asserting facts about prior phases: mcp__vector_memory_local__search_memories("<claim>", limit=3) If relevant result found: cite as …

    line 78
  4. Distinctive:

    If relevant result found: cite as supporting evidence.

    line 80
  5. Distinctive:

    If no result: say "No prior record" and verify from files.

    line 81
  6. Distinctive:

    Never cite vector memory as sole evidence.

    line 82
  7. Very specific:

    Use hyphens, NOT colons in tags: phase-2 (correct), phase:2 (dropped by server).

    line 113
  8. Distinctive:

    IF total > 500: mcp__vector_memory_local__clear_old_memories( days_old=60, max_to_keep=500)

    line 119
  9. Distinctive:

    IF total > 200: Review manually.

    line 124
  10. Distinctive:

    DO NOT use days_old for global -- old lessons are still valid.

    line 125
  11. Distinctive:

    Only use max_to_keep=200 as safety cap.

    line 126
  12. Distinctive:

    Not catastrophic -- markdown/YAML files are source of truth.

    line 131
  13. Distinctive:

    Check mcp__vector_memory_local__get_memory_stats() for memory count.

    line 142
  14. Distinctive:

    If memories from future phases exist, they may cause confusion.

    line 143
  15. Distinctive:

    If categories need to change in the future:

    line 155
  16. Distinctive:

    Delete the DB file: rm <working_dir>/memory/vector_memory.db (clear_old_memories cannot wipe all: min days_old=1, min max_to_keep=100)

    line 159
  17. Distinctive:

    Keep category taxonomy stable.

    line 162

≈ “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

Vector Memory Protocol

Overview

UWS uses two vector memory databases for semantic retrieval:

  • Local (mcp__vector_memory_local): Project-specific memories
  • Global (mcp__vector_memory_global): Cross-project generalizable lessons

Markdown/YAML files are ALWAYS the source of truth. Vector memory is a read-optimized index. If they conflict, delete the vector memory entry.

Atomic Memory Principle

Each store_memory() call: EXACTLY ONE idea, MAX 200 words. Prefix local memories with "PHASE <N> <methodology_phase> | DOMAIN: <domain> | " where <N> = UWS overall phase (1-5), <methodology_phase> = research/SDLC phase name Example: "PHASE 2 experiment_design | DOMAIN: training | ..." Prefix global memories with "<TOOL_OR_PATTERN>: "

When to Store (Behavioral Directives)

After completing a phase (on_phase_complete): For each key outcome and decision in the phase: mcp__vector_memory_local__store_memory( content="PHASE <N> <methodology_phase> | DOMAIN: <d> | CATEGORY: phase-summary | OUTCOME: <description>", category="learning", tags=["phase-<N>", "<domain>"]) For architectural decisions: category="architecture", content includes "CATEGORY: decision-adr"

After fixing a non-trivial bug (on_error_resolved): mcp__vector_memory_local__store_memory( content="PHASE <N> <methodology_phase> | DOMAIN: <d> | CATEGORY: bug-resolution | BUG: <symptom> ROOT_CAUSE: <cause> FIX: <fix> PREVENTION: <how>", category="bug-fix", tags=["phase-<N>", "bug", "<domain>"]) THEN run Generalizability Gate (see below).

After agent transition (on_agent_handoff): Outgoing agent stores: mcp__vector_memory_local__store_memory( content="PHASE <N> <methodology_phase> | DOMAIN: handoff | CATEGORY: agent-handoff | HANDOFF <from>-><to>. KEY_DECISIONS: <list> OPEN_ISSUES: <list>", category="other", tags=["phase-<N>", "agent-<from>", "agent-<to>", "handoff"]) Incoming agent queries: mcp__vector_memory_local__search_memories( query="decisions constraints phase <N>", category="architecture", limit=5)

After verification/test run (on_verification): mcp__vector_memory_local__store_memory( content="PHASE <N> <methodology_phase> | CATEGORY: verification | VERIFIED: <what> METHOD: <how> RESULT: <pass/fail> EVIDENCE: <summary>", category="other", tags=["phase-<N>", "verification"])

Generalizability Gate

After storing a bug-fix or architecture memory to local DB, the memory-gate skill auto-invokes (via description matching) to evaluate 3 questions. If all pass, an abstracted lesson is promoted to global DB. If any fail, local only. See .claude/skills/memory-gate/SKILL.md.

Session Resume (Enhanced)

At session start, after reading state.yaml and handoff.md: mcp__vector_memory_local__search_memories( query="blockers issues PHASE <current>", limit=5) mcp__vector_memory_local__search_memories( query="decisions PHASE <current>", category="architecture", limit=5) mcp__vector_memory_global__search_memories( query="<current technology/domain>", limit=3)

R1 Evidence Extension

Before asserting facts about prior phases: mcp__vector_memory_local__search_memories("<claim>", limit=3) If relevant result found: cite as supporting evidence. If no result: say "No prior record" and verify from files. Never cite vector memory as sole evidence.

Phase-End Distillation

At phase completion, run /phase-distillation <N> to review local memories from the completed phase. The skill consolidates recurring patterns, applies the generalizability gate, runs adversarial calibration (supersede false promotions), and promotes passing lessons to global DB. See .claude/skills/phase-distillation/SKILL.md.

Server-Accepted Categories

The MCP server accepts: code-solution | bug-fix | architecture | learning | tool-usage | debugging | performance | security | other

Custom categories are embedded in content strings via CATEGORY: <name> prefix.

Local category mapping (plan category -> server category):

  • phase-summary -> learning
  • decision-adr -> architecture
  • bug-resolution -> bug-fix
  • agent-handoff -> other
  • verification -> other
  • environment -> tool-usage

Global category mapping:

  • anti-pattern -> architecture
  • tool-gotcha -> bug-fix
  • design-lesson -> architecture
  • library-compat -> other
  • workflow-improvement -> other

Tag Format

Use hyphens, NOT colons in tags: phase-2 (correct), phase:2 (dropped by server).

Memory Maintenance

LOCAL DB (per phase completion): mcp__vector_memory_local__get_memory_stats() IF total > 500: mcp__vector_memory_local__clear_old_memories( days_old=60, max_to_keep=500)

GLOBAL DB (quarterly, manual review): mcp__vector_memory_global__get_memory_stats() IF total > 200: Review manually. Remove outdated lessons. DO NOT use days_old for global -- old lessons are still valid. Only use max_to_keep=200 as safety cap.

Recovery Procedures

Local DB lost:

  1. Not catastrophic -- markdown/YAML files are source of truth.
  2. Re-seed manually: read .workflow/handoff.md and .workflow/logs/decisions.log.
  3. For each decision/bug documented in handoff.md, store to local DB.
  4. Full re-indexing is manual but bounded by project size.

Global DB lost:

  1. Lessons may also exist in CLAUDE.md auto-memory (~/.claude/MEMORY.md).
  2. Re-seed from team documentation and known patterns.
  3. Global DB grows slowly (~5-10 lessons per project). Loss is recoverable.

Checkpoint restore (state reverts but vector DB does NOT):

  1. Check mcp__vector_memory_local__get_memory_stats() for memory count.
  2. If memories from future phases exist, they may cause confusion.
  3. Option A (recommended): Ignore -- stale memories with future phase prefixes (e.g., "PHASE 4") rank low when searching for current phase (e.g., "PHASE 2"). The content prefix convention handles this.
  4. Option B (nuclear): If contamination is severe, delete the DB file: rm <project_root>/memory/vector_memory.db Then re-seed from .workflow/handoff.md. NOTE: clear_old_memories() cannot wipe all entries (min days_old=1, min max_to_keep=100). Direct file deletion is the only full reset.

Category Migration

If categories need to change in the future:

  1. get_memory_stats() to get total count.
  2. list_recent_memories(limit=<total>) to export all entries.
  3. Record all memory content and categories externally.
  4. Delete the DB file: rm <working_dir>/memory/vector_memory.db (clear_old_memories cannot wipe all: min days_old=1, min max_to_keep=100)
  5. Re-store each memory with updated categories. Keep category taxonomy stable. Prefer adding new categories over renaming.

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.