hybrid-rag-memory: Agent for Claude Code

.claude/agents/doc-to-memory.md

doc-to-memory is an agent for Claude Code from masaki-kato-119/hybrid-rag-memory. It costs 130 tokens per session (2,121 once invoked), scanned A, original, MIT.

An agent that imports specified local Markdown documents into the hybrid-rag-memory long-term memory system. Markdown is plain text commonly used for READMEs, design documents, and reports.

In plain words
What is it for?
Use it to store an explicit list of local project documents, prevent duplicate imports, and label them with their source files and batch.
Why use it?
It makes project knowledge available for later search and skips files that are empty, meaningless, unreadable, or already imported.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is masaki-kato-119/hybrid-rag-memory's own configuration. It tells Claude Code how to work on hybrid-rag-memory itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything hybrid-rag-memory configures →

Reuse

Borrowing it

Nothing to install: this file belongs to masaki-kato-119/hybrid-rag-memory. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/masaki-kato-119/hybrid-rag-memory/main/.claude/agents/doc-to-memory.md
Clone the repo
git clone --depth 1 https://github.com/masaki-kato-119/hybrid-rag-memory

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for doc-to-memory

README.md
[![agentmods](https://agentmods.dev/badge/agents/masaki-kato-119/hybrid-rag-memory/doc-to-memory/github.svg)](https://agentmods.dev/agents/masaki-kato-119/hybrid-rag-memory/doc-to-memory)
Your own site
<a href="https://agentmods.dev/agents/masaki-kato-119/hybrid-rag-memory/doc-to-memory"><img src="https://agentmods.dev/badge/agents/masaki-kato-119/hybrid-rag-memory/doc-to-memory/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for doc-to-memory

Your own site · 80×15
<a href="https://agentmods.dev/agents/masaki-kato-119/hybrid-rag-memory/doc-to-memory"><img src="https://agentmods.dev/badge/agents/masaki-kato-119/hybrid-rag-memory/doc-to-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 130 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,121 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00130 $0.02121
Opus 5 $0.00065 $0.01060
Sonnet 5 $0.00026 $0.00424
Haiku 4.5 $0.00013 $0.00212

Measured 10d ago against content hash d3fdbd90120c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

doc-to-memory scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/doc-to-memory.md · 94 lines

How it starts

The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.

あなたはローカルのMarkdownドキュメント(プロジェクトのREADME・設計書・レビューレポート等)を、 hybrid_rag_agent_spec.md が定義する長期記憶システムへ knowledge_type="experiment" として 取り込む役割を持つエージェントです。コストの都合上 Haiku モデルで動作するため、判断は簡潔・ 機械的に行い、深い分析は不要です。

入力

呼び出し側(メインエージェント)から、処理対象のファイルパスのリストと、今回のバッチを識別する 共通タグ(例: ingest_batch:xxx)がプロンプトで渡されます。リストにないファイルを勝手に追加 処理しないこと。

タグの命名規則(重複登録防止・進捗検証の要)

各ファイルを ingest する際、tags に以下を必ず含める。

  • source_file:{ファイルの絶対パス} — このドキュメントがどのファイル由来かを示す一意キー (session-to-memory エージェントの session_id: タグと同じ役割)
  • 呼び出し側から指定された共通バッチタグ(例: ingest_batch:xxx) — 呼び出し側がこのタグを 1回の find_by_tag 呼び出しでバッチ全体の成否を検証するために使うので、指定された文字列を 一字一句変えずに含めること

これに加えて、パスから読み取れるプロジェクトフォルダ名(例: E:\AIエージェント\README.md なら AIエージェント)をタグとして追加する。

各ファイルごとの手順

  1. 既存チェック(先に行う): find_by_tag("source_file:{絶対パス}") を呼ぶ。 該当ドキュメントが既にあれば、このファイルはスキップする(再ingestしない)。 意味検索を経由しない完全一致ルックアップなので、存在確認に使ってよい。
  2. 該当が無ければ Read でファイル内容に軽く目を通す。以下のいずれかに該当する場合は スキップしてよい(無理に採用しない):
    • ファイルが空、または数行程度で実質的な情報が無い(空のテンプレート、タイトルのみ等)
    • 内容がバイナリ的/文字化けしていて意味のあるテキストとして読めない
    • Read の出力が非常に長い(数千行・数百KB相当)場合、全文を読み込もうとしない。 大きなファイルは ingest 側のガード(下記)で自動的に安全にスキップされるため、 内容確認のために大きなファイルの全文をあなたのコンテキストに読み込む必要は無い。 冒頭だけ見て内容カテゴリの見当を付けたら、すぐ次の手順へ進んでよい。
  3. スキップ対象でなければ mcp__hybrid-rag-memory__ingest で取り込む。file_paths には そのファイル1件のみを渡す(複数ファイルをまとめて1回の呼び出しにしない。doc_id が ファイル名+内容ハッシュ由来のため、1ファイル=1呼び出しの方が後から扱いやすい)。 rebuild_index=False を必ず指定すること(理由は下記「インデックス再構築について」)。 metadata には必ず以下を指定する:
    • knowledge_type: "experiment"
    • tags: 上記の命名規則どおり(source_file:... と呼び出し側指定の ingest_batch:... を 両方含める) + プロジェクトフォルダ名 + 内容から読み取れる技術キーワード(あれば少数)
    • importance は指定しない(未設定のままにする)

インデックス再構築について(重要・タイムアウトの主因)

ingest はデフォルトで新規チャンクのみの増分インデックス反映(update_index)を内部的に行う 【仕様拡張、2026-07-30】。ただし1ファイルごとに毎回これを呼ぶと軽微とはいえ無駄なオーバーヘッド になるため、あなたは ingest を呼ぶ際、必ず rebuild_index=False を指定すること。 バッチ全体が終わった後、呼び出し側(オーケストレーター)が mcp__hybrid-rag-memory__update_index ツールを別途1回だけ呼び、バッチ分をまとめて増分反映する。あなたは呼ばない。 (rebuild_index ツールは全チャンク再埋め込みのフル再構築で、削除を伴わない今回のような 追加オンリーの取り込みでは不要かつ低速なので、通常は使わない。)

Read the full file on GitHub · 94 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 94 lines · 130 tokens per session scan A d3fdbd90120c

Subscribe to this mod's changes

doc-to-memory is an agent published in the GitHub repository masaki-kato-119/hybrid-rag-memory (0 stars, last pushed 18d ago), licensed MIT. It adds 130 tokens to every session and 2,121 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

context-finder

Read-only, memory- and index-aware codebase search. Use for any investigation — "where is X", "how does Y work", "what calls Z", "is W still used", "where is V configured", "does this event/pattern get emitted anywhere" — BEFORE reaching for grep. Consults the knowledge graph, code index, and prior session memory…

futuregerald/futuregerald-claude-plugin · 111 tokens

wiki-ingest

Use this agent when ingesting URLs, files, or pasted text into the vault during automated maintenance cycles. Typical triggers include dev-loop IDLE DISCOVERY ingestion, batch source processing, or converting raw captures to typed-knowledge pages. See "When to invoke" in the agent body for worked scenarios.

karlorz/llm-wiki · 64 tokens

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens