Our review
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 you manually edit memory files and need the vector database to reflect those changes.
If you do not use pgvector or require bidirectional sync.
Security analysis
CautionThe 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.
- •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.
Examples
/memory-syncdescription: "/memory-sync - DB 동기화" keywords: [memory, sync, 동기화, pgvector, DB] argument-hint: "옵션 없이 실행"
/memory-sync - DB 동기화
.claude/memory/ 폴더의 모든 파일을 pgvector DB에 동기화합니다.
사용법
/memory-sync
동기화 로직
- memory/ 폴더 스캔 → 파일 목록 + content_hash 계산
- DB에서 기존 file_path, content_hash 조회
- 비교:
- 새 파일 → INSERT (임베딩 생성 포함)
- hash 변경 → DELETE all chunks + re-INSERT
- 파일 삭제됨 → DELETE
- 변경된 파일만 임베딩 생성
환경변수 필요
.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를 실행하면:
- Bash 도구로 sync-db.mjs 스크립트를 실행합니다:
node .claude/hooks/memory/sync-db.mjs
- 동기화 결과를 사용자에게 보고합니다:
- 추가된 파일 수
- 수정된 파일 수
- 삭제된 파일 수
사용 시나리오
- memory 파일을 직접 편집한 후 DB 업데이트
- 초기 세팅 후 최초 데이터 로드
- DB와 파일 시스템 동기화 확인
Prompt Engineering
Data & AI
Prompt engineering best practices and templates to maximize AI outputs.
Data Visualization
Data & AI
Generates data visualizations and charts tailored to your data.
RAG Architecture Setup
Data & AI
Setup guide for RAG (Retrieval-Augmented Generation) architectures.