---
name: "agent-memory-vector-retrieval"
description: "Persist and retrieve long-term episodic memories and user preferences with vector embeddings."
metadata:
  author: "MemGPT"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "retrieve agent memory"
  - "save user preference memory"
  - "index episodic memory"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Episodic & Semantic Agent Memory Vector Retrieval

Maintains long-term agent memory: indexing user preferences, past project decisions, and architectural rules in a vector store, performing similarity retrieval before answering new queries.

## When to Invoke
Invoke this skill whenever you need to:
- retrieve agent memory
- save user preference memory
- index episodic memory

## Execution SOP & Rules
1. Embed episodic memory statements using high-quality semantic embedding models.
2. Retrieve top-k relevant memories using cosine similarity against the incoming prompt.
3. Inject retrieved memories into the system context under a dedicated <relevant_memories> block.
4. Allow users to inspect, update, or purge stored memory records for privacy compliance.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
