What Narsil promises your users and your AI

One engine covers the work that you would otherwise split between a search server, a vector database, and an embedded library. Each promise below has a link to the guide that shows the code.

Customers can find the product even when they misspell it

Narsil's fuzzy matching scores terms within a bounded edit distance, so the right product can still rank first for a misspelt query. Stemming folds plurals and verb forms into one term. Search-as-you-type also matches the last word as a prefix while the customer is still typing.

Read the full-text search guide
mechnical keybord2 typos

Mechanical Keyboard

Electronics

best match

Wireless Keyboard

Electronics

Folio Keyboard Case

Accessories

Both misspellings resolve to the same top resultfuzzy matching

The same query works embedded and on the server

The query that you write against an embedded index is the query that you send to the server, even after partitions shard the index behind it. You can move an index between deployments as one .nrsl snapshot, so when you scale, you change the deployment and keep your query code.

Read the HTTP server guide
One querythree deployments
await narsil.query('products', { term })

In your process

answers with no network hop

embedded

Behind the server

REST API with a write-ahead log

HTTP

Across partitions

workers merge one ranked list

4 shards
The call above reads the same in all threesame .nrsl index

Your AI's answers include their sources

Narsil retrieves the passages that your model writes its answer from. Its highlighting then marks the matched text, so you can trace every claim in the answer back to a document. The server-app example shows this end to end, with a toggle that sends the same question through keyword, semantic, or hybrid retrieval so that you can watch the sources change.

Read the hybrid search guide
AskKeywordSemanticHybrid

Does vitamin D supplementation reduce respiratory infections?

The retrieved trials report a modest protective effect, strongest in participants who started with a deficiency and took daily doses rather than large single boluses.[1][2]

Sources

1SciFact #49830.88

...daily vitamin D reduced the risk of acute respiratory infection among all participants...

2SciFact #10270.81

...protective effects were strongest in those with a baseline deficiency...

2 sourceshybrid · 34 ms

A search in the customer's words can find the document in yours

Embedding adapters turn documents into vectors when you insert them and queries into vectors when you search, while hybrid mode fuses the resulting ranking with the keyword one. Narsil can therefore return the right page for a support question whose wording differs from the manual's.

Read the embedding adapters guide
keep my laptop dry in the rainSemantic

Waterproof commuter backpack

89%

All-weather messenger bag with padded sleeve

86%

Canvas tote

42%
Ranked by cosine similarity12 ms

Shoppers can narrow results to what is in stock and nearby

Typed filters narrow results by stock, price, or any other field in the schema, while facets return the counts that fill the sidebar. A geo condition then keeps the results within reach of the shopper. Cursor pagination also works at any depth.

Read the filters and facets guide
keyboardRelevance
FiltersUnder $200

Mechanical Keyboard

Electronics

In stock$129.99

Wireless Keyboard

Electronics

In stock$89.99

Folio Keyboard Case

Accessories

Out of stock$49.99
3 resultsElectronics 2 · Accessories 1

Search works inside the page, even offline

Narsil loads its engine and index into the browser and persists the index to IndexedDB, so every search completes on the device. Web Workers keep the search off the main thread. The Cmd+K search on this site and on the main portfolio uses Narsil in this way.

Read the getting started guide
hybrid⌘K

Documentation

Hybrid search

Run keyword and vector retrieval in one query and fuse the rankings.

Vector search

Store embeddings in vector fields and search by similarity.

Pages

Benchmarks

openRuns in-browser on Narsil

Search works in 107 languages

Each language module is a separate entry point, so you bundle only the languages that you use. Narsil tokenises, stems, and filters stop words for thirty-seven languages, while it splits the seven languages that are written without spaces between words into character n-grams. Twenty of the 107 are African languages.

Read the language support guide
Language support107 languages

French

TokeniserStop wordsStemmer

Japanese

N-gramsStop words

Swahili

TokeniserStop wordsStemmer

Vietnamese

TokeniserStop words

Twi (Akan)

TokeniserStop words
Import only the languages you use37 with a stemmer

Narsil outscores the engines on either side of it

Against the embedded libraries, Narsil scores 0.6840 nDCG@10 on BEIR SciFact to Orama's 0.4351 and MiniSearch's 0.2506. Against the search servers on the keyword track, it scores 0.6814 to 0.6789 for Elasticsearch and OpenSearch, at 4,200 queries a second to their 2,796 and 3,027. The harness records both benchmarks with pinned versions and equal resource caps.

Read the full benchmark results
Ranking qualitynDCG@10 · BEIR SciFact
Narsil0.6840
Orama0.4351
MiniSearch0.2506
Over HTTP, Narsil also leads Elasticsearch, by 0.6814 to 0.6789two recorded runs

Try Narsil on your own data

The documentation covers everything above in depth, starting with the getting started guide.