Memory Sync to Vector DB

VerifiedCaution

Sync all files in .claude/memory/ to pgvector database, with incremental updates and embedding generation.

Sby Skills Guide Bot
Data & AIIntermediate
7/27/2026
Claude Code
#memory-sync#pgvector#database#embedding

Recommended for

Automated summary

Synchronizes the `.claude/memory/` folder with a pgvector database, updating embeddings accordingly.

Strengths

  • Incremental update (only changed files are processed)
  • Removes orphaned embeddings
  • Uses content hashing to detect modifications

Limitations

  • Requires a configured pgvector database and OpenAI API key
  • Does not support other vector databases
  • Embeddings are fully regenerated for modified files
When to use it

When you manually edit memory files and need the vector database to reflect those changes.

When not to use it

If you do not use pgvector or require bidirectional sync.

Security analysis

Caution
Quality score90/100

The skill instructs the agent to run a bash command that executes a Node.js script for database synchronization. While the described purpose is legitimate and no overtly destructive actions are visible, the script is not included for review, and its execution could potentially read or write sensitive data. Using bash without declared tools introduces power that warrants caution.

Findings
  • •Executes a script via bash, which has access to sensitive environment variables (database credentials, OpenAI API key) and can perform arbitrary operations on the host.
  • •The skill does not declare any allowed tools, but implicitly requires bash execution.
How this analysis is made

Examples

Trigger memory sync
/memory-sync

description: "/memory-sync - DB 동기화" keywords: [memory, sync, 동기화, pgvector, DB] argument-hint: "옵션 없이 실행"

/memory-sync - DB 동기화

.claude/memory/ 폴더의 모든 파일을 pgvector DB에 동기화합니다.

사용법

/memory-sync

동기화 로직

  1. memory/ 폴더 스캔 → 파일 목록 + content_hash 계산
  2. DB에서 기존 file_path, content_hash 조회
  3. 비교:
    • 새 파일 → INSERT (임베딩 생성 포함)
    • hash 변경 → DELETE all chunks + re-INSERT
    • 파일 삭제됨 → DELETE
  4. 변경된 파일만 임베딩 생성

환경변수 필요

.env.ai 파일에 다음 환경변수가 필요합니다:

# Vector DB
AI_VECTOR_DB_HOST=localhost
AI_VECTOR_DB_PORT=5432
AI_VECTOR_DB_USER=postgres
AI_VECTOR_DB_PASSWORD=yourpassword
AI_VECTOR_DB_NAME=ai_memory

# OpenAI API
OPENAI_API_KEY=sk-...

Instructions for Claude

사용자가 /memory-sync를 실행하면:

  1. Bash 도구로 sync-db.mjs 스크립트를 실행합니다:
node .claude/hooks/memory/sync-db.mjs
  1. 동기화 결과를 사용자에게 보고합니다:
    • 추가된 파일 수
    • 수정된 파일 수
    • 삭제된 파일 수

사용 시나리오

  • memory 파일을 직접 편집한 후 DB 업데이트
  • 초기 세팅 후 최초 데이터 로드
  • DB와 파일 시스템 동기화 확인

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/memory-sync-to-vector-db-ms2s7cr4/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/memory-sync-to-vector-db-ms2s7cr4' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/memory-sync-to-vector-db-ms2s7cr4/download' --output '.skill-downloads/memory-sync-to-vector-db-ms2s7cr4/SKILL.md.part' && mv '.skill-downloads/memory-sync-to-vector-db-ms2s7cr4/SKILL.md.part' '.skill-downloads/memory-sync-to-vector-db-ms2s7cr4/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

This file does not provide a usable name/description header for this native procedure. It remains available to download and inspect; use the manual method below.

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/memory-sync-to-vector-db-ms2s7cr4/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills