/kosha:koshafrom kosha
Adds BM25 full-text, vector kNN, or hybrid RRF search to apps. Indexes local PDFs, DOCX, HTML, Markdown, and text files. Can replace Elasticsearch/OpenSearch or search large document corpora. Supports self-hosted (Docker) or Kosha Cloud via MCP.
Ships in kosha. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Kosha is an Apache-2.0, storage-disaggregated search engine in Rust (S3 is the source of truth, local NVMe is a read-through cache). It supports BM25 lexical search, vector kNN, hybrid RRF, filters, aggregations, highlighting, and ranged document reads.
The same application code works against Kosha Cloud and self-hosted
Kosha — only KOSHA_HOST and KOSHA_API_KEY change.
deploy/selfhost/bootstrap.sh) with Postgres + S3-compatible
storage.Endpoint: https://mcp.getkosha.dev/mcp (Streamable HTTP, OAuth 2.1).
claude mcp add --transport http kosha https://mcp.getkosha.dev/mcp
codex mcp add kosha --url https://mcp.getkosha.dev/mcp
codex mcp login kosha
export KOSHA_API_KEY=sk-kosha-...
# Claude Code
claude mcp add --transport http kosha https://mcp.getkosha.dev/mcp \
--header "Authorization: Bearer ${KOSHA_API_KEY}"
# Codex
codex mcp add kosha --url https://mcp.getkosha.dev/mcp --bearer-token-env-var KOSHA_API_KEY
account and list_indexes to check standing and existing indexes.create_index(index="<name>") (schema is optional; field types are
inferred on first write).unpaid with no free-tier writes.
If a write returns payment_required or quota_exceeded, pass the returned
checkout_url (or call billing_link) to the user so they can add a card.
Never open billing links yourself.upload_files(index="<name>", files=[{"path": "/dir/file.pdf", "local_path": "./dir/file.pdf", "size_bytes": 12345}]).curl PUT commands locally (signed URLs expire in 15 minutes).ingest_status(job_id="<id>") until finished.index_documents(index="<name>", documents=[{"id": "1", "fields": {"title": "...", "path": "/a/b.txt", "year": 2024}}], keyword_fields=["status"]).Prefer Kosha MCP tools over local grep/glob for ranked relevance, semantic
or hybrid queries, PDFs/DOCX, and large corpora:
search(query, index, filter, fields, max_results) — BM25 keyword search.semantic_search(field, query, index, filter, k, hybrid=True) — vector kNN
or hybrid BM25+kNN fused with RRF.count(filter, query, index) / aggregate(aggs, filter, query, index) —
size and summarize result sets before paging.filter(filter, index, sort, search_after) / glob(pattern, index) —
exact metadata filters and gitignore-style path matching (**/*.pdf).read(id=..., path=..., index=..., start_line=..., end_line=..., page=..., byte_start=..., byte_end=...) —
fetch full text or a targeted line/page/byte range when hits are truncated
(truncated_fields).Call create_api_key(description="<app>", scopes=["read", "write"], indexes=["<name>"]).
The secret (api_key) is returned once — hand it to the user and do not repeat
it later. Configure the app with:
export KOSHA_HOST=https://api.getkosha.dev
export KOSHA_API_KEY=sk-kosha-...
Quick ephemeral local dev (in-memory catalog, container disk):
docker run --rm -p 8080:8080 \
-e KOSHA_API_KEY=sk-kosha-dev \
-e KOSHA_ROLE=standalone \
decoverai/kosha:latest
Verify with curl -s http://localhost:8080/healthz.
Durable single-machine stack (Postgres + S3-compatible store + generated keys):
git clone --depth 1 https://github.com/decover-tech/kosha && cd kosha/deploy/selfhost
./bootstrap.sh
set -a; . ./kosha.env; set +a # exports KOSHA_HOST and KOSHA_API_KEY
kosha-ingestpip install 'kosha-client[ingest]'
kosha-ingest ./docs --namespace my-index --prefix /docs/
.pdf, .docx, .html, .htm, .md, .txt.content_sha256 (re-running skips unchanged files; pass
--force to re-index, --per-page for one document per page).pip install 'kosha-client[mcp]' then run
kosha-mcp --allow-writes with KOSHA_HOST and KOSHA_API_KEY set.Strong read-your-writes consistency is the default — no flush() is needed
before searching.
pip install kosha-client)from kosha_client import F, Kosha # or AsyncKosha
kosha = Kosha() # reads KOSHA_HOST and KOSHA_API_KEY
docs = kosha.namespace("docs", types={"status": "keyword"})
docs.create() # idempotent (exist_ok=True)
docs.upsert([
{"id": "1", "title": "breach of contract", "status": "open", "year": 2024},
{"id": "2", "title": "merger antitrust review", "status": "closed", "year": 2023},
])
res = docs.search("breach", filter=F.all_of(F.eq("status", "open"), F.range_("year", gte=2020)))
for hit in res["hits"]:
print(hit["id"], hit["score"], hit["document"]["title"])
Also available on the namespace handle: update, bulk_upsert, get,
delete, count, aggregate, semantic_search, hybrid_search, iterate,
search_many, create_branch.
npm install @decover/kosha)import { F, Kosha } from "@decover/kosha";
const kosha = new Kosha(); // reads KOSHA_HOST and KOSHA_API_KEY
const docs = kosha.namespace("docs", { types: { status: "keyword" } });
await docs.create();
await docs.upsert([
{ id: "1", title: "breach of contract", status: "open", year: 2024 },
]);
const { hits } = await docs.search("breach", {
filter: F.eq("status", "open"),
limit: 10,
});
go get github.com/decover-tech/kosha/clients/go)client, err := kosha.NewClient() // reads KOSHA_HOST and KOSHA_API_KEY
docs := client.Namespace("docs", kosha.WithTypes(map[string]string{"status": "keyword"}))
_, err = docs.Create(ctx, nil, true)
_, err = docs.Upsert(ctx, []kosha.Doc{
{"id": "1", "title": "breach of contract", "status": "open", "year": 2024},
})
res, err := docs.Search(ctx, "breach", kosha.SearchOptions{
Filter: kosha.Eq("status", "open"),
Limit: 10,
})
Kosha / Namespace API above.KoshaClient provides an OpenSearch-compatible
adapter (KOSHA_COMPAT_STRICT=1 turns compatibility warnings into errors).flush() calls before search; strong reads see acknowledged
writes immediately.https://getkosha.dev/docs/ and https://getkosha.dev/llms.txt.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub decover-tech/kosha --plugin koshaOther plugins' skills for the same job