memory について
basic-memory を使う永続的なナレッジ保存スキルです。Markdown のノートをセッション間で保存し、セマンティック検索で取得できます。個人の記録、学習ログ、プロジェクトの文脈管理に向いています。
主な機能
- 01ノートの作成と読み取り
- 02ノートのセマンティック検索
- 03トピック別のコンテキスト構築
- 04タグとフォルダーによる整理
- 05同期とステータス確認
活用シーン
- 01コードスニペットやプロジェクトの決定事項を保存
- 02学習内容を記録し、トピック別に検索
- 03セッション開始時にプロジェクトの文脈を復元
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ johnlindquist/ claude --skill memoryインストール後、Claude Code で/memoryを入力して読み込まれたか確認します。
詳細
メモリ - 永続的なナレッジストレージ
セマンティック検索を使用して、セッションをまたいでナレッジを保存・取得します。
前提条件
basic-memory をインストールします:
pip install basic-memory
CLI リファレンス
ノートを書き込む
# Basic note
basic-memory tool write-note --title "Note Title" --content "Note content in markdown"
# With tags
basic-memory tool write-note --title "React Patterns" --content "# Content here" --tags "react,patterns,frontend"
# To specific folder
basic-memory tool write-note --title "Meeting Notes" --content "# Notes" --folder "meetings"
# With specific project
basic-memory tool write-note --title "Project Notes" --content "# Notes" --project myproject
ノートを読む
# By identifier/permalink
basic-memory tool read-note "note-title"
# From specific project
basic-memory tool read-note "note-title" --project myproject
メモリを検索する
# Semantic search (query is positional)
basic-memory tool search-notes "your search query"
# Limit results
basic-memory tool search-notes "react hooks" --page-size 10
# Search by permalink
basic-memory tool search-notes "pattern" --permalink
# Search by title
basic-memory tool search-notes "meeting" --title
# Filter by date
basic-memory tool search-notes "feature" --after_date "7d"
# With specific project
basic-memory tool search-notes "authentication" --project myproject
トピックのコンテキストを構築する
# Get related notes for a URL/topic (URL is positional)
basic-memory tool build-context "memory://topic/authentication"
# With depth and timeframe
basic-memory tool build-context "memory://note/my-note" --depth 2 --timeframe 30d
# With specific project
basic-memory tool build-context "memory://topic/api" --project myproject
最近のアクティビティを一覧表示する
# Default (depth 1, 7 days)
basic-memory tool recent-activity
# With depth
basic-memory tool recent-activity --depth 3
# With timeframe
basic-memory tool recent-activity --timeframe 30d
# Combined
basic-memory tool recent-activity --depth 3 --timeframe 14d
会話を続ける
# Get prompt to continue previous work
basic-memory tool continue-conversation "previous topic or context"
データベースを同期する
basic-memory sync
ステータスを確認する
basic-memory status
ノートのフォーマット
ノートは YAML フロントマター付きの markdown として保存されます:
---
title: My Note
tags: [tag1, tag2]
created: 2024-01-15
---
# My Note
Content here in markdown format.
## Sections
More content...
ワークフローパターン
学びを保存する
役立つことを発見したとき:
basic-memory tool write-note \
--title "TypeScript Utility Types" \
--content "# Utility Types\n\n- Partial<T> - Makes all properties optional\n- Required<T> - Makes all properties required\n- Pick<T, K> - Picks specific properties" \
--tags "typescript,types,reference"
決定を保存する
アーキテクチャ上の決定を行うとき:
basic-memory tool write-note \
--title "Auth Strategy Decision" \
--content "# Decision: Use JWT for API auth\n\n## Context\n...\n\n## Decision\n...\n\n## Consequences\n..." \
--tags "architecture,auth,decision" \
--folder "decisions"
コンテキストを取得する
関連する作業を始める前に:
# Search for relevant notes
basic-memory tool search-notes "authentication jwt tokens"
# Or build comprehensive context
basic-memory tool build-context "memory://topic/api-authentication"
最近の作業をレビューする
basic-memory tool recent-activity --depth 5 --timeframe 7d
ユースケース
パーソナル Wiki
- コードスニペットやパターンを保存する
- プロジェクトの決定を文書化する
- 参考資料を保管する
学習ログ
- 学んだことを記録する
- 後で取得できるようにトピック別にタグ付けする
- 時間をかけてナレッジを構築する
プロジェクトのコンテキスト
- プロジェクト固有のナレッジを保存する
- セッション開始時に関連するコンテキストを取得する
- セッションをまたいでナレッジを共有する
ベストプラクティス
- 意味のあるタイトルを使う - タイトルはパーマリンクになります
- タグを追加する - 検索と整理が向上します
- markdown を使う - コンテンツ内で markdown を完全にサポートします
- フォルダで整理する - 関連するノートをグループ化します
- 書く前に検索する - ナレッジがすでに存在するか確認します
- ノートを焦点を絞って保つ - 1 ノートにつき 1 トピック
- 更新し、複製しない - 既存のノートを修正します
統合パターン
セッション開始
# Get context for today's work
basic-memory tool build-context "memory://topic/feature-youre-building"
作業中
# Save discoveries
basic-memory tool write-note --title "Discovery Title" --content "What I learned"
セッション終了
# Sync to ensure persistence
basic-memory sync
コメント
Markdown 対応