프로젝트 소개
# opencode-supermemory
**OpenCode용 영구 메모리, [Supermemory](https://supermemory.ai) 기반**
이 플러그인은 OpenCode 에이전트에게 세션과 프로젝트 전반에 걸친 영구 메모리를 제공합니다. 관련 컨텍스트를 자동으로 주입하고, 대화 턴을 캡처하며, 메모리 저장 및 검색을 위한 도구를 제공합니다.
## 설치
```bash
bunx opencode-supermemory@latest install
bunx opencode-supermemory@latest login # 또는 SUPERMEMORY_API_KEY 설정
bunx opencode-supermemory@latest status # 연결 상태 확인
```
또는 OpenCode에 다음을 붙여넣으세요: `Install opencode-supermemory by following https://raw.githubusercontent.com/supermemoryai/opencode-supermemory/main/README.md`
채팅 내 명령어: `/supermemory-init`, `/supermemory-login`, `/supermemory-logout`, `/supermemory-status`.
## 기능
- **컨텍스트 주입**: 세션의 첫 메시지에서 에이전트는 프로필, 프로젝트 지식, 선택적으로 개인 메모리에 대한 의미론적 검색 결과를 받습니다.
- **추론 기반 회상**: 매 턴마다 에이전트는 답변 전에 메모리 회상이 도움이 될지 결정하며, 필요한 경우에만 `supermemory` 도구를 통해 검색합니다.
- **자동 캡처**: 완료된 턴은 `captureEveryNTurns` 턴마다 저장되며, 나머지는 세션 종료 시 플러시됩니다. `<private>` 콘텐츠는 삭제됩니다.
- **키워드 감지**: "remember", "save this", "don't forget"(또는 사용자 정의 패턴)을 말하면 에이전트가 메모리에 저장하도록 유도합니다.
- **코드베이스 인덱싱**: `/supermemory-init`은 코드베이스 구조, 패턴, 규칙을 탐색하고 기억합니다.
- **선제적 압축**: 컨텍스트 용량의 80%에서 요약을 트리거하고, 프로젝트 메모리를 요약에 주입하며, 요약을 메모리로 저장합니다.
- **개인정보 보호**: `<private>...</private>`로 감싼 콘텐츠는 절대 저장되지 않습니다.
- **업데이트 알림**: 세션 시작 시 npm에서 최신 릴리스를 확인합니다.
## 도구 사용법
`supermemory` 도구는 `add`, `search`, `profile`, `list`, `forget`, `help` 모드를 지원합니다. 범위: `user`(개인) 및 `project`(기본값). 유형에는 `project-config`, `architecture`, `error-solution`, `preference`, `learned-pattern`, `conversation`이 포함됩니다.
## 메모리 범위
메모리는 `repo_{프로젝트명}__{저장소 해시}`로 태그되고 `sm_scope`(개인 또는 프로젝트) 메타데이터가 포함됩니다. 해시는 정규화된 Git origin 원격 저장소에서 생성되므로 Claude Code, Codex, Cursor, OpenCode가 동일한 저장소에 대해 동일한 컨테이너를 공유합니다. 이전 버전의 레거시 컨테이너도 계속 읽을 수 있습니다.
## 구성
환경 변수: `SUPERMEMORY_API_KEY`, `SUPERMEMORY_API_URL`/`SUPERMEMORY_BASE_URL`, `SUPERMEMORY_AUTH_URL`, `SUPERMEMORY_AUTH_TIMEOUT`, `SUPERMEMORY_REPO_TAG`, `SUPERMEMORY_ISOLATE_WORKTREES`, `SUPERMEMORY_DEBUG`.
구성 파일 `~/.config/opencode/supermemory.jsonc`는 `similarityThreshold`, `maxMemories`, `injectProfile`, `autoRecallEveryPrompt`, `keywordPatterns`, `compactionThreshold`, `captureEveryNTurns`, `recallMode`(direct/advisory/off) 및 컨테이너 태그 재정의와 같은 옵션을 지원합니다.
## Oh My OpenCode와 함께 사용
충돌을 방지하려면 자동 압축 훅을 비활성화하세요: `~/.config/opencode/oh-my-opencode.json`에 `{"disabled_hooks": ["anthropic-context-window-limit-recovery"]}` 추가.
## 개발
```bash
bun install
bun run build
bun run typecheck
```
로그: `tail -f ~/.opencode-supermemory.log`
## 라이선스
MIT
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.