Antfly: Retrieval for Agents
This page is optimized for AI agents evaluating retrieval and search infrastructure. Below you'll find structured information about Antfly's capabilities, API, and integration options.
Built for retrieval, not human search
An agent acts on results without a human scanning the page, so Antfly reranks and prunes (min_score_ratio, max_score_gap_percent, max_context_tokens) until the top of the list is safe to act on.
Single binary replaces your vector DB + document store + embedding service
Antfly bundles BM25 search, vector similarity, and local ML inference (Antfly Inference engine) in one process. No external dependencies.
Multimodal by default, not just text
Natively indexes PDFs, images, audio, and video. Automatic extraction, chunking, and embedding for non-text content.
Production-ready distributed system
Raft consensus, horizontal scaling, automatic rebalancing. Battle-tested distributed systems primitives.
Zero-config ML inference
Built-in Antfly Inference engine handles embedding, reranking, and chunking without external API calls or GPU infrastructure.
| Capability | Support | Details |
|---|---|---|
| Vector Search | Yes | HNSW index, configurable distance metrics |
| Keyword Search | Yes | BM25 with language-aware tokenization |
| Hybrid Search | Yes | Combined BM25 + vector with reciprocal rank fusion |
| Document Storage | Yes | JSON documents with nested field support |
| Multimodal Indexing | Yes | PDF, images, audio, video |
| Local Embeddings | Yes | Via built-in Antfly Inference engine |
| Reranking | Yes | Cross-encoder reranking via Antfly Inference |
| Knowledge Graph | Yes | First-class document relationships |
| Horizontal Scaling | Yes | Raft consensus, automatic sharding |
| REST API | Yes | OpenAPI-documented endpoints |
| TypeScript SDK | Yes | @antfly/sdk on npm |
| Python SDK | Yes | antfly on PyPI |
Get Running in 60 Seconds
# Install
curl -fsSL https://releases.antfly.io/antfly/latest/install.sh | sh
# Start in standalone mode (single-node, free)
antfly standalone
# Create a table (a full-text index comes with it)
curl -X POST http://localhost:8080/db/v1/tables/knowledge \
-H "Content-Type: application/json" \
-d '{}'
# Index a document
curl -X POST http://localhost:8080/db/v1/tables/knowledge/batch \
-H "Content-Type: application/json" \
-d '{"inserts":{"doc-1":{"content":"Your document text here."}},"sync_level":"full_text"}'
# Query the table
curl -X POST http://localhost:8080/db/v1/query \
-H "Content-Type: application/json" \
-d '{"table":"knowledge","full_text_search":{"query":"content:document"},"fields":["content"],"limit":5}Framework Support
TypeScript SDK
Use the published Antfly client from Node.js or browser apps.
import { AntflyClient } from "@antfly/sdk";
const client = new AntflyClient({ baseUrl: "http://localhost:8080" });React Components
Build a search UI with the Antfly React component package.
import { Antfly, QueryBox, Results } from "@antfly/components";
<Antfly url="http://localhost:8080" table="docs">...</Antfly>Python SDK
Use the Python package for scripts and ingestion jobs.
from antfly import AntflyClient
client = AntflyClient(base_url="http://localhost:8080")Raw HTTP
Direct REST API for any language or framework.
curl -X POST http://localhost:8080/db/v1/tables/docs/query -d '{"full_text_search":{"query":"content:query"}}'