Narsil documentation

Narsil is an open source search engine with full-text, vector, hybrid, and geosearch on one typed index. It embeds in your app or serves a REST API behind its own server, and recorded benchmark runs score it against the engines on either side of it.

Getting started

2 guides

Languages

3 guides

Core concepts

6 guides

Search modes

6 guides

Operations

9 guides

Configuration17 min readSet up one engine for production in TypeScript, Python, Go, or Rust, check every write and search with a plugin, and look up each engine and index option with its default.Persistence and durability47 min readRecover every acknowledged write after a restart, choose how many writes you can lose in a crash, see how much disk space an index takes up, search an index larger than memory, close idle indexes, and move an index as a snapshot or an export.Partitions and workers17 min readSplit an index across partitions, get a warning before it fills, reshape it while it answers searches, and spread its searches across threads in TypeScript and Go.Observability21 min readRead what each index stores in memory and on disk, report the memory that the engine uses, alert on the work that the engine does in the background, and probe a server from a load balancer.Native search core8 min readSee which search work Narsil does in its C core, what each language needs to build or load that core, how to fail a deployment that lacks it, and how to keep a bundler from leaving it out.HTTP server22 min readServe an engine over HTTP from TypeScript or Rust, admit only the callers that hold a token, call it from TypeScript, Python, or Go, generate a client from its OpenAPI description, and stop it so that the process exits cleanly.Container image23 min readStart a Narsil node from the published container image, search it from TypeScript, Python, or Go, choose between the TypeScript and Rust servers, and set the node up through environment variables.Cluster33 min readSpread an index across several nodes that each store copies of its partitions, wait until every copy is in place, and back the index up to a directory, S3, or Google Cloud Storage so that you can restore it onto a cluster of any size.Change capture25 min readFollow every insert, update, and removal on an index from a saved position, see each document as it stood before the write, receive only the changes that match a filter, and start again from an export when the feed sends a resync.

Clients

6 guides

AI agents

9 guides

Overview4 min readRead what one Narsil search returns to an AI agent, and find the guide for each failure that a person can notice.Cite the passage behind an answer16 min readGive every answer from an AI agent the rule's reference and its exact sentence, and check the quote against the stored text before a passenger reads it.Give a model a search tool15 min readGive a model a search tool that takes a resident's words, since a lookup by key needs an identifier that the model has no way of knowing.Give each client a separate index12 min readGive each client's AI agent a separate index, because the engine ranks passages by relevance and can put another client's handbook first.Fit the passages in a context budget17 min readMeasure the characters that a search tool returns, set each passage's cap from the text that it has to include, and keep the total within a budget.When the index has no good match14 min readRequire every query term and return a retrieval status that the AI agent states first, since a near miss looks like an answer and an empty result can lead the model to guess.Keep the index current12 min readWrite every change in your records to the index as an update or a removal, and wait for the worker copies, since the index holds the version from your last write to it.Record every search13 min readRecord every query and every preflight with one plugin on the engine, so that your journal includes the searches from every tool.Search by wording and by meaning12 min readAdd the customer's words to the catalogue and fuse the keyword and vector rankings, since the engine puts the right product first for this customer only when it fuses the two.