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 guideMechanical Keyboard
Electronics
Wireless Keyboard
Electronics
Folio Keyboard Case
Accessories
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 guideIn your process
answers with no network hop
Behind the server
REST API with a write-ahead log
Across partitions
workers merge one ranked list
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 guideDoes 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
...daily vitamin D reduced the risk of acute respiratory infection among all participants...
...protective effects were strongest in those with a baseline deficiency...
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 guideWaterproof commuter backpack
89%All-weather messenger bag with padded sleeve
86%Canvas tote
42%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 guideMechanical Keyboard
Electronics
Wireless Keyboard
Electronics
Folio Keyboard Case
Accessories
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 guideDocumentation
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
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 guideFrench
Japanese
Swahili
Vietnamese
Twi (Akan)
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 resultsTry Narsil on your own data
The documentation covers everything above in depth, starting with the getting started guide.