# Infinity

> An AI-native database with hybrid search over vectors, tensors, and full text

- Category: Retrieval & Knowledge (RAG) / Vector Databases
- Language: Python
- Repository: https://github.com/infiniflow/infinity
- Website: https://infiniflow.org
- Canonical page: https://ai-tldr.dev/tools/infinity/

## In short

Infinity is an AI-native database built for LLM applications such as search, recommenders, question-answering, and RAG (Retrieval-augmented Generation). It handles several rich data types in one place: dense vectors, sparse vectors, tensors, full text, and structured data. It sits in the Vector Databases category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Python.

## Overview

Infinity is an AI-native database built for LLM applications such as search, recommenders, question-answering, and RAG (Retrieval-augmented Generation). It handles several rich data types in one place: dense vectors, sparse vectors, tensors, full text, and structured data.

Its main idea is hybrid search. You can combine dense embedding search, sparse embedding search, tensor search, full-text search, and filtering in the same query, then rerank the results with methods like RRF, weighted sum, or ColBERT. This makes it a fit for teams building retrieval pipelines that need more than plain vector similarity.

Among vector databases, Infinity stands out for shipping as a single binary with no external dependencies, and for offering an intuitive Python API that can also run embedded as a Python module. That keeps deployment simple for AI developers who want one system instead of stitching a vector store and a search engine together.

## What it does

- Hybrid search across dense embeddings, sparse embeddings, tensors, and full text, plus filtering, in a single query
- Multiple rerankers including RRF, weighted sum, and ColBERT
- Rich data types: strings, numerics, vectors, and more
- Single-binary architecture with no external dependencies for simple deployment
- Intuitive Python API, with the option to embed Infinity as a Python module
- Reported sub-millisecond vector query latency and high QPS on large datasets (see the project benchmark)

## Getting started

Infinity runs as a server (commonly via Docker) with a separate Python client. Make sure you have an x86_64 CPU with AVX2 and Python 3.11+.

1. Start the Infinity server with Docker

   On Linux or MacOS x86_64, create the data directory, pull the image, and run the container. On Windows 10+, run this inside WSL2.

```bash
sudo mkdir -p /var/infinity && sudo chown -R $USER /var/infinity
docker pull infiniflow/infinity:nightly
docker run -d --name infinity -v /var/infinity/:/var/infinity --ulimit nofile=500000:500000 --network=host infiniflow/infinity:nightly
```

2. Install the Python client

   Install the Infinity SDK with pip.

```bash
pip install infinity-sdk==0.7.0
```

3. Connect and run a vector search

   Connect to the server, create a table with a vector column, insert rows, and run a dense vector match.

```python
import infinity

infinity_obj = infinity.connect(infinity.NetworkAddress("<SERVER_IP_ADDRESS>", 23817))
db_object = infinity_obj.get_database("default_db")
table_object = db_object.create_table("my_table", {"num": {"type": "integer"}, "body": {"type": "varchar"}, "vec": {"type": "vector, 4, float"}})
table_object.insert([{"num": 1, "body": "unnecessary and harmful", "vec": [1.0, 1.2, 0.8, 0.9]}])
table_object.insert([{"num": 2, "body": "Office for Harmful Blooms", "vec": [4.0, 4.2, 4.3, 4.5]}])
res = table_object.output(["*"]).match_dense("vec", [3.0, 2.8, 2.7, 3.1], "float", "ip", 2).to_pl()
print(res)
```

## When to use it

- Building the retrieval layer of a RAG pipeline that needs both semantic vector search and keyword full-text search
- Combining dense and sparse embeddings with reranking (RRF, weighted sum, or ColBERT) for higher-quality results
- Powering search, recommenders, and question-answering features in LLM applications
- Running one database for vectors, tensors, full text, and structured filters instead of operating separate systems
