Sway and the Fuel toolchain move faster than any model's training data, which is exactly the case where retrieval beats memory. The index is a local file — no vector database to run, and re-indexing after a docs update is one command.
A Bun server that indexes Fuel Network and Sway documentation into a local Vectra vector store with Transformers.js embeddings, then answers semantic queries against it. No Docker and no external database.
- Documentation searched by meaning, with a configurable result count and optional relevance scores — searchFuelDocs
- Sway standard library paths and types returned as context — provideStdContext
- Hybrid retrieval: semantic results with a keyword fallback and quality filtering
- Chunking that preserves code blocks rather than splitting an example in half
- Stdio by default, or HTTP on a port you choose with a /health endpoint
- A bundled docs set covering forc commands, the Sway reference and LSP, the GraphQL reference, wallet development, contract and frontend quickstarts and the storage API
Bun. Clone the repository, run bun install, then index the documentation with bun run src/indexer.ts ./docs before the first query. VECTRA_INDEX_PATH, EMBEDDING_MODEL (default Xenova/all-MiniLM-L6-v2), CHUNK_SIZE (default 2000) and NUM_RESULTS (default 5) are all optional.
