Kosha

Apache-2.0 search engine in Rust. S3 is the source of truth, local NVMe is a cache, and compute nodes are disposable. BM25, kNN, and hybrid search behind an Elasticsearch-shaped API.
DecoverAI built Kosha to replace Elasticsearch. It is not a faster Lucene cluster. Durable segments live in object storage, a query node is a cache in front of that bucket, and losing a node means warming another cache. Idle data costs storage bytes, not a hot shard.
Architecture: DESIGN.md. What the server actually promises, and what it does not: docs/guarantees.md.
Using Claude Code or Codex? Connect to managed Kosha Cloud in one command: Kosha Cloud quickstart.
Benchmarks: BM25 at 10M documents
Same 10M MS MARCO passages, same single m7i.8xlarge, same open-loop client at 8 QPS, top 10, ids only, 30 minutes per phase. Every phase: 14,401 requests, 0 errors, 0 zero-hit queries. Client-side latency in ms. Kosha and Lance read from S3; OpenSearch and Elasticsearch hold the whole index on local disk.
| Engine | Data | Phase | p50 | p90 | p99 |
|---|
| Kosha | 10M · S3 | result cache off | 13.8 | 23.7 | 36.3 |
| Kosha | 10M · S3 | result cache on | 2.1 | 9.8 | 24.5 |
| OpenSearch 3.10.1 * | 10M · local disk | caches off | 6.6 | 8.6 | 10.7 |
| OpenSearch 3.10.1 * | 10M · local disk | defaults | 6.4 | 8.4 | 10.6 |
| Elasticsearch 9.5.7 | 10M · local disk | caches off | 6.4 | 9.8 | 13.3 |
| Elasticsearch 9.5.7 | 10M · local disk | defaults | 6.4 | 9.7 | 13.2 |
| Lance 14.0.3 + Iceberg | 10M · S3 | warm | 41.2 | 68.9 | 116.9 |
| Lance 14.0.3 + Iceberg | 10M · S3 | cold first pass | 109.2 | 173.1 | 362.8 |
| Turbopuffer † | 1M · published | warm | 13 | 18 | 29 |
| Turbopuffer † | 1M · published | cold | 316 | 381 | 559 |
With its result cache off, Kosha's median is about 2× behind the Lucene engines. That's the gap we're closing. OpenSearch and Elasticsearch don't cache top-10 hit lists, so their "defaults" rows match "caches off".
* Measured on an index that wasn't fully merged (175 segments instead of 8); a rerun is pending.
† Turbopuffer's own published figures: 1M docs, conditions not stated. Not like-for-like.
Runs: Kosha 46119479389, OpenSearch 46225911925, Elasticsearch 46230873683, Lance 46238888714. How each engine was run, the caveats, and the commands to reproduce: docs/benchmarks.md. Vector (kNN) search has no cross-engine comparison yet.
Why it exists
Elasticsearch and OpenSearch fuse compute and storage. Every data node holds its shards, scaling queries means moving those shards, and an idle tenant still occupies heap and disk. Recovery is a cluster operation.
Kosha splits those roles. Segment files in S3 are the only copy that has to survive. Each process keeps a read-through NVMe cache. Adding a query node is starting a process near the bucket. The API is close to the Elasticsearch JSON that applications already send, translated by the Python client; it is not a full Query DSL. The gaps are listed in the compatibility matrix and under What is not supported yet.
60-second quickstart
The published image is decoverai/kosha (:latest and the version, e.g. :0.3.0, for releases, :main on every merge to main). The server refuses to start until it has an API key. This container keeps segments on its own disk and the catalog in memory: stop the container and the data is gone. For a durable self-hosted stack with generated credentials, use deploy/selfhost; for engine development, the development compose file.
docker run --rm -p 8080:8080 \
-e KOSHA_API_KEY=sk-kosha-dev \
-e KOSHA_ROLE=standalone \
decoverai/kosha:latest
In another shell:
curl -s localhost:8080/healthz
curl -s -X POST localhost:8080/v1/namespaces/demo/documents \
-H 'content-type: application/json' \
-H 'authorization: Bearer sk-kosha-dev' \
-d '{"documents":[
{"id":"1","fields":[{"name":"title","field_type":"Text","value":"breach of contract"}]},
{"id":"2","fields":[{"name":"title","field_type":"Text","value":"merger antitrust review"}]}
]}'