typesense
A blazing-fast, typo-tolerant open-source search engine that delivers instant search experiences with built-in vector, semantic, and geo-search — all from a single binary.
Typesense is a fast, typo-tolerant, in-memory search engine built from the ground up in C++ for building delightful, low-latency search experiences. It serves as an open-source alternative to Algolia and a far simpler alternative to Elasticsearch, without sacrificing the features that developers need in production. From e-commerce product catalogs to knowledge bases and developer documentation, Typesense handles search at scale with sub-50ms response times.
At its core, Typesense uses an Adaptive Radix Tree (ART) for its inverted index, enabling memory-efficient prefix and fuzzy search with built-in typo tolerance. RocksDB provides durable on-disk storage for document data while keeping all indexed structures in RAM for maximum read throughput. The engine supports HNSW-based vector search for nearest-neighbor and semantic queries, geo-polygon indexing, JOIN operations across collections, federated multi-search, and conversational RAG — all accessible via a clean RESTful API.
Typesense is available as a single binary with no runtime dependencies, a Docker image with over 12 million pulls, and a managed cloud offering (Typesense Cloud) that serves over 10 billion searches per month. Official API clients exist for JavaScript, Python, Go, PHP, Ruby, Java, Dart, and more, and it integrates with InstantSearch.js, Docusaurus, WordPress, and other popular frameworks out of the box.
The project is open-source under GPL-3.0 and actively maintained by a core team with contributions from the community. Recent releases (v29.0, v30.0) introduced natural language search, LLM-powered query understanding, union search across collections, Maximum Marginal Relevance diversification, global synonyms and curation sets, IPv6 support, and Azure/GCP AI model integrations — demonstrating consistent forward momentum.
What You Get
- Typo-Tolerant Full-Text Search - Automatically corrects misspellings in search queries using an ART-backed fuzzy matching engine, so users find ‘Stark Industries’ even when searching for ‘stork industreis’.
- Vector & Semantic Search - Indexes float embeddings from S-BERT, E-5, OpenAI, PaLM, Azure OpenAI, or GCP models and performs HNSW-based nearest-neighbor queries to enable semantic relevance beyond keyword matching.
- Hybrid Search with Fusion Scoring - Combines keyword text-match scores and vector distance scores into a single ranked result set using reciprocal rank fusion, supporting re-ranking of hybrid hits.
- Natural Language Search - Integrates LLM-powered intent detection to convert free-form queries like ‘Honda or BMW with at least 200 hp’ into structured filters and sort clauses automatically.
- Conversational Search (RAG) - Answers natural language questions by retrieving and summarizing indexed documents using any OpenAI-compatible or GCP/Azure model, with streaming conversation support.
- Geo Search & Geo Polygon Indexing - Supports point-radius, bounding-box, and polygon-based geo queries using S2 geometry, enabling store-finder, delivery-zone, and map-based browsing experiences.
- Federated & Union Search - Queries multiple collections in a single HTTP request, with support for grouping, de-duplication, and pinned hits across unified result sets.
- JOINs Across Collections - Links collections via reference fields to perform SQL-style joins at query time, including faceting on joined fields and cascade delete control.
- Image Search - Searches image collections using the CLIP model, supporting text-to-image queries (‘red running shoes’) and image similarity search without a separate ML pipeline.
- Voice Search - Accepts audio recordings, transcribes them using the Whisper model, and returns search results — no external transcription service required.
- Scoped API Keys - Generates per-tenant API keys with embedded filter constraints, enabling true multi-tenant search without application-layer filtering logic.
- Merchandising & Curation Sets - Pins specific documents to fixed positions in results and applies dynamic filter/sort overrides via globally reusable curation sets shared across collections.
- Global Synonyms - Defines synonym sets as top-level resources shared across multiple collections, with support for synonym matching in curation rules and stemming.
- Faceting, Filtering & Grouping - Supports facet sampling, dynamic facet return of parent fields, negative filters, nested object filtering, and group-by with high-cardinality fields.
- Raft-based HA Clustering - Deploys as a distributed cluster with automatic leader election, replication, and failover — no external coordination service like ZooKeeper needed.
- Seamless Binary Upgrades - Upgrades by swapping the binary and restarting; no schema migrations, no downtime, with auto-migration of synonyms and curation rules between major versions.
Common Use Cases
- E-commerce product search - An online retailer uses Typesense to power instant product search with typo tolerance, dynamic price sorting, category faceting, brand filtering, and promotional pinning of featured items.
- Internal enterprise document search - A company indexes internal wikis, Confluence pages, and Notion exports with S-BERT embeddings so employees can find answers using natural language like ‘onboarding process for contractors’.
- Multi-tenant SaaS search - A SaaS platform issues scoped API keys per customer, each embedding a tenant filter, so users only ever see their own data without additional application-layer logic.
- Location-aware marketplace search - A rental marketplace uses geo polygon indexing and point-radius queries to show listings within a drawn map boundary or within a 10km radius of the user’s location.
- AI-powered customer support search - A support platform indexes help articles with OpenAI embeddings and uses conversational RAG to return fully-formed answers to customer questions rather than a list of links.
- Developer documentation search - An open-source project integrates Typesense with Docusaurus or custom docs sites via the Typesense-Docusaurus plugin for sub-100ms, typo-tolerant documentation search.
Under The Hood
Architecture Typesense is built around a layered, responsibility-driven architecture where each domain concern — indexing, faceting, geo-spatial querying, vector search, authentication, analytics, and curation — is encapsulated in a dedicated manager or index class with well-defined interfaces. The central Index class coordinates tokenization, ART-based text lookup, HNSW vector queries, and hybrid scoring using thread-safe shared_mutex patterns and sentinel value maps to safely aggregate results across concurrent threads. The HTTP layer and the search core are cleanly separated: HTTP routing and request parsing happen in core_api and the HTTP server, while all search logic lives in Collection, Index, and their collaborators. Cross-cutting concerns like rate limiting (AuthManager), analytics collection (AnalyticsManager), and embedding coordination (EmbedderManager) are implemented as singletons with fine-grained locking. The result is a monolith that is nonetheless modular at the component level — data flows cleanly from REST request through collection schema validation, into index lookup and scoring, and back out as ranked JSON.
Tech Stack
The search engine core is written in C++17 and built with CMake, using jemalloc for memory allocation optimization and RocksDB for durable on-disk document storage. The inverted index uses a custom Adaptive Radix Tree (ART) implementation for memory-efficient prefix and fuzzy lookups, while vector search is powered by a custom HNSW index. Geo-spatial queries use the S2 geometry library for polygon and point-radius operations. The TypeScript test suite in the tests/ directory uses Vitest and Neverthrow for typed error handling and Zod for schema validation, supporting end-to-end API and integration testing. Docker and Bazel are used for builds and CI, and the project provides official pre-built binaries for Linux x86_64, arm64, and macOS.
Code Quality Typesense demonstrates comprehensive test coverage with over 65 C++ test files spanning every major subsystem — collection management, faceting, filtering, sorting, grouping, joins, curation, analytics, and locale-specific behavior. The TypeScript API test layer adds integration coverage using typed schemas and structured assertions. The C++ codebase uses an explicit Option<T> result type for error propagation rather than exceptions, making error handling paths visible and testable. Circuit-breaker macros enforce search timeout budgets, and sentinel value maps ensure thread-safe result aggregation. Code naming is domain-driven and consistent — CollectionManager, CurationIndexManager, NaturalLanguageSearchModelManager — making the codebase navigable at scale despite its substantial size.
What Makes It Unique Typesense’s most distinctive technical property is the combination of first-class in-memory ART indexing with HNSW vector search and Raft consensus clustering in a single self-contained binary — no external dependencies on Zookeeper, Redis, or separate vector databases. The natural language search feature is architecturally notable: LLM-powered intent detection is embedded directly in the query pipeline, converting free-form text into structured filter expressions without requiring application-layer prompt engineering. Geo polygon indexing using S2CellId geometry supports complex boundary queries (delivery zones, map-drawn regions) without a separate GIS layer. The curation and synonym systems were recently redesigned as top-level shared resources across collections, moving from per-collection configuration to a global resource model — a non-trivial architectural evolution that reflects maturity in multi-collection use cases.
Self-Hosting
Typesense is released under the GNU General Public License v3.0, which is a strong copyleft license. For self-hosters, this means the source code is freely available to run, modify, and deploy on your own infrastructure for any purpose, including commercial use, without paying any license fees. However, if you distribute a modified version of Typesense itself (not your application using it), you must also release your modifications under GPL-3.0. Typical API usage and application integration does not trigger this requirement — the copyleft clause applies to distribution of the Typesense binary itself, not to software that queries its API.
Operating Typesense yourself means owning the full infrastructure stack: provisioning servers with sufficient RAM for your index size (a 2.2M recipe dataset uses ~900MB; a 28M book dataset uses ~14GB), managing RocksDB disk performance with SSDs, handling Raft cluster configuration for high availability, and taking snapshots before major version upgrades. The upgrade process is straightforward — swap the binary and restart — but major version changes (e.g., v29 to v30) may require reviewing API behavior changes for synonyms, curation sets, and analytics rules that are auto-migrated. The team provides clear upgrade guides, but the operational responsibility for monitoring, backups, and capacity planning rests entirely with you.
Typesense Cloud, the managed SaaS offering, removes all of that operational burden: dedicated clusters, managed upgrades, automated backups, built-in HA, and a pay-per-cluster-hour pricing model (not per record or search operation). The cloud tier also provides a visual dashboard for managing collections, built-in analytics, and enterprise support channels. Self-hosters gain maximum data control and zero ongoing licensing cost at the trade-off of infrastructure ownership — while Typesense Cloud is the right choice for teams that want production-grade search without a dedicated DevOps investment.
Related Apps
Supabase
Developer Tools · Databases · Search
The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.
Supabase
Apache 2.0Meilisearch
Search
Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.
Meilisearch
OtherSearXNG
Search
Privacy-first metasearch engine that aggregates results from 250+ search services — no tracking, no profiling, full control when self-hosted.