What you can build with Narsil

One engine covers the work you'd otherwise split between a search server, a vector database, and an embedded library. These are the six jobs it's built for, each linked to the guide showing the code.

Ask questions, get grounded answers

Narsil is the retrieval layer for question answering. It finds the passages, your model writes the answer, and the matched text stays visible beside the response so you can check the answer against the passages it came from. The server-app example in the repository has this working end to end, with a toggle that reruns the same question through keyword, semantic, or hybrid retrieval so 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

Product and catalogue search

Typed filters narrow by stock, price, or any field in the schema. Facets return the counts that build filter interfaces, fuzzy matching absorbs typos, boosts promote the fields that matter, and cursor pagination holds up 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 by meaning

Embedding adapters turn documents into vectors automatically on insert and on query, through OpenAI-compatible APIs, local Transformers.js models, or your own adapter. Vector fields start on an exact scan and promote to an HNSW graph as they grow, so queries phrased nothing like the stored text still find it.

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

In-app and site search

The engine embeds in the process that already runs your app: Node.js on the server or IndexedDB-backed storage in the browser, with Web Workers keeping search off the main thread. The Cmd+K search on this site and on the main portfolio runs on Narsil.

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 near a place

Geo fields answer radius queries with Haversine or Vincenty distance and polygon containment for boundaries. Store locators, delivery zones, and nearby listings combine the geo filter with text, vector, and field conditions in one query.

Read the geosearch guide
Downtown Torontowithin 5 km
1

St. Lawrence Market

93 Front St E, Toronto

1.1 km
2

Kensington Market

Kensington Ave, Toronto

1.3 km
2 within 5 kmHaversine distance

Search in 39 languages

Language modules load as separate entry points, so you only bundle the ones you use. African language support goes further than most engines: Swahili has a full stemmer, and eight more African languages have tokenisation and stop word support.

Read the language support guide
Language support39 languages

French

TokeniserStop wordsStemmer

Swahili

TokeniserStop wordsStemmer

Twi (Akan)

TokeniserStop words

Yoruba

TokeniserStop words

Hausa

TokeniserStop words
Import only the languages you use9 African languages

Try Narsil on your own data

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