Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Antfly for LangChain

Persistent vector and hybrid retrieval, text/image embeddings, reranking, document and media storage, and graph context backed by an Antfly server. Python 3.11 or newer. Apache-2.0 licensed.

Release candidate: 0.1.0rc1. Requires antfly-sdk>=0.2.1 and a compatible Antfly server; 0.3.0-rc.5 is the tested baseline. See the server setup.

Install

pip install langchain-antfly==0.1.0rc1
# Optional GraphDocument ingestion and graph tools:
pip install 'langchain-antfly[graph]==0.1.0rc1'

The package connects to an existing Antfly server; it does not install or start one. Configure a compatible server with inference enabled and choose an installed embedding model using the setup guide. Models are not downloaded automatically.

Retrieve three documents

import os

from antfly import AntflyClient
from langchain_antfly import AntflyEmbeddings, AntflyVectorStore
from langchain_core.documents import Document

with AntflyClient(
    base_url=os.environ["ANTFLY_URL"], token=os.getenv("ANTFLY_TOKEN")
) as client:
    embeddings = AntflyEmbeddings(
        client=client, model=os.environ["ANTFLY_EMBEDDING_MODEL"]
    )
    store = AntflyVectorStore.from_documents(
        [
            Document(id="owner", page_content="Mira Chen owns operations."),
            Document(id="target", page_content="The shipment target is 120 crates."),
            Document(id="storage", page_content="Apples are stored in the cool warehouse."),
        ],
        embeddings,
        client=client,
        table="langchain_example",
        distance_metric="cosine",
    )
    documents = store.as_retriever(search_kwargs={"k": 1}).invoke(
        "Who owns operations?"
    )
    print(documents[0].page_content)

The factory creates a missing table or reuses a compatible one. Stable document IDs make repeated writes update the same records. To attach without writing, construct AntflyVectorStore(client=client, table="langchain_example", embedding=embeddings). Delete this example's dedicated table with client.drop_table("langchain_example") inside the client context when finished. Async factories, retrieval and mutations are also available.

More examples

Persistent LangGraph agent memory is available separately in langgraph-store-antfly. This package does not include a chat-model adapter or an execution checkpointer.

Metadata

Release files for langchain-antfly 0.1.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-antfly 0.1.0rc1
File Size Uploaded Provenance Actions
langchain_antfly-0.1.0rc1.tar.gz 28.8 kB With provenance Details for langchain_antfly-0.1.0rc1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-antfly 0.1.0rc1
File Interpreter ABI Platform Actions
langchain_antfly-0.1.0rc1-py3-none-any.whl Python 3 none any Details for langchain_antfly-0.1.0rc1-py3-none-any.whl

Total release size: 63.1 kB

Release files / langchain_antfly-0.1.0rc1.tar.gz

Download URL langchain_antfly-0.1.0rc1.tar.gz
Size 28.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2d147c60a904432d4e9631417197e874ebaf4ac1b2c467c78f20b590920e5137
BLAKE2b-256 checksum
How to use checksums
93cccf9168b62350f5cfcffa7d6286fa514a5d0ffa335e11c61d370b3fc98479
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / langchain_antfly-0.1.0rc1-py3-none-any.whl

Download URL langchain_antfly-0.1.0rc1-py3-none-any.whl
Size 34.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dca1fe43fb22e12a2ebaaaa85ae2ac1536ea70018c8e0dabd546b7f9b61282c6
BLAKE2b-256 checksum
How to use checksums
364e2d63ef3736e8c38580bfc19f308f361e0cd8f556ce7a2f8f92a0abaeba1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for langchain-antfly 0.1.0rc1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_antfly-0.1.0rc1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page