dimamik/torus
70.0
Adequate · 18 September 2026
2.9k
lines of production code
Elixir
primary language
1
measurement over time
What this system is
Torus is an Elixir library that integrates PostgreSQL search capabilities into Ecto queries. It provides a unified interface for pattern matching, full-text search, BM25, semantic vector search, and hybrid ranking via reciprocal rank fusion. The system supports multiple embedding providers, including local inference and external APIs, with built-in batching and caching to optimize performance.
Features
Initial configuration for Torus library and test environment
The application now includes configuration files for the Torus library and its test environment. The main config sets up the Ecto repository for testing with a PostgreSQL connection, defines the embedding module as Torus.Embeddings.Batcher with specific batching parameters, and configures the HuggingFace embedding provider. The test environment configures the Req HTTP client to use a test plug for request interception.
config · high confidence
Initial release of Torus search library with Credo configuration
This change introduces the Torus library, an Elixir tool for integrating PostgreSQL search into Ecto, and establishes the project's initial development standards. It adds a \.credo.exs\ configuration file to enforce code quality and style checks using the Credo linter, alongside standard Elixir project scaffolding files like \.formatter.exs\ and \.gitignore\. The repository also includes the initial \CHANGELOG.md\ and \README.md\ documenting the library's capabilities, including full-text, BM25, semantic, and hybrid search features.
(repo-wide) · high confidence
Introduce Torus search library for Ecto
Adds the Torus library, providing a suite of search macros for Ecto queries including pattern matching (like, ilike, similar\_to), similarity search (using pg\_trgm), full-text search, BM25, semantic search, and hybrid search via reciprocal rank fusion. The library includes utilities for sanitizing input to prevent LIKE injections and supports result highlighting.
lib · high confidence
Introduce semantic search and query debugging helpers
This change adds a new \Torus.Embedding\ behaviour to support semantic search capabilities, allowing users to generate vector embeddings for terms. It also introduces \Torus.QueryInspector\, a new module providing debugging utilities such as \tap\_sql\, \tap\_explain\_analyze\, and \tap\_substituted\_sql\ to help inspect and debug generated SQL queries and their execution plans.
lib/torus · high confidence
New embedding backends and batching infrastructure
This release introduces several new embedding providers and infrastructure components. Users can now generate embeddings via Google Gemini (\Torus.Embeddings.Gemini\), Hugging Face (\Torus.Embeddings.HuggingFace\), and a local inference path using Bumblebee and Nx (\Torus.Embeddings.LocalNxServing\). To improve performance and reduce API costs, a new \Torus.Embeddings.Batcher\ GenServer is available to group requests into batches based on size or timeout. Additionally, a caching layer (\Torus.Embeddings.NebulexCache\) allows embedding results to be stored in memory, and a shared \Torus.Embeddings.Common\ module provides standardized option retrieval for these new modules.
lib/torus/embeddings · high confidence
New search capabilities: BM25, hybrid fusion, and highlighting
This release introduces BM25 full-text search and hybrid search via reciprocal rank fusion (RRF), allowing users to combine multiple search strategies (full-text, similarity, semantic, and BM25) into a single ranked result set. It also adds a highlight option to wrap matching terms in result fields, and introduces a \Torus.sanitize/1\ function to safely escape pattern-matching characters.
lib/torus/search · high confidence
Test coverage
Added comprehensive test coverage for Torus search capabilities; Added test migrations for full-text search and vector embeddings; Added test support infrastructure for Torus; Added tests for semantic embedding providers and caching; Initial test suite for Torus search macros.
Dependencies
Initial release of Torus v0.7.0 with Elixir 1.14+ and PostgreSQL search dependencies
This entry introduces the Torus library (version 0.7.0), a tool that bridges Ecto and PostgreSQL to simplify building search queries. The project requires Elixir 1.14 or later and relies on \ecto\ and \ecto\_sql\ (both \~\> 3.10) for database interactions, along with \pgvector\ (\~\> 0.3) and \postgrex\ for PostgreSQL vector search capabilities. Optional dependencies are included to support advanced features: \nx\, \exla\, \bumblebee\, \nebulex\, \nebulex\_local\, \decorator\, and \req\ enable optional neural network, caching, and HTTP functionalities, while \credo\ and \ex\_doc\ are added for development and documentation purposes.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 70.
Lenses
- Code Health 99
- Architecture 99
- Maturity 59
- Readiness 65
- Security 89
Changes since last survey
- 59 commits — 55 feature/other, 4 fixes
By area
- (root) — 27 commits
- lib/torus — 15 commits
- lib/torus.ex — 5 commits
- test/torus — 4 commits
- test/support — 3 commits
- guides/semantic_search.md — 2 commits
- .github/FUNDING.yml — 1 commit
- .github/workflows — 1 commit
- guides/img — 1 commit
Notable commits
- fix: Add link to demo to README - Add more tests for pattern matching search - Fix diagram image in semantic search guide - Bump deps
- fix: Fix comparison between distinct types found warning
- fix: Fix bug parsing OpenAI response (#5)
- fix: Fix references to semantic/5 in docs
- change: Add :distance_key option to semantic/5
- change: Add Torus.Embeddings.Gemini
- change: Add Torus.Embeddings.NebulexCache embedding module
- change: Add Torus.sanitize/1
- change: Add config.exs example to semantic search guide
- change: Add ecto_sql as required dep to suppress the warning
- change: Add a link to semantic_search.md guide in Readme
- change: Add credo
- change: Add highlight option (#9)
- change: Add hybrid search via reciprocal rank fusion (#7)
- change: Add optional exla backend for nx
- change: Add stored version of FTS (#2)
- change: Add support for BM25 search (#6)
- change: Add v0.1.0
- change: Change Readme function references to be links
- change: Clarify binary vector distances
- …and 39 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
dimamik/torus was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 18 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 24ba40a42655d32cb2d61adc937b9f8ae540ff77 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-5d04157a340d.