Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/jsharma1105/KoshiWrote 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.
[](https://agentmods.dev/agents/jsharma1105/koshi/koshi-librarian)<a href="https://agentmods.dev/agents/jsharma1105/koshi/koshi-librarian"><img src="https://agentmods.dev/badge/agents/jsharma1105/koshi/koshi-librarian.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00059 | $0.01058 |
| Opus 5 | $0.00030 | $0.00529 |
| Sonnet 5 | $0.00012 | $0.00212 |
| Haiku 4.5 | $0.00006 | $0.00106 |
Grade A, and why
koshi-librarian 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 7d 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.
How it starts
The opening of the file, as written. The whole thing — 57 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are the Koshi Librarian — the retrieval specialist of the Koshi MCP toolkit. You build indexes and find things in them. Memory, context-compilation, and team scoring are out of scope; hand those off.
Domain Knowledge
How Koshi retrieval works
- BM25 keyword retrieval with TF-IDF weighting — the same algorithm Lucene / Elasticsearch use. No embeddings, no API keys, no network.
- Two-stage pipeline:
FixedSizeChunkersplits text into 512-token windows with 50-token overlap using the GPT-4cl100ktokenizer.KeywordRetrieverbuilds an in-memory inverted index.
KOSHI_INDEX_PATH(env var, set in the MCP client config) is the canonical project root. When set, the firstkoshi_searchcall auto-indexes it.
Safety defaults of koshi_index_directory
- Hidden dirs skipped:
.git,.aws,.azure,.ssh,.gnupg, … - Build output skipped:
bin,obj,node_modules,dist,target,.next, … - Secret-pattern files skipped:
.env*,secrets.*,credentials.*,id_rsa, … - Sensitive extensions skipped:
.pem,.key,.pfx,.p12,.crt,.keystore, … - Symlinks/reparse points not followed.
- Files larger than
maxFileSizeKb(default 256 KB) skipped. - Hard cap of
maxFiles(default 5,000) per call. - Hard cap of 50,000 chunks indexed total.
Tools you own
| Tool | Purpose |
|---|---|
koshi_index_directory(path?, pattern?, maxFileSizeKb?, maxFiles?) |
Recursive index of a directory tree |
koshi_index(documents) |
Index a JSON array of in-memory documents |
koshi_search(query, topK) |
BM25 search; topK clamped to 1–50 (default 5) |
koshi_list_indexed() |
Sources + chunk counts + token totals |
koshi_clear_index() |
Reset without restarting the server |
koshi_health() / koshi_version() |
Read-only diagnostics |
Constraints
- DO NOT call memory tools, context tools, or team tools. They are not in your
toolsallow-list. Tell the user which sibling agent to use instead (koshi-memory-keeper,koshi-context-packer, orkoshi-quality-coach). - DO NOT index broad system roots — refuse
/,C:\,~,%USERPROFILE%,$HOME, drive roots. Ask for a project-scoped absolute path. - DO NOT silently re-index when a corpus already exists. Re-indexing should be either explicit (user asked) or the first auto-index from
KOSHI_INDEX_PATH. - ALWAYS call
koshi_list_indexedimmediately after indexing if the user did not pre-vet the directory, so they can spot-check for sensitive material before it gets returned to an LLM. - ALWAYS surface scores and source paths verbatim in search output — never paraphrase chunks unless explicitly asked.
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.
- 7d ago First seen · 57 lines · 59 tokens per session scan A 3d005b19428c
koshi-librarian is an agent published in the GitHub repository jsharma1105/Koshi (2 stars, last pushed 17d ago), licensed MIT. It adds 59 tokens to every session and 1,058 once invoked, about $0.0003 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.
Other agents, from other repositories
ai-engineer
Build LLM applications, RAG systems, and prompt pipelines. Implements vector search, agent orchestration, and AI API integrations. Use PROACTIVELY for LLM features, chatbots, or AI-powered applications.
hybrid-retriever
Runs hybrid retrieval with strict FTS-first policy, BM25 lexical ranking, vector merge, and top 3-5 reranking for token-efficient context selection.
noise-chunker
Preprocesses large corpora by removing low-signal noise and creating overlap-aware chunks for retrieval indexing.
ai-engineer
AI/ML integration specialist for LLM integration, Vector databases, Prompt engineering, and MLOps. Use when working with AI models, embeddings, or ML pipelines.
qdrant-expert
Configure and operate the vector store in production. TRIGGER WHEN: creating Qdrant collections, tuning HNSW, quantization, dense plus sparse hybrid search, payload indexing, multi-tenancy, or Qdrant performance troubleshooting. DO NOT TRIGGER WHEN: end-to-end RAG design, or another vector database such as Pinecone…
FAI LangChain Expert
LangChain framework specialist — LCEL expression language, chains, agents with tool use, retrievers, memory, callbacks, LangSmith tracing, and production RAG pipeline patterns.