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 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...
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 guideMechanical Keyboard
Electronics
Wireless Keyboard
Electronics
Folio Keyboard Case
Accessories
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 guideWaterproof commuter backpack
89%All-weather messenger bag with padded sleeve
86%Canvas tote
42%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 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 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 guideSt. Lawrence Market
93 Front St E, Toronto
Kensington Market
Kensington Ave, Toronto
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 guideFrench
Swahili
Twi (Akan)
Yoruba
Hausa
Try Narsil on your own data
The documentation covers everything above in depth, starting with the getting started guide.