{"id":29767897,"url":"https://github.com/janeasystems/jecq","last_synced_at":"2026-05-15T22:04:08.865Z","repository":{"id":302516661,"uuid":"1011790971","full_name":"JaneaSystems/jecq","owner":"JaneaSystems","description":"Faiss-based library for efficient similarity search","archived":false,"fork":false,"pushed_at":"2025-07-18T14:14:52.000Z","size":112,"stargazers_count":54,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-27T03:54:48.784Z","etag":null,"topics":["faiss","iterative-quantization","machine-learning","product-quantization","quantization","rag","recommendation-systems","retrieval-augmented-generation","semantic-search","similarity-search","vector-database","vector-search"],"latest_commit_sha":null,"homepage":"http://janeasystems.com","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JaneaSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-01T10:47:13.000Z","updated_at":"2025-07-19T07:03:36.000Z","dependencies_parsed_at":"2025-07-02T20:47:42.484Z","dependency_job_id":null,"html_url":"https://github.com/JaneaSystems/jecq","commit_stats":null,"previous_names":["janeasystems/jecq"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/JaneaSystems/jecq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaneaSystems%2Fjecq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaneaSystems%2Fjecq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaneaSystems%2Fjecq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaneaSystems%2Fjecq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JaneaSystems","download_url":"https://codeload.github.com/JaneaSystems/jecq/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JaneaSystems%2Fjecq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010258,"owners_count":26084718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["faiss","iterative-quantization","machine-learning","product-quantization","quantization","rag","recommendation-systems","retrieval-augmented-generation","semantic-search","similarity-search","vector-database","vector-search"],"created_at":"2025-07-27T02:40:01.555Z","updated_at":"2025-10-12T04:19:29.095Z","avatar_url":"https://github.com/JaneaSystems.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jecq\n\nJecq (Just Enough Compression \u0026 Quantization) is an open-source C++ library by Janea Systems for efficient similarity search of dense vectors. It is designed as a drop-in replacement for [Faiss](https://github.com/facebookresearch/faiss), Meta’s popular library for fast vector similarity search. Jecq introduces advanced, dimension-aware compression techniques that significantly reduce memory footprint while maintaining high search accuracy. Complete wrappers for Python/numpy are provided.\n\n## Key Features\n### Dimension-Aware Compression\nJecq analyzes the statistical relevance of each vector dimension and applies varying levels of quantization, achieving \nhigh levels of compression while retaining high search accuracy. See [STATISTICS.md](STATISTICS.md) for an example of this in action against a sample dataset. \n\n### Faiss Compatibility\nProvides two Faiss-compatible indices:\n* jecq::IndexJecq – drop-in replacement for faiss::IndexPQ\n* jecq::IndexIVFJecq – drop-in replacement for faiss::IndexIVFPQ\n\n### Hyper-Parameter Optimization\nIncludes a bundled optimizer to help users select hyper-parameters that best balance compression ratio and search accuracy for their data.\n\n### CPU Implementation\nWritten in C++ for CPUs; currently no GPU support.\n\n## Why Use Jecq?\n### Reduced Storage + High Accuracy\nIn our tests against a sample dataset, using IndexPQ as a benchmark, we achieved a compression ratio of 15.9% (~6x compression) while retaining ~85% search accuracy.\n\n### Easy Integration\nSeamlessly integrates with existing Faiss-based pipelines and vector databases.\n\n## How Jecq Compression Works\nJecq’s approach is based on the observation that not all vector dimensions contribute equally to search relevance. Instead of applying uniform compression, Jecq:\n\n* Analyzes variance by computing the eigenvalues of the covariance matrix from training data to measure the statistical relevance (variance) of each dimension.\n\n* Encodes dimensions according to three categories:\n    1. High Variance features are encoded with Product Quantization (PQ), using as many sub-quantizers as dimensions, with 8 bits per dimension.\n    2. Medium Variance features are encoded with Iterative Quantization ([ITQ](https://slazebni.cs.illinois.edu/publications/ITQ.pdf)), with 1 bit per dimension.\n    3. Low Variance features are discarded (0 bits per dimension).\n\n* Stores compressed vectors in a custom, compact format accessible via a lightweight API.\n\nThis non-uniform, relevance-based quantization enables aggressive compression without sacrificing mission-critical search signals.\n\n## Search Functionality\nDistance Metric: Supports [inner product distance](https://github.com/facebookresearch/faiss/wiki/MetricType-and-distances#metric_inner_product) only.\n\n```math\n\\mathrm{search\\_distance}(q, v) = \\mathrm{ip\\_distance}_{\\mathrm{pq\\_features}}(q, v)\\,\\times\\,\\mathrm{pq\\_multiplier}\n\\;+\\;\n\\mathrm{ip\\_distance}_{\\mathrm{itq\\_features}}(q, v)\n```\n\n## Hyper-parameters:\n\n* `pq_multiplier`: Weight for PQ features in search distance calculation.\n* `th_high`: Variance threshold above which features are PQ-encoded.\n* `th_mid`: Variance threshold below which features are discarded.\n\nNote: \"Variance\" here refers to eigenvalues from the covariance matrix, not naive sample variance.\n\n## Installation\nJecq is distributed with precompiled Python libraries. The core is implemented in C++ and requires only a [BLAS](https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms) implementation. Compiles with CMake. See [INSTALL.md](INSTALL.md) for step-by-step instructions.\n\n## Use Cases\n* Retrieval-augmented generation (RAG)\n* Recommendation engines\n* Semantic search\n* Edge AI and IoT deployments\n* Cost-sensitive enterprise AI search\n\n---\n\nCrafted with :heart: by [Janea Systems](https://www.janeasystems.com)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaneasystems%2Fjecq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaneasystems%2Fjecq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaneasystems%2Fjecq/lists"}