← all repositories
antflydb/antfly

One Zig binary that wants to be your search engine, vector DB, and ML stack

Antfly crams BM25, dense and sparse vectors, graph traversal, and in-process ML models into a single embeddable engine that scales from a file to a Raft cluster.

antfly
Too new to rank. Velocity needs a few days of history.
star history

What it does

Antfly is a search-and-inference database written in Zig. One engine handles full-text (BM25), dense vectors (RaBitQ-compressed), sparse vectors (SPLADE), and graph traversal over the same table — and the models that chunk, embed, rerank, transcribe, and OCR run inside the process. Enrichment happens automatically as you write data: embeddings, chunks, entities, and graph edges get generated per index via configurable pipelines. The same engine deploys as a single .aflite file, a single node with hot standby, a multi-Raft cluster, or serverless over object storage (that last one is in progress).

The interesting bit

The scope is the story. Most stacks bolt together Postgres, a vector DB, an embedding service, and a reranker; Antfly wants all four jobs in one process, with a C API and WASM build so the whole thing can run in-process, in unit tests, or in the browser. There’s even a Postgres extension (antfly_postgres) exposing search via an @@@ operator, plus a psql-compatible wire protocol server.

Key highlights

  • Hybrid search fusing BM25, dense, and sparse results via reciprocal rank or relative score fusion
  • Built-in RAG agents with streaming, tool calling, web search, and TOON document rendering to cut prompt tokens
  • Multimodal indexing of images, audio, and video in one vector space with EmbeddingGemma 2
  • Native inference kernels: SIMD on x86/ARM, Metal on Apple silicon, CUDA with build-time-generated kernels
  • Fine-tuning support (LoRA, QLoRA, SFT, DPO, GRPO) and bring-your-own models via Ollama, OpenAI, Bedrock, and others
  • Postgres CDC mirroring, document TTL, ACID transactions, and Wasmtime-based extensions

Caveats

  • The serverless-over-object-storage engine is explicitly marked in progress
  • Automatic shard split/merge is opt-in, not default behavior
  • The feature list is enormous; the README doesn’t say how mature each piece is, so expect uneven depth

Verdict

Worth a look if you’re assembling a RAG or hybrid-search stack and want fewer moving parts — especially appealing if you like the idea of the database embedding your documents literally and figuratively. If you need a battle-proven, single-purpose search engine or vector DB, this much ambition in a young project may give you pause.

Frequently asked

What is antflydb/antfly?
Antfly crams BM25, dense and sparse vectors, graph traversal, and in-process ML models into a single embeddable engine that scales from a file to a Raft cluster.
Is antfly open source?
Yes — antflydb/antfly is open source, released under the Apache-2.0 license.
What language is antfly written in?
antflydb/antfly is primarily written in Zig.
How popular is antfly?
antflydb/antfly has 517 stars on GitHub.
Where can I find antfly?
antflydb/antfly is on GitHub at https://github.com/antflydb/antfly.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.